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

Definition at line 1648 of file did.c.

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

Referenced by did_write_string().

1649 {
1650 int i,j;
1651 char *asc, *ptr, str[80], tmp[256];
1652 /*
1653 char last[16];
1654 */
1655  asc = (char *)buff;
1656  ptr = Service_content_str;
1657  ptr += strlen(Service_content_str);
1658  for( i = 0; i < size; i++)
1659  {
1660  strcpy(tmp,"");
1661  if(i%16 == 0)
1662  {
1663  if(i != 0)
1664  {
1665  strcat(tmp," ");
1666  }
1667  sprintf(str,"%5d ",i);
1668  strcat(tmp,str);
1669  }
1670  if(!(i%16))
1671  strcat(tmp,"H: ");
1672  sprintf(str,"%02X",buff[i]);
1673 /* strcat(tmp,str);
1674 */
1675  strcat(tmp," ");
1676  strcat(tmp,&str[strlen(str)-2]);
1677  /*
1678  last[i%16] = buff[i];
1679  if(i%4 == 3)
1680  strcat(tmp," ");
1681  */
1682  if((i%16 == 15) || (i == (size-1)))
1683  {
1684  if(i%16 != 15)
1685  {
1686  for(j = 1; j < 16 - (i%16); j++)
1687  strcat(tmp," ");
1688  }
1689  strcat(tmp," '");
1690  for(j = 0; j <= (i%16) ; j++)
1691  {
1692  if(isprint(asc[j]))
1693  {
1694  sprintf(str,"%c",asc[j]);
1695  strcat(tmp,str);
1696  }
1697  else
1698  {
1699  sprintf(str,".");
1700  strcat(tmp,str);
1701  }
1702  }
1703  strcat(tmp,"'\n");
1704  asc = (char *)&buff[i+1];
1705  }
1706  strcpy(ptr, tmp);
1707  ptr += strlen(tmp);
1708  }
1709  strcpy(tmp,"\n");
1710  strcpy(ptr, tmp);
1711 }
int i
Definition: db_dim_client.c:21
char str[80]
Definition: test_client.c:7
char * Service_content_str
Definition: did.c:20
int size
Definition: db_dim_server.c:17
int buff[BUFFSIZE]
Definition: db_dim_client.c:15
sprintf(name1,"NewService%d", i)

+ Here is the call graph for this function:

+ Here is the caller graph for this function: