disable the unrecognized nls flag
[AROS-Contrib.git] / regina / strings.h
blob812473997f3e9792ca0a6b114325ec19d20cf6c1
1 /*
2 * The Regina Rexx Interpreter
3 * Copyright (C) 1992-1994 Anders Christensen <anders@pvv.unit.no>
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Library General Public License for more details.
15 * You should have received a copy of the GNU Library General Public
16 * License along with this library; if not, write to the Free
17 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19 #ifndef _STRINGS_ALREADY_DEFINED_
20 #define _STRINGS_ALREADY_DEFINED_
22 typedef struct strengtype {
23 int len, max ;
24 #ifdef CHECK_MEMORY /* FGC: Test */
25 char *value;
26 #else
27 union
29 void **ptr;
30 char value[sizeof(void *)];
32 #endif
33 } streng ;
36 * Some strange define's to allow constant strengs to be defined. They will
37 * be accessible as pointers.
39 #ifdef CHECK_MEMORY
40 # define conststreng(name,value) const streng __regina__##name = { sizeof( value ) - 1, \
41 sizeof( value ) - 1, \
42 value }; \
43 const streng *name = (const streng *) &__regina__##name
44 # define staticstreng(name,value) static streng x_##name = { sizeof( value ) - 1, \
45 sizeof( value ) - 1, \
46 value }; \
47 const static streng *name = (const streng *) &x_##name
48 #else
49 # define conststreng(name,value) const struct { \
50 int len, max; \
51 char content[sizeof( value )]; \
52 } x__regina__##name = { sizeof( value ) - 1, \
53 sizeof( value ) - 1, \
54 value }; \
55 const streng *name = (streng *) &x__regina__##name
56 # define staticstreng(name,value) static struct { \
57 int len, max; \
58 char content[sizeof( value )]; \
59 } x_##name = { sizeof( value ) - 1, \
60 sizeof( value ) - 1, \
61 value }; \
62 static const streng *name = (const streng *) &x_##name
63 #endif
64 #define STRENG_TYPEDEFED 1
66 #define Str_len(a) ((a)->len)
67 #define Str_max(a) ((a)->max)
68 #define Str_val(a) ((a)->value)
69 #define Str_in(a,b) (Str_len(a)>(b))
70 #define Str_end(a) ((a)->value+Str_len(a))
71 #define Str_zero(a) ((Str_len(a)<Str_max(a)) && ((a)->value[(a)->len]==0x00))
74 #define STRHEAD (1+(sizeof(int)<<1))
77 typedef struct num_descr_type
79 char *num ; /* pointer to matissa of precision + 1 */
80 int negative ; /* boolean, true if negative number */
81 int exp ; /* value of exponent */
82 int size ; /* how much of num is actually used */
83 int max ; /* how much can num actually take */
86 * The number has an absolute value of
87 * *********************
88 * * "0."<num>"E"<exp> *
89 * *********************
90 * Only size byte of num are used.
92 * The number of used digits depends on its usage. In general, it's a good
93 * idea to use the standard value. used_digits shall be reset after each
94 * computation and may or may not be respected. It shall be respected, and
95 * this is the intention, by str_norm and all other function which make
96 * a string from the number accidently. Functions like string_add may
97 * or may not use this value.
98 * fixes bug 675395
100 int used_digits;
101 } num_descr ;
104 #endif /* _STRINGS_ALREADY_INCLUDED_ */