ucif/antlr3/src/antlr3collections.c
pANTLR3_HASH_ENUM
antlr3EnumNew   (pANTLR3_HASH_TABLE table)
{
    pANTLR3_HASH_ENUM   en;

    /* Allocate structure memory
     */
    en    = (pANTLR3_HASH_ENUM) ANTLR3_MALLOC((size_t)sizeof(ANTLR3_HASH_ENUM));

    /* Check that the allocation was good
     */
    if  (en == NULL)
    {
        return  (pANTLR3_HASH_ENUM) ANTLR3_FUNC_PTR(ANTLR3_ERR_NOMEM);
    }

    /* Initialize the start pointers
    */
    en->table   = table;
    en->bucket  = 0;                            /* First bucket             */
    en->entry   = en->table->buckets->entries;  /* First entry to return    */

    /* Special case in that the first bucket may not have anything in it
     * but the antlr3EnumNext() function expects that the en->entry is
     * set to the next valid pointer. Hence if it is not a valid element
     * pointer, attempt to find the next one that is, (table may be empty
     * of course.
     */
    if  (en->entry == NULL)
    {
        antlr3EnumNextEntry(en);
    }

    /* Install the interface
     */
    en->free    =  antlr3EnumFree;
    en->next    =  antlr3EnumNext;

    /* All is good
     */
    return  en;
}
/** \brief Creates an enumeration structure to traverse the hash table.
 *
 * \param table Table to enumerate
 * \return Pointer to enumeration structure.
 */
\brief Creates an enumeration structure to traverse the hash table.
\param table Table to enumerate
\return Pointer to enumeration structure.
\ brief Creates an enumeration structure to traverse the hash table . \ param table Table to enumerate \ return Pointer to enumeration structure .
pANTLR3_HASH_ENUM
antlr3EnumNew   (pANTLR3_HASH_TABLE table)
{
    pANTLR3_HASH_ENUM   en;
    en    = (pANTLR3_HASH_ENUM) ANTLR3_MALLOC((size_t)sizeof(ANTLR3_HASH_ENUM));
    if  (en == NULL)
    {
        return  (pANTLR3_HASH_ENUM) ANTLR3_FUNC_PTR(ANTLR3_ERR_NOMEM);
    }
    en->table   = table;
    en->bucket  = 0;                            
    en->entry   = en->table->buckets->entries;  
    if  (en->entry == NULL)
    {
        antlr3EnumNextEntry(en);
    }
    en->free    =  antlr3EnumFree;
    en->next    =  antlr3EnumNext;
    return  en;
}
pANTLR3_HASH_ENUM antlr3EnumNew ( pANTLR3_HASH_TABLE table ) { pANTLR3_HASH_ENUM en ; en = ( pANTLR3_HASH_ENUM ) ANTLR3_MALLOC ( ( size_t ) sizeof ( ANTLR3_HASH_ENUM ) ) ; if ( en == NULL ) { return ( pANTLR3_HASH_ENUM ) ANTLR3_FUNC_PTR ( ANTLR3_ERR_NOMEM ) ; } en -> table = table ; en -> bucket = 0 ; en -> entry = en -> table -> buckets -> entries ; if ( en -> entry == NULL ) { antlr3EnumNextEntry ( en ) ; } en -> free = antlr3EnumFree ; en -> next = antlr3EnumNext ; return en ; }
\brief Creates an enumeration structure to traverse the hash table.
\ brief Creates an enumeration structure to traverse the hash table .
/* Allocate structure memory
     */ /* Check that the allocation was good
     */ /* Initialize the start pointers
    */ /* First bucket             */ /* First entry to return    */ /* Special case in that the first bucket may not have anything in it
     * but the antlr3EnumNext() function expects that the en->entry is
     * set to the next valid pointer. Hence if it is not a valid element
     * pointer, attempt to find the next one that is, (table may be empty
     * of course.
     */ /* Install the interface
     */ /* All is good
     */