|
|
00001 #ifndef var_MODULE 00002 #define var_MODULE 00003 00004 /* 00005 * Copyright (c) 1989 by the Massachusetts Institute of Technology. 00006 * For copying and distribution information, see the file 00007 * "mit-copyright.h". 00008 * 00009 * Modified for jwgc by Daniel Henninger. 00010 */ 00011 00012 #include "mit-copyright.h" 00013 00014 #include "new_string.h" 00015 00016 /* 00017 * void var_clear_all_variables() 00018 * Requires: This routine must be called before any other 00019 * var module routine is called. 00020 * Modifies: All description language variables 00021 * Effects: Sets all description langauge variables to "". 00022 */ 00023 00024 extern void var_clear_all_variables(); 00025 00026 /* 00027 * string var_get_variable(string name) 00028 * Requires: var_clear_all_variables has been called 00029 * Effects: Returns the value of the description langauge variable 00030 * named name. The returned string is read-only and is 00031 * guarenteed to last only until the next var module 00032 * call. DO NOT FREE THIS STRING. 00033 */ 00034 00035 extern string var_get_variable(); 00036 00037 /* 00038 * void var_set_variable(string name, value) 00039 * Requires: var_clear_all_variables has been called 00040 * Modifies: The value of description langauge variable 00041 * named name. 00042 * Effects: Sets the description langauge variable named name 00043 * to have the value value. 00044 */ 00045 00046 extern void var_set_variable(); 00047 00048 /* 00049 * void var_set_variable_to_number(string name; int number) 00050 * Requires: var_clear_all_variables has been called 00051 * Modifies: The value of description langauge variable 00052 * named name. 00053 * Effects: Sets the description langauge variable named name 00054 * to have as its value number's ascii representation. 00055 */ 00056 00057 extern void var_set_variable_to_number(); 00058 00059 /* 00060 * void var_set_variable_then_free_value(string name, value) 00061 * Requires: var_clear_all_variables has been called, value is 00062 * on the heap. 00063 * Modifies: The value of description langauge variable 00064 * named name, value 00065 * Effects: Sets the description langauge variable named name 00066 * to have the value value then frees value. This 00067 * routine is slightly faster than calling var_set_variable 00068 * then freeing value. It is provided mainly for 00069 * convenience reasons. 00070 */ 00071 00072 extern void var_set_variable_then_free_value(); 00073 00074 /* 00075 * void var_set_number_variables_to_fields(char *data, int length) 00076 * Requires: var_clear_all_variables has been called 00077 * Modifies: All numeric description language variables 00078 * Effects: Treats data[0]..data[length-1] as a series of 00079 * null-seperated fields. Sets $<number> (<number> 00080 * here means [0-9]+ to field # <number> in data. 00081 * Field 0 is defined to be "" as are all field #'s 00082 * greater than the number of fields in data. 00083 * Data[0]..data[length-1] must not be changed (or freed) 00084 * until either this call is made again with different 00085 * data or var_clear_all_variables is called. 00086 */ 00087 00088 extern void var_set_number_variables_to_fields(); 00089 00090 #endif
Last updated at Tue Dec 18 21:07:42 PST 2007. | This site and project hosted by... |