Changes in / [f578d18:7655e08]
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
cmd.c
rf25df21 r6a71113 99 99 100 100 char *owl_cmddict_execute_argv(const owl_cmddict *cd, const owl_context *ctx, const char *const *argv, int argc) { 101 GString *buf = g_string_new(""); 102 int i; 103 char *retval; 104 105 /* We weren't given a command line, so fabricate a valid one. */ 106 for(i = 0; i < argc; i++) { 107 if (i != 0) 108 g_string_append_c(buf, ' '); 109 owl_string_append_quoted_arg(buf, argv[i]); 110 } 111 112 retval = _owl_cmddict_execute(cd, ctx, argv, argc, buf->str); 113 114 g_string_free(buf, true); 101 char *buff; 102 char *retval = NULL; 103 104 buff = g_strjoinv(" ", (char**)argv); 105 retval = _owl_cmddict_execute(cd, ctx, argv, argc, buff); 106 g_free(buff); 107 115 108 return retval; 116 109 } -
functions.c
r37d188f r4fd211f 2959 2959 2960 2960 if (viewsize==0) { 2961 owl_function_ error("No messages present");2961 owl_function_makemsg("No messages present"); 2962 2962 return; 2963 2963 } … … 2973 2973 /* bounds check */ 2974 2974 if (start>=viewsize || start<0) { 2975 owl_function_ error("No further matches found");2975 owl_function_makemsg("No further matches found"); 2976 2976 return; 2977 2977 } … … 3002 3002 } 3003 3003 owl_mainwin_redisplay(owl_global_get_mainwin(&g)); 3004 owl_function_ error("No matches found");3004 owl_function_makemsg("No matches found"); 3005 3005 } 3006 3006 -
owl.c
r25f7c57 r25f7c57 41 41 char *confdir; 42 42 bool debug; 43 bool rm_debug;44 43 } owl_options; 45 44 … … 50 49 fprintf(stderr, " -n,--no-subs don't load zephyr subscriptions\n"); 51 50 fprintf(stderr, " -d,--debug enable debugging\n"); 52 fprintf(stderr, " -D,--remove-debug enable debugging and delete previous debug file\n");53 51 fprintf(stderr, " -v,--version print the Barnowl version number and exit\n"); 54 52 fprintf(stderr, " -h,--help print this help message\n"); … … 66 64 { "tty", 1, 0, 't' }, 67 65 { "debug", 0, 0, 'd' }, 68 { "remove-debug", 0, 0, 'D' },69 66 { "version", 0, 0, 'v' }, 70 67 { "help", 0, 0, 'h' }, … … 88 85 opts->tty = g_strdup(optarg); 89 86 break; 90 case 'D':91 opts->rm_debug = 1;92 /* fallthrough */93 87 case 'd': 94 88 opts->debug = 1; … … 509 503 /* owl global init */ 510 504 owl_global_init(&g); 511 if (opts.rm_debug) unlink(OWL_DEBUG_FILE);512 505 if (opts.debug) owl_global_set_debug_on(&g); 513 506 if (opts.confdir) owl_global_set_confdir(&g, opts.confdir); -
perlglue.xs
rf25df21 r6a71113 43 43 rv = owl_function_command(cmd); 44 44 } else { 45 argv = g_new(const char *, items + 1); 45 /* Ensure this is NULL-terminated. */ 46 argv = g_new0(const char *, items + 1); 46 47 argv[0] = cmd; 47 48 for(i = 1; i < items; i++) { -
variable.c
rf25df21 rf203cad 30 30 NULL, NULL, NULL, NULL, NULL, NULL } 31 31 32 #define OWLVAR_STRING_FULL(name,default, summary,description,validate,set,get) \33 { name, OWL_VARIABLE_STRING, default, 0, "<string>", summary,description, NULL, \32 #define OWLVAR_STRING_FULL(name,default,validset,summary,description,validate,set,get) \ 33 { name, OWL_VARIABLE_STRING, default, 0, validset, summary,description, NULL, \ 34 34 validate, set, NULL, get, NULL, NULL } 35 35 … … 266 266 "" ), 267 267 268 OWLVAR_STRING_FULL( "tty" /* %OwlVarStub */, "", " tty name for zephyr location", "",268 OWLVAR_STRING_FULL( "tty" /* %OwlVarStub */, "", "<string>", "tty name for zephyr location", "", 269 269 NULL, owl_variable_tty_set, NULL), 270 270 … … 370 370 "delete a message right as it came in.\n" ), 371 371 372 OWLVAR_STRING_FULL( "default_exposure" /* %OwlVarStub */, "", 373 "none,opstaff,realm-visible,realm-announced,net-visible,net-announced", 374 "controls the persistent value for exposure", 375 "The default exposure level corresponds to the Zephyr exposure value\n" 376 "in ~/.zephyr.vars. Defaults to realm-visible if there is no value in\n" 377 "~/.zephyr.vars.\n" 378 "See the description of exposure for the values this can be.", 379 NULL, owl_variable_default_exposure_set, owl_variable_default_exposure_get ), 380 381 OWLVAR_STRING_FULL( "exposure" /* %OwlVarStub */, "", 382 "none,opstaff,realm-visible,realm-announced,net-visible,net-announced", 383 "controls who can zlocate you", 384 "The exposure level, defaulting to the value of default_exposure,\n" 385 "can be one of the following (from least exposure to widest exposure,\n" 386 "as listed in zctl(1)):\n" 387 "\n" 388 " none - This completely disables Zephyr for the user. \n" 389 " The user is not registered with Zephyr. No user\n" 390 " location information is retained by Zephyr. No\n" 391 " login or logout announcements will be sent. No\n" 392 " subscriptions will be entered for the user, and\n" 393 " no notices will be displayed by zwgc(1).\n" 394 " opstaff - The user is registered with Zephyr. No login or\n" 395 " logout announcements will be sent, and location\n" 396 " information will only be visible to Operations\n" 397 " staff. Default subscriptions and any additional\n" 398 " personal subscriptions will be entered for the\n" 399 " user.\n" 400 " realm-visible - The user is registered with Zephyr. User\n" 401 " location information is retained by Zephyr and\n" 402 " made available only to users within the user’s\n" 403 " Kerberos realm. No login or logout\n" 404 " announcements will be sent. This is the system\n" 405 " default. Default subscriptions and any\n" 406 " additional personal subscriptions will be\n" 407 " entered for the user.\n" 408 " realm-announced - The user is registered with Zephyr. User\n" 409 " location information is retained by Zephyr and\n" 410 " made available only to users authenticated\n" 411 " within the user’s Kerberos realm. Login and\n" 412 " logout announcements will be sent, but only to\n" 413 " users within the user’s Kerberos realm who have\n" 414 " explicitly requested such via subscriptions. \n" 415 " Default subscriptions and any additional\n" 416 " personal subscriptions will be entered for the\n" 417 " user.\n" 418 " net-visible - The user is registered with Zephyr. User\n" 419 " location information is retained by Zephyr and\n" 420 " made available to any authenticated user who\n" 421 " requests such. Login and logout announcements\n" 422 " will be sent only to users within the user’s\n" 423 " Kerberos realm who have explicitly requested\n" 424 " such via subscriptions. Default subscriptions\n" 425 " and any additional personal subscriptions will\n" 426 " be entered for the user.\n" 427 " net-announced - The user is registered with Zephyr. User\n" 428 " location information is retained by Zephyr and\n" 429 " made available to any authenticated user who\n" 430 " requests such. Login and logout announcements\n" 431 " will be sent to any user has requested such. \n" 432 " Default subscriptions and any additional\n" 433 " personal subscriptions will be entered for the\n" 434 " user.\n", 435 NULL, owl_variable_exposure_set, NULL /* use default for get */ ), 436 372 437 /* This MUST be last... */ 373 438 { NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, … … 470 535 } 471 536 537 int owl_variable_default_exposure_set(owl_variable *v, const void *newval) 538 { 539 return owl_zephyr_set_default_exposure(newval); 540 } 541 542 const void *owl_variable_default_exposure_get(const owl_variable *v) 543 { 544 return owl_zephyr_get_default_exposure(); 545 } 546 547 int owl_variable_exposure_set(owl_variable *v, const void *newval) 548 { 549 int ret = owl_zephyr_set_exposure(newval); 550 if (ret != 0) 551 return ret; 552 return owl_variable_string_set_default(v, owl_zephyr_normalize_exposure(newval)); 553 } 472 554 473 555 /**************************************************************************/ … … 688 770 } 689 771 if (msg && v->get_tostring_fn) { 690 tostring = v->get_tostring_fn(v, v-> val);772 tostring = v->get_tostring_fn(v, v->get_fn(v)); 691 773 owl_function_makemsg("%s = '%s'", name, tostring); 692 774 g_free(tostring); … … 726 808 v = owl_dict_find_element(d, name); 727 809 if (v == NULL || !v->get_tostring_fn) return NULL; 728 return v->get_tostring_fn(v, v-> val);810 return v->get_tostring_fn(v, v->get_fn(v)); 729 811 } 730 812 -
viewwin.c
r237d02c r4fd211f 150 150 151 151 if (!owl_viewwin_search(v, owl_global_get_search_re(&g), consider_current, direction)) 152 owl_function_ error("No more matches");152 owl_function_makemsg("No more matches"); 153 153 return NULL; 154 154 } … … 172 172 if (!owl_viewwin_search(data->v, owl_global_get_search_re(&g), 173 173 consider_current, data->direction)) 174 owl_function_ error("No matches");174 owl_function_makemsg("No matches"); 175 175 } 176 176 -
zephyr.c
rcd28517 rf203cad 1049 1049 { 1050 1050 #ifdef HAVE_LIBZEPHYR 1051 char *exposure, *eset;1052 Code_t ret;1053 1054 1051 ZResetAuthentication(); 1055 1052 1056 eset = EXPOSE_REALMVIS; 1057 exposure = ZGetVariable(zstr("exposure")); 1058 if (exposure) 1059 exposure = ZParseExposureLevel(exposure); 1060 if (exposure) 1061 eset = exposure; 1062 1063 ret = ZSetLocation(eset); 1064 if (ret != ZERR_NONE) 1065 owl_function_error("Error setting location: %s", error_message(ret)); 1053 /* ZSetLocation, and store the default value as the current value */ 1054 owl_global_set_exposure(&g, owl_global_get_default_exposure(&g)); 1066 1055 #endif 1067 1056 } … … 1184 1173 ZInitLocationInfo(zstr(host), zstr(val)); 1185 1174 #endif 1175 } 1176 1177 const char *owl_zephyr_normalize_exposure(const char *exposure) 1178 { 1179 if (exposure == NULL) 1180 return NULL; 1181 #ifdef HAVE_LIBZEPHYR 1182 return ZParseExposureLevel(zstr(exposure)); 1183 #else 1184 return exposure; 1185 #endif 1186 } 1187 1188 int owl_zephyr_set_default_exposure(const char *exposure) 1189 { 1190 #ifdef HAVE_LIBZEPHYR 1191 Code_t ret; 1192 if (exposure == NULL) 1193 return -1; 1194 exposure = ZParseExposureLevel(zstr(exposure)); 1195 if (exposure == NULL) 1196 return -1; 1197 ret = ZSetVariable(zstr("exposure"), zstr(exposure)); /* ZSetVariable does file I/O */ 1198 if (ret != ZERR_NONE) { 1199 owl_function_error("Unable to set default exposure location: %s", error_message(ret)); 1200 return -1; 1201 } 1202 #endif 1203 return 0; 1204 } 1205 1206 const char *owl_zephyr_get_default_exposure(void) 1207 { 1208 #ifdef HAVE_LIBZEPHYR 1209 const char *exposure = ZGetVariable(zstr("exposure")); /* ZGetVariable does file I/O */ 1210 if (exposure == NULL) 1211 return EXPOSE_REALMVIS; 1212 exposure = ZParseExposureLevel(zstr(exposure)); 1213 if (exposure == NULL) /* The user manually entered an invalid value in ~/.zephyr.vars, or something weird happened. */ 1214 return EXPOSE_REALMVIS; 1215 return exposure; 1216 #else 1217 return ""; 1218 #endif 1219 } 1220 1221 int owl_zephyr_set_exposure(const char *exposure) 1222 { 1223 #ifdef HAVE_LIBZEPHYR 1224 Code_t ret; 1225 if (exposure == NULL) 1226 return -1; 1227 exposure = ZParseExposureLevel(zstr(exposure)); 1228 if (exposure == NULL) 1229 return -1; 1230 ret = ZSetLocation(zstr(exposure)); 1231 if (ret != ZERR_NONE) { 1232 owl_function_error("Unable to set exposure level: %s.", error_message(ret)); 1233 return -1; 1234 } 1235 #endif 1236 return 0; 1186 1237 } 1187 1238
Note: See TracChangeset
for help on using the changeset viewer.