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

Definition at line 916 of file webDid.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, sitem::timestamp, and type.

Referenced by recv_service_info().

917 {
918 char type;
919 int num, ret;
920 char str[256];
921 char *ptr;
922 void *buffer_ptr;
923 char timestr[256], aux[64], sizestr[64];
924 int quality = 0, secs = 0, mili = 0;
925 int did_write_string(char, int, void **, int);
926 time_t tsecs;
927 
928  if(size < 1024)
929  sprintf(sizestr,"%d bytes",size);
930  else if (size < 1024*1024)
931  sprintf(sizestr,"%2.2f Kb",(float)size/1024);
932  else
933  sprintf(sizestr,"%2.2f Mb",(float)size/(1024*1024));
934 
936  "<FONT FACE=\"consolas\">Service %s (%s) Contents :<br /> <br />", Curr_service_name,
938  dic_get_timestamp(0, &secs, &mili);
939  quality = dic_get_quality(0);
940  tsecs = secs;
941  servicep->timestamp = tsecs;
942  my_ctime(&tsecs, timestr, 128);
943  ptr = strrchr(timestr,' ');
944  strcpy(aux, ptr);
945  sprintf(ptr,".%03d",mili);
946  strcat(timestr, aux);
947  timestr[(int)strlen(timestr)-1] = '\0';
948 
949  sprintf(str," Timestamp: %s&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp Quality: %d&nbsp&nbsp&nbsp Size: %s<br /><br />",
950  timestr, quality, sizestr);
951 
952  strcat(Service_content_str,str);
953  ptr = Curr_service_format;
954  buffer_ptr = buff;
955  while(*ptr)
956  {
957  type = *ptr++;
958  if(*ptr == ':')
959  {
960  ptr++;
961  sscanf(ptr, "%d", &num);
962  ret = did_write_string(type, num, &buffer_ptr, size);
963  size -= ret;
964  if( (ptr = strchr(ptr,';')) )
965  ptr++;
966  else
967  break;
968  }
969  else
970  {
971  ret = did_write_string(type, 0, &buffer_ptr, size);
972  size -= ret;
973  break;
974  }
975  }
976  strcat(Service_content_str,"</FONT>");
977 }
#define my_ctime(t, str, size)
Definition: dim_common.h:275
char str[80]
Definition: test_client.c:7
char Curr_service_format[256]
Definition: webDid.c:102
char Curr_service_name[132]
Definition: webDid.c:101
int dic_get_quality(unsigned serv_id)
Definition: dic.c:937
int did_write_string(char type, int num, void **buffer_ptr, int ssize)
Definition: webDid.c:980
int type
int size
Definition: db_dim_server.c:17
int buff[BUFFSIZE]
Definition: db_dim_client.c:15
time_t timestamp
Definition: webDid.c:37
sprintf(name1,"NewService%d", i)
char * Service_content_str
Definition: webDid.c:112
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: