src/classify/protos.cpp
int AddProtoToClass(CLASS_TYPE Class) {
  if (Class->NumProtos >= Class->MaxNumProtos) {
    /* add protos in PROTO_INCREMENT chunks at a time */
    int NewNumProtos =
        (((Class->MaxNumProtos + PROTO_INCREMENT) / PROTO_INCREMENT) * PROTO_INCREMENT);

    Class->Prototypes.resize(NewNumProtos);

    Class->MaxNumProtos = NewNumProtos;
    ASSERT_HOST(NewNumProtos <= MAX_NUM_PROTOS);
  }
  int NewProto = Class->NumProtos++;
  ASSERT_HOST(Class->NumProtos <= MAX_NUM_PROTOS);
  return (NewProto);
}
/**
 * @name AddProtoToClass
 *
 * Add a new proto to this class.  Malloc new space and copy the
 * old protos if necessary.  Return the proto id for the new proto.
 *
 * @param Class The class to add to
 */
@name AddProtoToClass
Add a new proto to this class.  Malloc new space and copy the
old protos if necessary.  Return the proto id for the new proto.

@param Class The class to add to
@name AddProtoToClass Add a new proto to this class . Malloc new space and copy the old protos if necessary . Return the proto id for the new proto . @param Class The class to add to
int AddProtoToClass(CLASS_TYPE Class) {
  if (Class->NumProtos >= Class->MaxNumProtos) {
    int NewNumProtos =
        (((Class->MaxNumProtos + PROTO_INCREMENT) / PROTO_INCREMENT) * PROTO_INCREMENT);
    Class->Prototypes.resize(NewNumProtos);
    Class->MaxNumProtos = NewNumProtos;
    ASSERT_HOST(NewNumProtos <= MAX_NUM_PROTOS);
  }
  int NewProto = Class->NumProtos++;
  ASSERT_HOST(Class->NumProtos <= MAX_NUM_PROTOS);
  return (NewProto);
}
int AddProtoToClass ( CLASS_TYPE Class ) { if ( Class -> NumProtos >= Class -> MaxNumProtos ) { int NewNumProtos = ( ( ( Class -> MaxNumProtos + PROTO_INCREMENT ) / PROTO_INCREMENT ) * PROTO_INCREMENT ) ; Class -> Prototypes . resize ( NewNumProtos ) ; Class -> MaxNumProtos = NewNumProtos ; ASSERT_HOST ( NewNumProtos <= MAX_NUM_PROTOS ) ; } int NewProto = Class -> NumProtos ++ ; ASSERT_HOST ( Class -> NumProtos <= MAX_NUM_PROTOS ) ; return ( NewProto ) ; }
@name AddProtoToClass
 Add a new proto to this class.
@name AddProtoToClass Add a new proto to this class .
/* add protos in PROTO_INCREMENT chunks at a time */