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

Definition at line 1621 of file didMarkus.c.

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

Referenced by did_write_string().

1622 {
1623 int i,j;
1624 char *asc, *ptr, str[80], tmp[256];
1625 char last[16];
1626 
1627  asc = (char *)buff;
1628  ptr = Service_content_str;
1629  ptr += strlen(Service_content_str);
1630  for( i = 0; i < size; i++)
1631  {
1632  strcpy(tmp,"");
1633  if(i%16 == 0)
1634  {
1635  if(i != 0)
1636  {
1637  strcat(tmp," ");
1638  }
1639  sprintf(str,"%5d ",i);
1640  strcat(tmp,str);
1641  }
1642  if(!(i%16))
1643  strcat(tmp,"H: ");
1644  sprintf(str,"%02X",buff[i]);
1645 /* strcat(tmp,str);
1646 */
1647  strcat(tmp," ");
1648  strcat(tmp,&str[strlen(str)-2]);
1649  last[i%16] = buff[i];
1650  /*
1651  if(i%4 == 3)
1652  strcat(tmp," ");
1653  */
1654  if((i%16 == 15) || (i == (size-1)))
1655  {
1656  if(i%16 != 15)
1657  {
1658  for(j = 1; j < 16 - (i%16); j++)
1659  strcat(tmp," ");
1660  }
1661  strcat(tmp," '");
1662  for(j = 0; j <= (i%16) ; j++)
1663  {
1664  if(isprint(asc[j]))
1665  {
1666  sprintf(str,"%c",asc[j]);
1667  strcat(tmp,str);
1668  }
1669  else
1670  {
1671  sprintf(str,".");
1672  strcat(tmp,str);
1673  }
1674  }
1675  strcat(tmp,"'\n");
1676  asc = (char *)&buff[i+1];
1677  }
1678  strcpy(ptr, tmp);
1679  ptr += strlen(tmp);
1680  }
1681  strcpy(tmp,"\n");
1682  strcpy(ptr, tmp);
1683 }
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
char * Service_content_str
Definition: didMarkus.c:20
sprintf(name1,"NewService%d", i)

+ Here is the call graph for this function:

+ Here is the caller graph for this function: