FACT++  1.0
void print_service_char ( char *  buff,
int  size 
)

Definition at line 1216 of file webDid.c.

References i, Service_content_str, size, sprintf(), sprintf_html(), and str.

Referenced by did_write_string().

1217 {
1218 int i,j;
1219 char *asc, *ptr, str[80], tmp[256];
1220 
1221  asc = (char *)buff;
1222  ptr = Service_content_str;
1223  ptr += (int)strlen(Service_content_str);
1224  for( i = 0; i < size; i++)
1225  {
1226  strcpy(tmp,"");
1227  if(i%16 == 0)
1228  {
1229  if(i != 0)
1230  {
1231  strcat(tmp,"&nbsp");
1232  }
1233  sprintf_html(str, 7, i);
1234  strcat(tmp,str);
1235  }
1236  if(!(i%16))
1237  strcat(tmp,"H: ");
1238  sprintf(str,"%02X",buff[i]);
1239 /* strcat(tmp,str);
1240 */
1241  strcat(tmp," ");
1242  strcat(tmp,&str[(int)strlen(str)-2]);
1243  /*
1244  if(i%4 == 3)
1245  strcat(tmp," ");
1246  */
1247  if((i%16 == 15) || (i == (size-1)))
1248  {
1249  if(i%16 != 15)
1250  {
1251  for(j = 1; j < 16 - (i%16); j++)
1252  strcat(tmp,"&nbsp&nbsp ");
1253  }
1254  strcat(tmp,"&nbsp&nbsp&nbsp '");
1255  for(j = 0; j <= (i%16) ; j++)
1256  {
1257  if(isprint(asc[j]))
1258  {
1259  if(asc[j] == ' ')
1260  sprintf(str,"&nbsp");
1261  else if(asc[j] == '<')
1262  sprintf(str,"&lt");
1263  else if(asc[j] == '>')
1264  sprintf(str,"&gt");
1265  else if(asc[j] == '&')
1266  sprintf(str,"&amp");
1267  else
1268  sprintf(str,"%c",asc[j]);
1269  strcat(tmp,str);
1270  }
1271  else
1272  {
1273  sprintf(str,".");
1274  strcat(tmp,str);
1275  }
1276  }
1277  strcat(tmp,"'<br />");
1278  asc = (char *)&buff[i+1];
1279  }
1280  strcpy(ptr, tmp);
1281  ptr += (int)strlen(tmp);
1282  }
1283  strcpy(tmp,"<br />");
1284  strcpy(ptr, tmp);
1285 }
int i
Definition: db_dim_client.c:21
char str[80]
Definition: test_client.c:7
int size
Definition: db_dim_server.c:17
int buff[BUFFSIZE]
Definition: db_dim_client.c:15
void sprintf_html(char *str, int n, int value)
Definition: webDid.c:1070
sprintf(name1,"NewService%d", i)
char * Service_content_str
Definition: webDid.c:112

+ Here is the call graph for this function:

+ Here is the caller graph for this function: