]> asedeno.scripts.mit.edu Git - 1ts-debian.git/blobdiff - zephyr/zwgc/variables.c
r4275@bucket (orig r265): kcr | 2008-01-21 02:57:32 -0500
[1ts-debian.git] / zephyr / zwgc / variables.c
index cc7e01cb0fff4e0370ae3cbfeab2c3f87e35e5c3..3368c1fda41bbc6ad77a4edddccf189e67d743db 100644 (file)
@@ -4,7 +4,7 @@
  *
  *      Created by:     Marc Horowitz <marc@athena.mit.edu>
  *
- *      $Id: variables.c,v 1.5 1999/01/22 23:20:42 ghudson Exp $
+ *      $Id$
  *
  *      Copyright (c) 1989 by the Massachusetts Institute of Technology.
  *      For copying and distribution information, see the file
@@ -14,7 +14,7 @@
 #include <sysdep.h>
 
 #if (!defined(lint) && !defined(SABER))
-static const char rcsid_variables_c[] = "$Id: variables.c,v 1.5 1999/01/22 23:20:42 ghudson Exp $";
+static const char rcsid_variables_c[] = "$Id$";
 #endif
 
 #include <zephyr/mit-copyright.h>
@@ -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;