FACT++  1.0
void print_service_formatted ( void *  buff,
int  size 
)

Definition at line 1219 of file did.c.

References buff, Curr_service_format, Curr_service_name, dic_get_quality(), dic_get_timestamp(), did_write_string(), my_ctime, Service_content_str, sprintf(), str, and type.

Referenced by cancel_pop_up(), and recv_service_info().

1220 {
1221 char type;
1222 int num, ret;
1223 char str[128];
1224 char *ptr;
1225 void *buffer_ptr;
1226 char timestr[128], aux[10];
1227 int quality = 0, secs = 0, mili = 0;
1228 int did_write_string(char, int, void **, int);
1229 time_t tsecs;
1230 
1232  "Service %s (%s) Contents :\n \n", Curr_service_name,
1234  /*
1235  if(Curr_service_id)
1236  {
1237  */
1238  dic_get_timestamp(0, &secs, &mili);
1239  quality = dic_get_quality(0);
1240 /*
1241 #ifdef LYNXOS
1242  ctime_r((time_t *)&secs, timestr, 128);
1243 #else
1244  ctime_r((time_t *)&secs, timestr);
1245 #endif
1246 */
1247  tsecs = secs;
1248  my_ctime(&tsecs, timestr, 128);
1249  ptr = strrchr(timestr,' ');
1250  strcpy(aux, ptr);
1251  sprintf(ptr,".%03d",mili);
1252  strcat(timestr, aux);
1253  timestr[strlen(timestr)-1] = '\0';
1254 
1255  sprintf(str," Timestamp: %s Quality: %d\n\n",
1256  timestr, quality);
1257 
1258  strcat(Service_content_str,str);
1259  /*
1260  }
1261  */
1262  ptr = Curr_service_format;
1263  buffer_ptr = buff;
1264  while(*ptr)
1265  {
1266  type = *ptr++;
1267  if(*ptr == ':')
1268  {
1269  ptr++;
1270  sscanf(ptr, "%d", &num);
1271  ret = did_write_string(type, num, &buffer_ptr, size);
1272  size -= ret;
1273  if( (ptr = strchr(ptr,';')) )
1274  ptr++;
1275  else
1276  break;
1277  }
1278  else
1279  {
1280  ret = did_write_string(type, 0, &buffer_ptr, size);
1281  size -= ret;
1282  break;
1283  }
1284  }
1285 }
#define my_ctime(t, str, size)
Definition: dim_common.h:275
char Curr_service_name[132]
Definition: did.c:12
char str[80]
Definition: test_client.c:7
int dic_get_quality(unsigned serv_id)
Definition: dic.c:937
char * Service_content_str
Definition: did.c:20
int type
int did_write_string(char type, int num, void **buffer_ptr, int ssize)
Definition: did.c:1287
int size
Definition: db_dim_server.c:17
char Curr_service_format[256]
Definition: did.c:13
int buff[BUFFSIZE]
Definition: db_dim_client.c:15
sprintf(name1,"NewService%d", i)
int dic_get_timestamp(unsigned serv_id, int *secs, int *milisecs)
Definition: dic.c:984

+ Here is the call graph for this function:

+ Here is the caller graph for this function: