nametbl.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  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 libraries 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. #ifndef _NAMETBL_H
  31. #define _NAMETBL_H
  32. /*
  33. * Contain the definition for a hashed name table for attribute names.
  34. * It is intended to be used by both the library and the daemon to
  35. * build name tables for calendar attribute names and entry attribute
  36. * names.
  37. */
  38. #include "ansi_c.h"
  39. #include "csa.h"
  40. /*
  41. * NOTE: The first element in names is not used. So a name table
  42. * with a size of 5 actually contains names in element 1 to 5
  43. * of names.
  44. */
  45. typedef struct {
  46. void *tbl;
  47. int size;
  48. char **names;
  49. } _DtCmNameTable;
  50. extern _DtCmNameTable *_DtCm_make_name_table P((
  51. int size,
  52. char **names));
  53. extern void _DtCm_free_name_table P((_DtCmNameTable *tbl));
  54. extern CSA_return_code _DtCm_add_name_to_table P((
  55. _DtCmNameTable *tbl,
  56. int index,
  57. char *newname));
  58. extern int _DtCm_get_index_from_table P((
  59. _DtCmNameTable *tbl,
  60. char *name));
  61. extern CSA_return_code _DtCmExtendNameTable P((
  62. char *name,
  63. int index,
  64. int type,
  65. _DtCmNameTable *base,
  66. int basesize,
  67. char **basenames,
  68. _DtCmNameTable **tbl,
  69. int **types));
  70. #endif /* _NAMETBL_H */