Add GNU LGPL headers to all .c .C and .h files
[oweals/cde.git] / cde / lib / csa / nametbl.h
1 /*
2  * CDE - Common Desktop Environment
3  *
4  * Copyright (c) 1993-2012, The Open Group. All rights reserved.
5  *
6  * These libraries and programs are free software; you can
7  * redistribute them and/or modify them under the terms of the GNU
8  * Lesser General Public License as published by the Free Software
9  * Foundation; either version 2 of the License, or (at your option)
10  * any later version.
11  *
12  * These libraries and programs are distributed in the hope that
13  * they will be useful, but WITHOUT ANY WARRANTY; without even the
14  * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15  * PURPOSE. See the GNU Lesser General Public License for more
16  * details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with these librararies and programs; if not, write
20  * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
21  * Floor, Boston, MA 02110-1301 USA
22  */
23 /* $XConsortium: nametbl.h /main/1 1996/04/21 19:24:05 drk $ */
24 /*
25  *  (c) Copyright 1993, 1994 Hewlett-Packard Company
26  *  (c) Copyright 1993, 1994 International Business Machines Corp.
27  *  (c) Copyright 1993, 1994 Novell, Inc.
28  *  (c) Copyright 1993, 1994 Sun Microsystems, Inc.
29  */
30
31 #ifndef _NAMETBL_H
32 #define _NAMETBL_H
33
34 /*
35  * Contain the definition for a hashed name table for attribute names.
36  * It is intended to be used by both the library and the daemon to
37  * build name tables for calendar attribute names and entry attribute
38  * names.
39  */
40
41 #include "ansi_c.h"
42 #include "csa.h"
43
44 /*
45  * NOTE: The first element in names is not used.  So a name table
46  *       with a size of 5 actually contains names in element 1 to 5
47  *       of names.
48  */
49 typedef struct {
50         void    *tbl;
51         int     size;
52         char    **names;
53 } _DtCmNameTable;
54
55 extern _DtCmNameTable *_DtCm_make_name_table P((
56                                 int     size,
57                                 char    **names));
58
59 extern void _DtCm_free_name_table P((_DtCmNameTable *tbl));
60
61 extern CSA_return_code _DtCm_add_name_to_table P((
62                                 _DtCmNameTable  *tbl,
63                                 int             index,
64                                 char            *newname));
65
66 extern int _DtCm_get_index_from_table P((
67                                 _DtCmNameTable  *tbl,
68                                 char            *name));
69
70 extern CSA_return_code _DtCmExtendNameTable P((
71                                 char            *name,
72                                 int             index,
73                                 int             type,
74                                 _DtCmNameTable  *base,
75                                 int             basesize,
76                                 char            **basenames,
77                                 _DtCmNameTable  **tbl,
78                                 int             **types));
79
80 #endif /* _NAMETBL_H */
81