Changeset 55562e1
- Timestamp:
- Nov 5, 2002, 11:32:42 PM (22 years ago)
- Branches:
- master, barnowl_perlaim, debian, owl, release-1.10, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
- Children:
- 5c7b1b1
- Parents:
- 0ba59d2
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
ChangeLog
rd309eb3 r55562e1 1 1 $Id$ 2 2 3 1.2.8-pre 4 Added 'get <variable>' command which returns the value of the variable 5 as a string. This allows variable values to be retrieved from perl 6 with the likes of: if ("on" eq &owl::command('get zaway')) { ... } 7 3 8 1.2.7 4 9 Outgoing messages now go through the config for formatting -
commands.c
rd309eb3 r55562e1 142 142 "Print the value of the named variable. If no arugments\n" 143 143 "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"), 144 149 145 150 OWLCMD_VOID("version", owl_command_version, OWL_CTX_ANY, … … 1044 1049 } 1045 1050 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 } 1046 1071 } 1047 1072 -
owl.h
rb45293f r55562e1 12 12 static const char owl_h_fileIdent[] = "$Id$"; 13 13 14 #define OWL_VERSION 1.2. 715 #define OWL_VERSION_STRING "1.2. 7"14 #define OWL_VERSION 1.2.8-pre 15 #define OWL_VERSION_STRING "1.2.8-pre" 16 16 17 17 #define OWL_DEBUG 0
Note: See TracChangeset
for help on using the changeset viewer.