extern short byte[2000];

void read_attributes(int totala)
{
  int i;
  int  j,k,attribute_length;


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

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

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


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

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

      i = read_bytes(4);
      if (i==-1) exit(0);
      printf("**********Attribute Length **********\n");
      attribute_length = (byte[0]<<24) | (byte[1]<<16) | (byte[2] <<8)| byte[3];
      printf("%d\n",attribute_length);


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

      for( k =0;k<attribute_length;k++)
	{
	  i =read_bytes(1);
	  if (i==-1) exit(0);
	  print_bytes(1);
	}

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

}
