J_Class.c
J_Error_t jParseInterfaces(J_Class* jc,uint8_t* p,uint32_t* poolLen){
  uint16_t i;
  uint8_t* start = p;
  *poolLen = 0;

  if(jc->interfacesCount>0){
	jc->interfaces = (uint16_t*) calloc(jc->interfacesCount,sizeof(uint16_t));
	if(jc->interfaces==NULL){
	  dbg(DBG_MEMORY,"not enought memory for interfaces");
	  return ENOMEM;
	}
	for(i=0;i<jc->interfacesCount;i++){
      jc->interfaces[i] = getUint16(p);
      p += 2;
	}
  }
  *poolLen = p - start;
  return EOK;
}
/**
 * Parse interfaces from the class file 
 */
Parse interfaces from the class file
Parse interfaces from the class file
J_Error_t jParseInterfaces(J_Class* jc,uint8_t* p,uint32_t* poolLen){
  uint16_t i;
  uint8_t* start = p;
  *poolLen = 0;
  if(jc->interfacesCount>0){
	jc->interfaces = (uint16_t*) calloc(jc->interfacesCount,sizeof(uint16_t));
	if(jc->interfaces==NULL){
	  dbg(DBG_MEMORY,"not enought memory for interfaces");
	  return ENOMEM;
	}
	for(i=0;i<jc->interfacesCount;i++){
      jc->interfaces[i] = getUint16(p);
      p += 2;
	}
  }
  *poolLen = p - start;
  return EOK;
}
J_Error_t jParseInterfaces ( J_Class * jc , uint8_t * p , uint32_t * poolLen ) { uint16_t i ; uint8_t * start = p ; * poolLen = 0 ; if ( jc -> interfacesCount > 0 ) { jc -> interfaces = ( uint16_t * ) calloc ( jc -> interfacesCount , sizeof ( uint16_t ) ) ; if ( jc -> interfaces == NULL ) { dbg ( DBG_MEMORY , " " ) ; return ENOMEM ; } for ( i = 0 ; i < jc -> interfacesCount ; i ++ ) { jc -> interfaces [ i ] = getUint16 ( p ) ; p += 2 ; } } * poolLen = p - start ; return EOK ; }
Parse interfaces from the class file
Parse interfaces from the class file