X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=zephyr%2Fzwgc%2Fvariables.c;h=3368c1fda41bbc6ad77a4edddccf189e67d743db;hb=fa8b83c652676291f5c37ea66b0e5c18b20577bf;hp=cda09d6e6ac2e11db2887d91a11d578944d0bc78;hpb=6743f375388d455ba8bceebfe87ca39cdba9bb6a;p=1ts-debian.git diff --git a/zephyr/zwgc/variables.c b/zephyr/zwgc/variables.c index cda09d6..3368c1f 100644 --- a/zephyr/zwgc/variables.c +++ b/zephyr/zwgc/variables.c @@ -56,8 +56,8 @@ static string_dictionary number_variable_dict = NULL; * Effects: Returns true iff text matches [0-9]*. ("" matches...) */ -static int is_digits(text) - string text; +static int +is_digits(string text) { for (; *text; text++) if (!isdigit(*text)) @@ -83,7 +83,8 @@ static int is_digits(text) * Effects: Sets all description langauge variables to "". */ -void var_clear_all_variables() +void +var_clear_all_variables(void) { if (non_number_variable_dict) { string_dictionary_SafeDestroy(non_number_variable_dict); @@ -104,15 +105,16 @@ void var_clear_all_variables() * call. DO NOT FREE THIS STRING. */ -string var_get_variable(name) - string name; +string +var_get_variable(string name) { char *result; int field_to_get; static string last_get_field_call_result = NULL; if (is_number_variable(name)) { - if (result = string_dictionary_Fetch(number_variable_dict, name)) + result = string_dictionary_Fetch(number_variable_dict, name); + if (result) return(result); /* @@ -150,9 +152,9 @@ string var_get_variable(name) * to have the value value. */ -void var_set_variable(name, value) - string name; - string value; +void +var_set_variable(string name, + string value) { string_dictionary_Set(is_number_variable(name) ? number_variable_dict : non_number_variable_dict, name, value); @@ -167,9 +169,9 @@ void var_set_variable(name, value) * to have as its value number's ascii representation. */ -void var_set_variable_to_number(name, number) - string name; - int number; +void +var_set_variable_to_number(string name, + int number) { char buffer[20]; @@ -190,9 +192,9 @@ void var_set_variable_to_number(name, number) * convenience reasons. */ -void var_set_variable_then_free_value(name, value) - string name; - string value; +void +var_set_variable_then_free_value(string name, + string value) { string_dictionary_binding *binding; int exists; @@ -229,9 +231,9 @@ void var_set_variable_then_free_value(name, value) * data or var_clear_all_variables is called. */ -void var_set_number_variables_to_fields(data, length) - char *data; - int length; +void +var_set_number_variables_to_fields(char *data, + int length) { fields_data = data; fields_data_length = length;