FACT++  1.0
void print_service_short ( short *  buff,
int  size 
)

Definition at line 1554 of file didMarkus.c.

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

Referenced by did_write_string().

1555 {
1556 int i,j;
1557 char *asc, *ptr, str[80], tmp[256];
1558 short last[8];
1559 
1560  asc = (char *)buff;
1561  ptr = Service_content_str;
1562  ptr += strlen(Service_content_str);
1563  for( i = 0; i < size; i++)
1564  {
1565  strcpy(tmp,"");
1566  if(i%8 == 0)
1567  {
1568  if(i != 0)
1569  {
1570  strcat(tmp," ");
1571  }
1572  sprintf(str,"%5d ",i);
1573  strcat(tmp,str);
1574  }
1575  if(!(i%8))
1576  strcat(tmp,"H: ");
1577  sprintf(str," %04X",buff[i]);
1578  strcat(tmp,str);
1579  last[i%8] = buff[i];
1580  if((i%8 == 7) || (i == (size-1)))
1581  {
1582  /*
1583  if(i%7 != 7)
1584  {
1585  for(j = 1; j < 8 - (i%8); j++)
1586  strcat(tmp," ");
1587  }
1588  strcat(tmp," '");
1589  for(j = 0; j < ((i%8)*2)+2 ; j++)
1590  {
1591  if(isprint(asc[j]))
1592  {
1593  sprintf(str,"%c",asc[j]);
1594  strcat(tmp,str);
1595  }
1596  else
1597  {
1598  sprintf(str,".");
1599  strcat(tmp,str);
1600  }
1601  }
1602  */
1603  strcat(tmp,"\n");
1604  for(j = 0; j <= (i%8); j++)
1605  {
1606  if(j == 0)
1607  strcat(tmp," D: ");
1608  sprintf(str," %5d",last[j]);
1609  strcat(tmp,str);
1610  }
1611  strcat(tmp,"\n");
1612  asc = (char *)&buff[i+1];
1613  }
1614  strcpy(ptr, tmp);
1615  ptr += strlen(tmp);
1616  }
1617  strcpy(tmp,"\n");
1618  strcpy(ptr, tmp);
1619 }
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: