PIPS
property.c
Go to the documentation of this file.
1 /*
2  * THIS FILE HAS BEEN AUTOMATICALLY GENERATED BY NEWGEN.
3  *
4  * PLEASE DO NOT MODIFY IT.
5  */
6 
7 
8 #include <stdio.h>
9 #include <stdlib.h>
10 #include <string.h>
11 #include "genC.h"
12 #include "property.h"
13 
14 /* PROPERTY
15  */
16 property copy_property(property p) {
17  return (property) gen_copy_tree((gen_chunk*) p);
18 }
20  gen_free((gen_chunk*) p);
21 }
22 property check_property(property p) {
24 }
26  check_property(p);
27  return gen_consistent_p((gen_chunk*) p);
28 }
30  return gen_defined_p((gen_chunk*) p);
31 }
34 }
36  check_property(r);
37  check_property(v);
38  message_assert("defined references to domain property",
40  memcpy(r, v, sizeof(struct _newgen_struct_property_));
41 }
43  // should clear up contents...
44  free(p);
45 }
46 void write_property(FILE* f, property p) {
47  gen_write(f, (gen_chunk*) p);
48 }
49 property read_property(FILE* f) {
50  return (property) gen_read(f);
51 }
53  switch (tag) {
54  case is_property_int: return "int";
55  case is_property_bool: return "bool";
56  case is_property_string: return "string";
57  default: return string_undefined;
58  }
59 }
60 property make_property(enum property_utype tag, void * val) {
61  return (property) gen_alloc(3*sizeof(gen_chunk), GEN_CHECK_ALLOC, property_domain, tag, val);
62 }
63 property make_property_int(intptr_t _field_) {
64  return make_property(is_property_int, (void*)(intptr_t) _field_);
65 }
66 property make_property_bool(bool _field_) {
67  return make_property(is_property_bool, (void*)(intptr_t) _field_);
68 }
69 property make_property_string(string _field_) {
70  return make_property(is_property_string, (void*)(intptr_t) _field_);
71 }
72 
property copy_property(property p)
PROPERTY.
Definition: property.c:16
property make_property_bool(bool _field_)
Definition: property.c:66
void property_assign_contents(property r, property v)
Definition: property.c:35
bool property_consistent_p(property p)
Definition: property.c:25
void property_non_recursive_free(property p)
Definition: property.c:42
list gen_property_cons(property p, list l)
Definition: property.c:32
property make_property_int(intptr_t _field_)
Definition: property.c:63
string property_tag_as_string(enum property_utype tag)
Definition: property.c:52
property make_property(enum property_utype tag, void *val)
Definition: property.c:60
property make_property_string(string _field_)
Definition: property.c:69
property read_property(FILE *f)
Definition: property.c:49
bool property_defined_p(property p)
Definition: property.c:29
void write_property(FILE *f, property p)
Definition: property.c:46
void free_property(property p)
Definition: property.c:19
property check_property(property p)
Definition: property.c:22
#define GEN_CHECK_ALLOC
Definition: genC.h:307
void gen_free(gen_chunk *obj)
version without shared_pointers.
Definition: genClib.c:992
gen_chunk * gen_alloc(int size, int gen_check_p, int dom,...)
allocates something in newgen.
Definition: genClib.c:298
int gen_consistent_p(gen_chunk *obj)
GEN_CONSISTENT_P dynamically checks the type correctness of OBJ.
Definition: genClib.c:2398
int gen_defined_p(gen_chunk *obj)
Definition: genClib.c:2438
gen_chunk * gen_check(gen_chunk *obj, int t)
GEN_CHECK checks that the gen_chunk received OBJ is of the appropriate TYPE.
Definition: genClib.c:2356
gen_chunk * gen_read(FILE *file)
GEN_READ reads any object from the FILE stream.
Definition: genClib.c:2323
gen_chunk * gen_copy_tree(gen_chunk *obj)
Definition: genClib.c:1429
void gen_write(FILE *fd, gen_chunk *obj)
GEN_WRITE writes the OBJect on the stream FD.
Definition: genClib.c:1745
void free(void *)
list gen_typed_cons(_int type, const void *item, const list next)
CONS a list with minimal type checking this cannot be done within the CONS macro because possible fun...
Definition: list.c:900
#define message_assert(msg, ex)
Definition: newgen_assert.h:47
int tag
TAG.
Definition: newgen_types.h:92
#define string_undefined
Definition: newgen_types.h:40
int f(int off1, int off2, int n, float r[n], float a[n], float b[n])
Definition: offsets.c:15
#define property_domain
Definition: property.h:10
property_utype
Definition: property.h:40
@ is_property_string
Definition: property.h:43
@ is_property_bool
Definition: property.h:42
@ is_property_int
Definition: property.h:41
#define PROPERTY_NEWGEN_DOMAIN
Definition: property.h:13
#define intptr_t
Definition: stdint.in.h:294
The structure used to build lists in NewGen.
Definition: newgen_list.h:41
A gen_chunk is used to store every object.
Definition: genC.h:58