| 1 |
/* do not edit automatically generated by mc from NameKey. */ |
| 2 |
/* NameKey.def provides a dynamic binary tree name to key. |
| 3 |
|
| 4 |
Copyright (C) 2001-2025 Free Software Foundation, Inc. |
| 5 |
Contributed by Gaius Mulley <[email protected]>. |
| 6 |
|
| 7 |
This file is part of GNU Modula-2. |
| 8 |
|
| 9 |
GNU Modula-2 is free software; you can redistribute it and/or modify |
| 10 |
it under the terms of the GNU General Public License as published by |
| 11 |
the Free Software Foundation; either version 3, or (at your option) |
| 12 |
any later version. |
| 13 |
|
| 14 |
GNU Modula-2 is distributed in the hope that it will be useful, but |
| 15 |
WITHOUT ANY WARRANTY; without even the implied warranty of |
| 16 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 17 |
General Public License for more details. |
| 18 |
|
| 19 |
You should have received a copy of the GNU General Public License |
| 20 |
along with GNU Modula-2; see the file COPYING3. If not see |
| 21 |
<http://www.gnu.org/licenses/>. */ |
| 22 |
|
| 23 |
|
| 24 |
#if !defined (_NameKey_H) |
| 25 |
# define _NameKey_H |
| 26 |
|
| 27 |
# ifdef __cplusplus |
| 28 |
extern "C" { |
| 29 |
# endif |
| 30 |
#include <stdbool.h> |
| 31 |
# if !defined (PROC_D) |
| 32 |
# define PROC_D |
| 33 |
typedef void (*PROC_t) (void); |
| 34 |
typedef struct { PROC_t proc; } PROC; |
| 35 |
# endif |
| 36 |
|
| 37 |
# include "GSYSTEM.h" |
| 38 |
|
| 39 |
# if defined (_NameKey_C) |
| 40 |
# define EXTERN |
| 41 |
# else |
| 42 |
# define EXTERN extern |
| 43 |
# endif |
| 44 |
|
| 45 |
# define NameKey_NulName 0 |
| 46 |
typedef unsigned int NameKey_Name; |
| 47 |
|
| 48 |
|
| 49 |
/* |
| 50 |
MakeKey - returns the Key of the symbol, a. If a is not in the |
| 51 |
name table then it is added, otherwise the Key of a is returned |
| 52 |
directly. Note that the name table has no scope - it merely |
| 53 |
presents a more convienient way of expressing strings. By a Key. |
| 54 |
These keys last for the duration of compilation. |
| 55 |
*/ |
| 56 |
|
| 57 |
EXTERN NameKey_Name NameKey_MakeKey (const char *a_, unsigned int _a_high); |
| 58 |
|
| 59 |
/* |
| 60 |
makekey - returns the Key of the symbol, a. If a is not in the |
| 61 |
name table then it is added, otherwise the Key of a is returned |
| 62 |
directly. Note that the name table has no scope - it merely |
| 63 |
presents a more convienient way of expressing strings. By a Key. |
| 64 |
These keys last for the duration of compilation. |
| 65 |
*/ |
| 66 |
|
| 67 |
EXTERN NameKey_Name NameKey_makekey (void * a); |
| 68 |
|
| 69 |
/* |
| 70 |
GetKey - returns the name, a, of the key, key. |
| 71 |
*/ |
| 72 |
|
| 73 |
EXTERN void NameKey_GetKey (NameKey_Name key, char *a, unsigned int _a_high); |
| 74 |
|
| 75 |
/* |
| 76 |
LengthKey - returns the StrLen of a Key. |
| 77 |
*/ |
| 78 |
|
| 79 |
EXTERN unsigned int NameKey_LengthKey (NameKey_Name Key); |
| 80 |
|
| 81 |
/* |
| 82 |
IsKey - returns TRUE if string, a, is currently a key. |
| 83 |
*/ |
| 84 |
|
| 85 |
EXTERN bool NameKey_IsKey (const char *a_, unsigned int _a_high); |
| 86 |
|
| 87 |
/* |
| 88 |
WriteKey - Display the symbol represented by Key. |
| 89 |
*/ |
| 90 |
|
| 91 |
EXTERN void NameKey_WriteKey (NameKey_Name key); |
| 92 |
|
| 93 |
/* |
| 94 |
IsSameExcludingCase - returns TRUE if key1 and key2 are |
| 95 |
the same. It is case insensitive. |
| 96 |
*/ |
| 97 |
|
| 98 |
EXTERN bool NameKey_IsSameExcludingCase (NameKey_Name key1, NameKey_Name key2); |
| 99 |
|
| 100 |
/* |
| 101 |
KeyToCharStar - returns the C char * string equivalent for, key. |
| 102 |
*/ |
| 103 |
|
| 104 |
EXTERN void * NameKey_KeyToCharStar (NameKey_Name key); |
| 105 |
|
| 106 |
/* |
| 107 |
CharKey - returns the key[i] character. |
| 108 |
*/ |
| 109 |
|
| 110 |
EXTERN char NameKey_CharKey (NameKey_Name key, unsigned int i); |
| 111 |
# ifdef __cplusplus |
| 112 |
} |
| 113 |
# endif |
| 114 |
|
| 115 |
# undef EXTERN |
| 116 |
#endif |