File: dict_private.h

package info (click to toggle)
openmpi 5.0.7-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 202,312 kB
  • sloc: ansic: 612,441; makefile: 42,495; sh: 11,230; javascript: 9,244; f90: 7,052; java: 6,404; perl: 5,154; python: 1,856; lex: 740; fortran: 61; cpp: 20; tcl: 12
file content (83 lines) | stat: -rw-r--r-- 2,758 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
/*
 * dict_private.h
 *
 * Private definitions for libdict.
 * Copyright (C) 2001 Farooq Mela.
 *
 * $Id: dict_private.h,v 1.8 2002/01/02 09:14:11 farooq Exp $
 */

#ifndef _DICT_PRIVATE_H_
#define _DICT_PRIVATE_H_

#include "dict.h"

typedef int			 (*insert_func)		__P((void *, void *k, void *d, int o));
typedef int			 (*probe_func)		__P((void *, void *k, void **d));
typedef void		*(*search_func)		__P((void *, const void *k));
typedef int			 (*remove_func)		__P((void *, const void *k, int d));
typedef void		 (*walk_func)		__P((void *, dict_vis_func visit));
typedef unsigned	 (*count_func)		__P((const void *));
typedef void		 (*empty_func)		__P((void *, int del));
typedef void		 (*destroy_func)	__P((void *, int del));
typedef dict_itor	*(*inew_func)		__P((void *));

typedef void		 (*idestroy_func)	__P((void *));
typedef int			 (*valid_func)		__P((const void *));
typedef void		 (*invalidate_func)	__P((void *));
typedef int			 (*next_func)		__P((void *));
typedef int			 (*prev_func)		__P((void *));
typedef int			 (*nextn_func)		__P((void *, unsigned count));
typedef int			 (*prevn_func)		__P((void *, unsigned count));
typedef int			 (*first_func)		__P((void *));
typedef int			 (*last_func)		__P((void *));
typedef int			 (*isearch_func)	__P((void *, const void *k));
typedef const void	*(*key_func)		__P((void *));
typedef void		*(*data_func)		__P((void *));
typedef const void	*(*cdata_func)		__P((const void *));
typedef int			 (*dataset_func)	__P((void *, void *d, int del));
typedef int			 (*iremove_func)	__P((void *, int del));
typedef int			 (*icompare_func)	__P((void *, void *itor2));

#ifndef NDEBUG
# include <stdio.h>
# undef ASSERT
# if defined(__GNUC__)
#  define ASSERT(expr)														\
	if (!(expr))															\
		fprintf(stderr, "\n%s:%d (%s) assertion failed: `%s'\n",			\
				__FILE__, __LINE__, __func__, #expr),			\
		abort()
# else
#  define ASSERT(expr)														\
	if (!(expr))															\
		fprintf(stderr, "\n%s:%d assertion failed: `%s'\n",					\
				__FILE__, __LINE__, #expr),									\
		abort()
# endif
#else
# define ASSERT(expr)
#endif

extern dict_malloc_func ompi_coll_libnbc_dict_malloc;
extern dict_free_func ompi_coll_libnbc_dict_free;
#define MALLOC(n)	(*ompi_coll_libnbc_dict_malloc)(n)
#define FREE(p)		(*ompi_coll_libnbc_dict_free)(p)

#define ABS(a)		((a) < 0 ? -(a) : +(a))
#define MIN(a,b)	((a) < (b) ? (a) : (b))
#define MAX(a,b)	((a) > (b) ? (a) : (b))
#define SWAP(a,b,v)	v = (a), (a) = (b), (b) = v
#define UNUSED(p)	(void)&p

#if defined(__GNUC__)
# define GCC_INLINE		inline
# define GCC_UNUSED		__attribute__((__unused__))
# define GCC_CONST		__attribute__((__const__))
#else
# define GCC_INLINE
# define GCC_UNUSED
# define GCC_CONST
#endif

#endif /* !_DICT_PRIVATE_H_ */