PIPS
newgen_types.h File Reference
#include <inttypes.h>
+ Include dependency graph for newgen_types.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define string_undefined   ((string)-15)
 
#define string_undefined_p(s)   ((s)==string_undefined)
 
#define copy_string(s)   strdup(s)
 
#define _intFMT   PRIuPTR
 
#define _uintFMT   "u" PRIuPTR
 
#define _int_undefined   ((_int)-15) /**SG: this is dangerous: a valid value is used to state an invalid value */
 
#define _int_undefined_p(i)   ((i)==_int_undefined)
 
#define BOOLEAN_INCLUDED
 _int_undefined More...
 
#define false   0
 
#define true   1
 
#define bool_undefined   ((bool)-15) /**SG: this is a dangerous semantic: bool_undefined evaluates to true ... */
 
#define bool_undefined_p(b)   ((b)==bool_undefined)
 
#define tag_undefined   (-3)
 
#define UU   ((void*)0)
 
#define UUINT(i)   ((void*)(i))
 
#define array_undefined   NULL
 ARRAY. More...
 
#define array_undefined_p(a)   ((a)==NULL)
 
#define NEWGEN_MACRO_NAME_1(prefix, x)   prefix##x
 Some CPP magics to get a line-number-dependent "unique" identifier to have list iteration variable with unique names and avoid conflicts if we have multiple FOREACH in the same statement block: More...
 
#define NEWGEN_MACRO_NAME_2(prefix, x)   NEWGEN_MACRO_NAME_1 (prefix, x)
 
#define NGMID(f)   NEWGEN_MACRO_NAME_2(_ ## f ## _, __LINE__)
 
#define GEN_PROTO(x)   ()
 

Typedefs

typedef char * string
 STRING. More...
 
typedef intptr_t _int
 _INT More...
 
typedef uintptr_t _uint
 
typedef int bool
 we cannot use an enum or stdbool because we need to be compatible with newgen, thus boolean need to handle 3 states : true, false, and undefined
More...
 
typedef int tag
 TAG. More...
 
typedef int unit
 UNIT. More...
 
typedef struct conslist
 
typedef bool(* gen_filter_func_t) (const void *)
 
typedef bool(* gen_filter2_func_t) (const void *, const void *)
 
typedef string(* gen_string_func_t) (const void *)
 
typedef int(* gen_cmp_func_t) (const void *, const void *)
 
typedef bool(* gen_eq_func_t) (const void *, const void *)
 
typedef void(* gen_iter_func_t) (void *)
 

Macro Definition Documentation

◆ _int_undefined

#define _int_undefined   ((_int)-15) /**SG: this is dangerous: a valid value is used to state an invalid value */

Definition at line 59 of file newgen_types.h.

◆ _int_undefined_p

#define _int_undefined_p (   i)    ((i)==_int_undefined)

Definition at line 60 of file newgen_types.h.

◆ _intFMT

#define _intFMT   PRIuPTR

Definition at line 57 of file newgen_types.h.

◆ _uintFMT

#define _uintFMT   "u" PRIuPTR

Definition at line 58 of file newgen_types.h.

◆ array_undefined

#define array_undefined   NULL

ARRAY.

Definition at line 103 of file newgen_types.h.

◆ array_undefined_p

#define array_undefined_p (   a)    ((a)==NULL)

Definition at line 104 of file newgen_types.h.

◆ bool_undefined

#define bool_undefined   ((bool)-15) /**SG: this is a dangerous semantic: bool_undefined evaluates to true ... */

Definition at line 84 of file newgen_types.h.

◆ bool_undefined_p

#define bool_undefined_p (   b)    ((b)==bool_undefined)

Definition at line 85 of file newgen_types.h.

◆ BOOLEAN_INCLUDED

#define BOOLEAN_INCLUDED

_int_undefined

BOOL SG: _Bool is not compatible with newgen because it does not permit the definition of an ‘undefined’ state we use the int type for compatible behavior similar to linear ...

Definition at line 70 of file newgen_types.h.

◆ copy_string

#define copy_string (   s)    strdup(s)

Definition at line 42 of file newgen_types.h.

◆ false

#define false   0

Definition at line 80 of file newgen_types.h.

◆ GEN_PROTO

#define GEN_PROTO (   x)    ()

Definition at line 135 of file newgen_types.h.

◆ NEWGEN_MACRO_NAME_1

#define NEWGEN_MACRO_NAME_1 (   prefix,
  x 
)    prefix##x

Some CPP magics to get a line-number-dependent "unique" identifier to have list iteration variable with unique names and avoid conflicts if we have multiple FOREACH in the same statement block:

Definition at line 123 of file newgen_types.h.

◆ NEWGEN_MACRO_NAME_2

#define NEWGEN_MACRO_NAME_2 (   prefix,
  x 
)    NEWGEN_MACRO_NAME_1 (prefix, x)

Definition at line 124 of file newgen_types.h.

◆ NGMID

#define NGMID (   f)    NEWGEN_MACRO_NAME_2(_ ## f ## _, __LINE__)

Definition at line 126 of file newgen_types.h.

◆ string_undefined

#define string_undefined   ((string)-15)

Definition at line 40 of file newgen_types.h.

◆ string_undefined_p

#define string_undefined_p (   s)    ((s)==string_undefined)

Definition at line 41 of file newgen_types.h.

◆ tag_undefined

#define tag_undefined   (-3)

Definition at line 93 of file newgen_types.h.

◆ true

#define true   1

Definition at line 81 of file newgen_types.h.

◆ UU

#define UU   ((void*)0)

Definition at line 98 of file newgen_types.h.

◆ UUINT

#define UUINT (   i)    ((void*)(i))

Definition at line 99 of file newgen_types.h.

Typedef Documentation

◆ _int

typedef intptr_t _int

_INT

RK wants an "int" which is the size of a "pointer". However, the use of the relevant "intptr_t" type in the code amounts to source file defacing, hence this definition. FC. The ifndef macro is to avoid a double definition if the type needs to be defined in the C3/linear library as well.

Definition at line 53 of file newgen_types.h.

◆ _uint

typedef uintptr_t _uint

Definition at line 54 of file newgen_types.h.

◆ bool

typedef int bool

we cannot use an enum or stdbool because we need to be compatible with newgen, thus boolean need to handle 3 states : true, false, and undefined

Definition at line 78 of file newgen_types.h.

◆ gen_cmp_func_t

typedef int(* gen_cmp_func_t) (const void *, const void *)

Definition at line 114 of file newgen_types.h.

◆ gen_eq_func_t

typedef bool(* gen_eq_func_t) (const void *, const void *)

Definition at line 115 of file newgen_types.h.

◆ gen_filter2_func_t

typedef bool(* gen_filter2_func_t) (const void *, const void *)

Definition at line 110 of file newgen_types.h.

◆ gen_filter_func_t

typedef bool(* gen_filter_func_t) (const void *)

Definition at line 109 of file newgen_types.h.

◆ gen_iter_func_t

typedef void(* gen_iter_func_t) (void *)

Definition at line 116 of file newgen_types.h.

◆ gen_string_func_t

typedef string(* gen_string_func_t) (const void *)

Definition at line 111 of file newgen_types.h.

◆ list

typedef struct cons* list

Definition at line 106 of file newgen_types.h.

◆ string

typedef char* string

STRING.

Definition at line 39 of file newgen_types.h.

◆ tag

typedef int tag

TAG.

Definition at line 92 of file newgen_types.h.

◆ unit

typedef int unit

UNIT.

Definition at line 97 of file newgen_types.h.