extern short byte[2000];
void read_fields(int totalf)
{
  int i;
  int  j,attribute_count;

  void printf();
  int read_bytes(int);
  void print_bytes(int);


  void read_attributes(int);

  printf("&&&&&&&&&&Reading Fields&&&&&&&&&&\n");

  for(j=0; j< totalf ;j++)
    {
      printf("--------------------------------------------------------------------\n");


      printf(" Field no: %d \n",j);

      i = read_bytes(2);
      if (i==-1) exit(0);
      printf("**********Access Flags**********\n");
      print_bytes(2);

      i = read_bytes(2);
      if (i==-1) exit(0);
      printf("**********Name Index **********\n");
      print_bytes(2);

      i = read_bytes(2);
      if (i==-1) exit(0);
      printf("**********Signature Index**********\n");
      print_bytes(2);

      i = read_bytes(2);
      if (i==-1) exit(0);
      printf("**********AttributeCount**********\n");
      print_bytes(2);
      printf("Attribute Count is%d\n",(byte[0]<<8)|byte[1]);

      attribute_count=(byte[0]<<8)| byte[1];

    printf("--------------------------------------------------------------------\n");


      if (attribute_count > 0)
	read_attributes(attribute_count);
    }

}
