*
* 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
#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>
* 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))
* 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);
* 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);
/*
* 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);
* 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];
* 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;
* 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;