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

Definition at line 1204 of file didMarkus.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().

1205 {
1206 char type;
1207 int num, ret;
1208 char str[128];
1209 char *ptr;
1210 void *buffer_ptr;
1211 char timestr[128], aux[10];
1212 int quality = 0, secs = 0, mili = 0;
1213 int did_write_string(char, int, void **, int);
1214 time_t tsecs;
1215 
1217  "Service %s (%s) Contents :\n \n", Curr_service_name,
1219  /*
1220  if(Curr_service_id)
1221  {
1222  */
1223  dic_get_timestamp(0, &secs, &mili);
1224  quality = dic_get_quality(0);
1225 /*
1226 #ifdef LYNXOS
1227  ctime_r((time_t *)&secs, timestr, 128);
1228 #else
1229  ctime_r((time_t *)&secs, timestr);
1230 #endif
1231 */
1232  tsecs = secs;
1233  my_ctime(&tsecs, timestr, 128);
1234  ptr = strrchr(timestr,' ');
1235  strcpy(aux, ptr);
1236  sprintf(ptr,".%03d",mili);
1237  strcat(timestr, aux);
1238  timestr[strlen(timestr)-1] = '\0';
1239 
1240  sprintf(str," Timestamp: %s Quality: %d\n\n",
1241  timestr, quality);
1242 
1243  strcat(Service_content_str,str);
1244  /*
1245  }
1246  */
1247  ptr = Curr_service_format;
1248  buffer_ptr = buff;
1249  while(*ptr)
1250  {
1251  type = *ptr++;
1252  if(*ptr == ':')
1253  {
1254  ptr++;
1255  sscanf(ptr, "%d", &num);
1256  ret = did_write_string(type, num, &buffer_ptr, size);
1257  size -= ret;
1258  if( (ptr = strchr(ptr,';')) )
1259  ptr++;
1260  else
1261  break;
1262  }
1263  else
1264  {
1265  ret = did_write_string(type, 0, &buffer_ptr, size);
1266  size -= ret;
1267  break;
1268  }
1269  }
1270 }
#define my_ctime(t, str, size)
Definition: dim_common.h:275
char str[80]
Definition: test_client.c:7
int dic_get_quality(unsigned serv_id)
Definition: dic.c:937
int type
char Curr_service_name[132]
Definition: didMarkus.c:12
int did_write_string(char type, int num, void **buffer_ptr, int ssize)
Definition: didMarkus.c:1272
int size
Definition: db_dim_server.c:17
int buff[BUFFSIZE]
Definition: db_dim_client.c:15
char * Service_content_str
Definition: didMarkus.c:20
sprintf(name1,"NewService%d", i)
char Curr_service_format[256]
Definition: didMarkus.c:13
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: