Changeset 5c7b1b1 for commands.c


Ignore:
Timestamp:
Nov 9, 2002, 7:34:31 PM (18 years ago)
Author:
Erik Nygren <nygren@mit.edu>
Branches:
master, barnowl_perlaim, debian, owl, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
Children:
a15a84f
Parents:
55562e1
Message:
oops!  I'm a dork.  Reverted my last checkin as the "getvar"
command already exists and thus "get" is quite redundant.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • commands.c

    r55562e1 r5c7b1b1  
    142142              "Print the value of the named variable.  If no arugments\n"
    143143              "are used print the value of all variables.\n"),
    144 
    145   OWLCMD_ARGS("get", owl_command_get_variable, OWL_CTX_ANY,
    146               "returns a variable value",
    147               "get <variable>",
    148               "Returns the value of the named variable as a string.\n"),
    149144
    150145  OWLCMD_VOID("version", owl_command_version, OWL_CTX_ANY,
     
    10491044  }
    10501045  return NULL;
    1051 }
    1052 
    1053 char *owl_command_get_variable(int argc, char **argv, char *buff) {
    1054   char *var;
    1055   char valbuff[1024];
    1056 
    1057  if (argc!=2) {
    1058     owl_function_makemsg("Wrong number of arguments for get command");
    1059     return NULL;
    1060   }
    1061 
    1062   var=argv[1];
    1063    
    1064   if (0 == owl_variable_get_tostring(owl_global_get_vardict(&g),
    1065                                      var, valbuff, 1024)) {
    1066     return owl_strdup(valbuff);
    1067   } else {
    1068     owl_function_makemsg("Unknown variable '%s'.", var);
    1069     return NULL;
    1070   }
    10711046}
    10721047
Note: See TracChangeset for help on using the changeset viewer.