File:  [ELWIX - Embedded LightWeight unIX -] / embedaddon / iftop / stringmap.h
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs - revision graph
Tue Feb 21 16:57:34 2012 UTC (12 years, 3 months ago) by misho
Branches: iftop, MAIN
CVS tags: v1_0rc4, v0_17p0, v0_17, HEAD
iftop

    1: /*
    2:  * stringmap.h:
    3:  * map of strings
    4:  *
    5:  * Copyright (c) 2001 Chris Lightfoot. All rights reserved.
    6:  *
    7:  * $Id: stringmap.h,v 1.1.1.1 2012/02/21 16:57:34 misho Exp $
    8:  *
    9:  */
   10: 
   11: #ifndef __STRINGMAP_H_ /* include guard */
   12: #define __STRINGMAP_H_
   13: 
   14: #include "vector.h"
   15: 
   16: typedef struct _stringmap {
   17:     char *key;
   18:     item d;
   19:     struct _stringmap *l, *g;
   20: } *stringmap;
   21: 
   22: stringmap stringmap_new(void);
   23: void      stringmap_delete(stringmap);
   24: void      stringmap_delete_free(stringmap);
   25: 
   26: /* Try to insert an item into a stringmap, returning 1 if the map already
   27:  * contained an item with that key.
   28:  */
   29: item *stringmap_insert(stringmap, const char*, const item);
   30: /* Find an item in a stringmap */
   31: stringmap     stringmap_find(const stringmap, const char*);
   32: 
   33: #endif /* __STRINGMAP_H_ */

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>