next up previous contents index
Next: Utility Functions on class Up: Resource file .graperc Previous: General usage of ResourceDev

Methods on class ResourceDev

 

   (RESOURCEDEV * ) GRAPE(ResourceDev, "new-instance")(name)
CLASS *ResourceDev
char * name
Create a new ResourceDev instance.

   GRAPE(obj, "free")()
RESOURCEDEV * obj
Free an old, used up instance.

   GRAPE(obj, "init")()
RESOURCEDEV * obj
Read the (set or added) resource files.

   (RESOURCEDEV * ) GRAPE(ResourceDev, "get-stddev")(name)
CLASS *ResourceDev
Return the standard ResourceDev instance. If none is set one is created and initialized by calling "set-filename"("~/.graperc") and "append-filename"("./.graperc"), then set as standard device and returned.

   GRAPE(obj, "set-stddev")()
RESOURCEDEV * obj
Set obj as the standard device.

   GRAPE(obj, "parse")(path, inst, meth, private)
RESOURCEDEV * obj
char * path
INSTANCE * inst
char * meth
void * private
Parse every line in the resource files whose group path matches path.

Special characters in the path:

"/..."
start at file level.
"..."
start with current path.
"=..."
read to end of current group only. Normally every matching line in the file is used, what is bad if you want to discriminate multiple local groups like in:
Manager = { hotkey = {} hotkey = {}\
.

For every resource GRAPE(inst, meth)(descr, private) is called, the resource value descr is passed in the following structure:}
typedef struct g_resource_descr {
  char *ident;
  void *value;
  DECLARATION_FORMAT type;
  int index;
  int count;
  int sep, last_sep;
} G_RESOURCE_DESCR;

   GRAPE(obj, "set-filename")(name)
RESOURCEDEV * obj
char * name
Delete all existing filenames, set name as name of resource file.

   GRAPE(obj, "append-filename")(name)
RESOURCEDEV * obj
char * name
Add another filename.

   GRAPE(obj, "print-error")(msg, res)
RESOURCEDEV * obj
char * msg, **res
Print a detailed error message including the filename and position in file, with description msg. Always use res = NULL in application code.



SFB 256 Universität Bonn and IAM Universität Freiburg

Copyright © by the Sonderforschungsbereich 256 at the Institut für Angewandte Mathematik, Universität Bonn.