FACT++  1.0
static int get_format_data ( FORMAT_STR format_data,
char *  def 
)
static

Definition at line 533 of file dis_old.c.

References FORMAT_STR::flags, IT_IS_FLOAT, NOSWAP, FORMAT_STR::par_bytes, FORMAT_STR::par_num, SIZEOF_CHAR, SIZEOF_DOUBLE, SIZEOF_FLOAT, SIZEOF_LONG, SIZEOF_SHORT, SWAPD, SWAPL, and SWAPS.

Referenced by do_dis_add_cmnd_dns(), and do_dis_add_service_dns().

534 {
535  register char code, last_code = 0;
536  int num;
537 
538  code = *def;
539  while(*def)
540  {
541  if(code != last_code)
542  {
543  format_data->par_num = 0;
544  format_data->flags = 0;
545  switch(code)
546  {
547  case 'i':
548  case 'I':
549  case 'l':
550  case 'L':
551  format_data->par_bytes = SIZEOF_LONG;
552  format_data->flags |= SWAPL;
553  break;
554  case 'x':
555  case 'X':
556  format_data->par_bytes = SIZEOF_DOUBLE;
557  format_data->flags |= SWAPD;
558  break;
559  case 's':
560  case 'S':
561  format_data->par_bytes = SIZEOF_SHORT;
562  format_data->flags |= SWAPS;
563  break;
564  case 'f':
565  case 'F':
566  format_data->par_bytes = SIZEOF_FLOAT;
567  format_data->flags |= SWAPL;
568 #ifdef vms
569  format_data->flags |= IT_IS_FLOAT;
570 #endif
571  break;
572  case 'd':
573  case 'D':
574  format_data->par_bytes = SIZEOF_DOUBLE;
575  format_data->flags |= SWAPD;
576 #ifdef vms
577  format_data->flags |= IT_IS_FLOAT;
578 #endif
579  break;
580  case 'c':
581  case 'C':
582  format_data->par_bytes = SIZEOF_CHAR;
583  format_data->flags |= NOSWAP;
584  break;
585  }
586  }
587  def++;
588  if(*def != ':')
589  {
590  if(*def)
591  {
592 /*
593  printf("Bad service definition parsing\n");
594  fflush(stdout);
595 
596  error_handler("Bad service definition parsing",2);
597 */
598  return(0);
599  }
600  else
601  format_data->par_num = 0;
602  }
603  else
604  {
605  def++;
606  sscanf(def,"%d",&num);
607  format_data->par_num += num;
608  while((*def != ';') && (*def != '\0'))
609  def++;
610  if(*def)
611  def++;
612  }
613  last_code = code;
614  code = *def;
615  if(code != last_code)
616  format_data++;
617  }
618  format_data->par_bytes = 0;
619  return(1);
620 }
Definition: dim.h:191
short flags
Definition: dim.h:219
Definition: dim.h:191
Definition: dim.h:191
#define SIZEOF_CHAR
Definition: dim.h:596
short par_bytes
Definition: dim.h:218
#define SIZEOF_FLOAT
Definition: dim.h:599
#define SIZEOF_DOUBLE
Definition: dim.h:600
int par_num
Definition: dim.h:217
#define SIZEOF_LONG
Definition: dim.h:598
#define IT_IS_FLOAT
Definition: dim.h:27
#define SIZEOF_SHORT
Definition: dim.h:597
Definition: dim.h:191

+ Here is the caller graph for this function: