Index: attrib.h =================================================================== --- attrib.h (revision 30904) +++ attrib.h (revision 30905) @@ -28,61 +28,61 @@ /* attribute lists */ -#ifndef PCB_ATTRIB_H -#define PCB_ATTRIB_H +#ifndef RND_ATTRIB_H +#define RND_ATTRIB_H -typedef struct pcb_attribute_list_s pcb_attribute_list_t; +typedef struct rnd_attribute_list_s rnd_attribute_list_t; -typedef struct pcb_attribute_s { +typedef struct rnd_attribute_s { char *name; char *value; unsigned cpb_written:1; /* copyback: written */ -} pcb_attribute_t; +} rnd_attribute_t; -struct pcb_attribute_list_s { +struct rnd_attribute_list_s { int Number, Max; - pcb_attribute_t *List; - void (*post_change)(pcb_attribute_list_t *list, const char *name, const char *value); /* called any time an attribute changes (including removes); value is NULL if removed; old value is free'd only after the call so cached old values are valid */ + rnd_attribute_t *List; + void (*post_change)(rnd_attribute_list_t *list, const char *name, const char *value); /* called any time an attribute changes (including removes); value is NULL if removed; old value is free'd only after the call so cached old values are valid */ }; /* Returns NULL if the name isn't found, else the value for that named attribute. The ptr version returns the address of the value str in the slot */ -char *pcb_attribute_get(const pcb_attribute_list_t *list, const char *name); -char **pcb_attribute_get_ptr(const pcb_attribute_list_t *list, const char *name); +char *rnd_attribute_get(const rnd_attribute_list_t *list, const char *name); +char **rnd_attribute_get_ptr(const rnd_attribute_list_t *list, const char *name); -/* Same as pcb_attribute_get, but also look for plugin::key which overrides +/* Same as rnd_attribute_get, but also look for plugin::key which overrides plain key hits */ -char *pcb_attribute_get_namespace(const pcb_attribute_list_t *list, const char *plugin, const char *key); -char **pcb_attribute_get_namespace_ptr(const pcb_attribute_list_t *list, const char *plugin, const char *key); +char *rnd_attribute_get_namespace(const rnd_attribute_list_t *list, const char *plugin, const char *key); +char **rnd_attribute_get_namespace_ptr(const rnd_attribute_list_t *list, const char *plugin, const char *key); /* Adds an attribute to the list. If the attribute already exists, the value is replaced. Returns non-zero if an existing attribute was replaced. */ -int pcb_attribute_put(pcb_attribute_list_t * list, const char *name, const char *value); +int rnd_attribute_put(rnd_attribute_list_t * list, const char *name, const char *value); /* Simplistic version: Takes a pointer to an object, looks up attributes in it. */ -#define pcb_attrib_get(OBJ,name) pcb_attribute_get(&(OBJ->Attributes), name) +#define rnd_attrib_get(OBJ,name) rnd_attribute_get(&(OBJ->Attributes), name) /* Simplistic version: Takes a pointer to an object, sets attributes in it. */ -#define pcb_attrib_put(OBJ,name,value) pcb_attribute_put(&(OBJ->Attributes), name, value) +#define rnd_attrib_put(OBJ,name,value) rnd_attribute_put(&(OBJ->Attributes), name, value) /* Remove an attribute by name; returns number of items removed */ -int pcb_attribute_remove(pcb_attribute_list_t * list, const char *name); +int rnd_attribute_remove(rnd_attribute_list_t * list, const char *name); /* Simplistic version of Remove. */ -#define pcb_attrib_remove(OBJ, name) pcb_attribute_remove(&(OBJ->Attributes), name) +#define rnd_attrib_remove(OBJ, name) rnd_attribute_remove(&(OBJ->Attributes), name) /* remove item by index - WARNING: no checks are made, idx has to be valid! */ -int pcb_attribute_remove_idx(pcb_attribute_list_t * list, int idx); +int rnd_attribute_remove_idx(rnd_attribute_list_t * list, int idx); /* Frees memory used by an attribute list */ -void pcb_attribute_free(pcb_attribute_list_t *list); +void rnd_attribute_free(rnd_attribute_list_t *list); /* Copy each attribute from src to dest */ -void pcb_attribute_copy_all(pcb_attribute_list_t *dest, const pcb_attribute_list_t *src); +void rnd_attribute_copy_all(rnd_attribute_list_t *dest, const rnd_attribute_list_t *src); /* Copy back a mirrored attribute list, minimizing the changes */ -void pcb_attribute_copyback_begin(pcb_attribute_list_t *dst); -void pcb_attribute_copyback(pcb_attribute_list_t *dst, const char *name, const char *value); -void pcb_attribute_copyback_end(pcb_attribute_list_t *dst); +void rnd_attribute_copyback_begin(rnd_attribute_list_t *dst); +void rnd_attribute_copyback(rnd_attribute_list_t *dst, const char *name, const char *value); +void rnd_attribute_copyback_end(rnd_attribute_list_t *dst); /* Set the intconn attribute - hack for compatibility parsing */ -void pcb_attrib_compat_set_intconn(pcb_attribute_list_t *dst, int intconn); +void rnd_attrib_compat_set_intconn(rnd_attribute_list_t *dst, int intconn); #endif