assoctab.h 648 Bytes
/*
 * Copyright (C) 1996-1998 by the Board of Trustees
 *    of Leland Stanford Junior University.
 * 
 * This file is part of the SimOS distribution. 
 * See LICENSE file for terms of the license. 
 *
 */


#ifndef _ASSOCTAB_H_
#define _ASSOCTAB_H_

#define AT_OK    0
#define AT_ERROR 1

typedef struct ATHeader ATHeader;

struct ATHeader {
   char *label;
   ATHeader *next;
};

typedef ATHeader *AssocTab;

AssocTab *AssocTabCreate(void);
int AssocTabEnter(AssocTab *at, ATHeader *item);
int AssocTabLookup(AssocTab *at, char *index, ATHeader **item);

#ifdef DEBUG
void AssocTabForeach(AssocTab *at, void (*p)(ATHeader *item));
#endif

#endif