mirror of
https://github.com/openvswitch/ovs
synced 2025-10-25 15:07:05 +00:00
Import from old repository commit 61ef2b42a9c4ba8e1600f15bb0236765edc2ad45.
This commit is contained in:
42
lib/shash.h
Normal file
42
lib/shash.h
Normal file
@@ -0,0 +1,42 @@
|
||||
/*
|
||||
* Copyright (c) 2009 Nicira Networks.
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
* copyright notice and this permission notice appear in all copies.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
#ifndef SHASH_H
|
||||
#define SHASH_H 1
|
||||
|
||||
#include "hmap.h"
|
||||
|
||||
struct shash_node {
|
||||
struct hmap_node node;
|
||||
char *name;
|
||||
void *data;
|
||||
};
|
||||
|
||||
struct shash {
|
||||
struct hmap map;
|
||||
};
|
||||
|
||||
#define SHASH_INITIALIZER(SHASH) { HMAP_INITIALIZER(&(SHASH)->map) }
|
||||
|
||||
void shash_init(struct shash *);
|
||||
void shash_destroy(struct shash *);
|
||||
void shash_clear(struct shash *);
|
||||
void shash_add(struct shash *, const char *, void *);
|
||||
void shash_delete(struct shash *, struct shash_node *);
|
||||
struct shash_node *shash_find(const struct shash *, const char *);
|
||||
void *shash_find_data(const struct shash *, const char *);
|
||||
|
||||
#endif /* shash.h */
|
||||
Reference in New Issue
Block a user