Changeset e19eb97 for functions.c
- Timestamp:
- Aug 15, 2009, 7:08:18 PM (16 years ago)
- Branches:
- master, release-1.10, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
- Children:
- 1077891a
- Parents:
- fa4562c
- git-author:
- Anders Kaseorg <andersk@mit.edu> (08/04/09 02:37:51)
- git-committer:
- Anders Kaseorg <andersk@mit.edu> (08/15/09 19:08:18)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
functions.c
r65b2173 re19eb97 13 13 #include "owl.h" 14 14 15 char *owl_function_command(c har *cmdbuff)15 char *owl_function_command(const char *cmdbuff) 16 16 { 17 17 owl_function_debugmsg("executing command: %s", cmdbuff); … … 20 20 } 21 21 22 char *owl_function_command_argv(c har **argv, int argc)22 char *owl_function_command_argv(const char *const *argv, int argc) 23 23 { 24 24 return owl_cmddict_execute_argv(owl_global_get_cmddict(&g), … … 27 27 } 28 28 29 void owl_function_command_norv(c har *cmdbuff)29 void owl_function_command_norv(const char *cmdbuff) 30 30 { 31 31 char *rv; … … 34 34 } 35 35 36 void owl_function_command_alias(c har *alias_from,char *alias_to)36 void owl_function_command_alias(const char *alias_from, const char *alias_to) 37 37 { 38 38 owl_cmddict_add_alias(owl_global_get_cmddict(&g), alias_from, alias_to); 39 39 } 40 40 41 owl_cmd *owl_function_get_cmd(c har *name)41 owl_cmd *owl_function_get_cmd(const char *name) 42 42 { 43 43 return owl_cmddict_find(owl_global_get_cmddict(&g), name); … … 60 60 } 61 61 62 void owl_function_show_view(c har *viewname)62 void owl_function_show_view(const char *viewname) 63 63 { 64 64 owl_view *v; … … 92 92 } 93 93 94 char *owl_function_style_describe(c har *name) {95 c har *desc;94 char *owl_function_style_describe(const char *name) { 95 const char *desc; 96 96 char *s; 97 97 owl_style *style; … … 108 108 } 109 109 110 char *owl_function_cmd_describe(c har *name)110 char *owl_function_cmd_describe(const char *name) 111 111 { 112 112 owl_cmd *cmd = owl_cmddict_find(owl_global_get_cmddict(&g), name); … … 115 115 } 116 116 117 void owl_function_show_command(c har *name)117 void owl_function_show_command(const char *name) 118 118 { 119 119 owl_function_help_for_command(name); … … 122 122 void owl_function_show_license() 123 123 { 124 c har *text;124 const char *text; 125 125 126 126 text="" … … 168 168 void owl_function_show_quickstart() 169 169 { 170 c har *message =170 const char *message = 171 171 "Move between messages with the arrow keys, and press 'r' to reply.\n" 172 172 "For more info, press 'h' or visit http://barnowl.mit.edu/\n\n" … … 199 199 * and redisplay if necessary. 200 200 */ 201 void owl_function_adminmsg(c har *header,char *body)201 void owl_function_adminmsg(const char *header, const char *body) 202 202 { 203 203 owl_message *m; … … 226 226 * that. 227 227 */ 228 owl_message *owl_function_make_outgoing_zephyr(c har *body, char *zwriteline,char *zsig)228 owl_message *owl_function_make_outgoing_zephyr(const char *body, const char *zwriteline, const char *zsig) 229 229 { 230 230 owl_message *m; … … 247 247 * owl_global_messagequeue_addmsg() for that . 248 248 */ 249 owl_message *owl_function_make_outgoing_aim(c har *body,char *to)249 owl_message *owl_function_make_outgoing_aim(const char *body, const char *to) 250 250 { 251 251 owl_message *m; … … 268 268 * owl_global_messagequeue_addmsg() for that. 269 269 */ 270 owl_message *owl_function_make_outgoing_loopback(c har *body)270 owl_message *owl_function_make_outgoing_loopback(const char *body) 271 271 { 272 272 owl_message *m; … … 280 280 } 281 281 282 void owl_function_zwrite_setup(c har *line)282 void owl_function_zwrite_setup(const char *line) 283 283 { 284 284 owl_editwin *e; … … 325 325 } 326 326 327 void owl_function_aimwrite_setup(c har *line)327 void owl_function_aimwrite_setup(const char *line) 328 328 { 329 329 owl_editwin *e; … … 389 389 * the message is expected to be set from the zwrite line itself 390 390 */ 391 void owl_function_zwrite(c har *line,char *msg)391 void owl_function_zwrite(const char *line, const char *msg) 392 392 { 393 393 owl_zwrite z; 394 c har *mymsg;394 const char *mymsg; 395 395 owl_message *m; 396 396 … … 429 429 * the message is expected to be set from the zwrite line itself 430 430 */ 431 void owl_function_zcrypt(c har *line,char *msg)431 void owl_function_zcrypt(const char *line, const char *msg) 432 432 { 433 433 owl_zwrite z; 434 c har *mymsg;434 const char *mymsg; 435 435 char *cryptmsg; 436 436 owl_message *m; … … 498 498 } 499 499 500 void owl_function_aimwrite(c har *line,char *msg)500 void owl_function_aimwrite(const char *line, const char *msg) 501 501 { 502 502 int ret; 503 c har *to;503 const char *to; 504 504 char *format_msg; 505 505 owl_message *m; … … 531 531 } 532 532 533 void owl_function_send_aimawymsg(c har *to,char *msg)533 void owl_function_send_aimawymsg(const char *to, const char *msg) 534 534 { 535 535 int ret; … … 563 563 } 564 564 565 void owl_function_loopwrite(c har *msg)565 void owl_function_loopwrite(const char *msg) 566 566 { 567 567 owl_message *min, *mout; … … 590 590 * If last_if_none, will stop at the last message in the view 591 591 * if no matching messages are found. */ 592 void owl_function_nextmsg_full(c har *filter, int skip_deleted, int last_if_none)592 void owl_function_nextmsg_full(const char *filter, int skip_deleted, int last_if_none) 593 593 { 594 594 int curmsg, i, viewsize, found; … … 643 643 } 644 644 645 void owl_function_prevmsg_full(c har *filter, int skip_deleted, int first_if_none)645 void owl_function_prevmsg_full(const char *filter, int skip_deleted, int first_if_none) 646 646 { 647 647 int curmsg, i, viewsize, found; … … 881 881 * only, no error message is printed. 882 882 */ 883 void owl_function_loadsubs(c har *file)883 void owl_function_loadsubs(const char *file) 884 884 { 885 885 int ret, ret2; 886 c har *foo;886 const char *foo; 887 887 char *path; 888 888 … … 914 914 } 915 915 916 void owl_function_loadloginsubs(c har *file)916 void owl_function_loadloginsubs(const char *file) 917 917 { 918 918 int ret; … … 934 934 } 935 935 936 void owl_function_aimlogin(c har *user,char *passwd) {936 void owl_function_aimlogin(const char *user, const char *passwd) { 937 937 int ret; 938 938 … … 1236 1236 } 1237 1237 1238 void owl_function_debugmsg(c har *fmt, ...)1238 void owl_function_debugmsg(const char *fmt, ...) 1239 1239 { 1240 1240 FILE *file; … … 1271 1271 } 1272 1272 1273 int owl_function_subscribe(c har *class, char *inst,char *recip)1273 int owl_function_subscribe(const char *class, const char *inst, const char *recip) 1274 1274 { 1275 1275 int ret; … … 1284 1284 } 1285 1285 1286 void owl_function_unsubscribe(c har *class, char *inst,char *recip)1286 void owl_function_unsubscribe(const char *class, const char *inst, const char *recip) 1287 1287 { 1288 1288 int ret; … … 1326 1326 } 1327 1327 1328 void owl_function_popless_text(c har *text)1328 void owl_function_popless_text(const char *text) 1329 1329 { 1330 1330 owl_popwin *pw; … … 1360 1360 } 1361 1361 1362 void owl_function_popless_file(c har *filename)1362 void owl_function_popless_file(const char *filename) 1363 1363 { 1364 1364 owl_fmtext fm; … … 1665 1665 void owl_function_printallvars() 1666 1666 { 1667 c har *name;1667 const char *name; 1668 1668 char var[LINE]; 1669 1669 owl_list varnames; … … 1695 1695 owl_fmtext fm; 1696 1696 int i, numvarnames; 1697 c har *varname;1697 const char *varname; 1698 1698 1699 1699 owl_fmtext_init_null(&fm); … … 1713 1713 } 1714 1714 1715 void owl_function_show_variable(c har *name)1715 void owl_function_show_variable(const char *name) 1716 1716 { 1717 1717 owl_fmtext fm; … … 1939 1939 } 1940 1940 1941 void owl_function_zlocate(int argc, c har **argv, int auth)1941 void owl_function_zlocate(int argc, const char *const *argv, int auth) 1942 1942 { 1943 1943 owl_fmtext fm; … … 1958 1958 } 1959 1959 1960 void owl_function_start_command(c har *line)1960 void owl_function_start_command(const char *line) 1961 1961 { 1962 1962 owl_editwin *tw; … … 1977 1977 } 1978 1978 1979 void owl_function_start_question(c har *line)1979 void owl_function_start_question(const char *line) 1980 1980 { 1981 1981 owl_editwin *tw; … … 1994 1994 } 1995 1995 1996 void owl_function_start_password(c har *line)1996 void owl_function_start_password(const char *line) 1997 1997 { 1998 1998 owl_editwin *tw; … … 2012 2012 } 2013 2013 2014 char *owl_function_exec(int argc, c har **argv,char *buff, int type)2014 char *owl_function_exec(int argc, const char *const *argv, const char *buff, int type) 2015 2015 { 2016 2016 /* if type == 1 display in a popup … … 2019 2019 * else display in a popup 2020 2020 */ 2021 c har *redirect = " 2>&1 < /dev/null";2021 const char *redirect = " 2>&1 < /dev/null"; 2022 2022 char *newbuff; 2023 2023 char *out, buff2[1024]; … … 2067 2067 } 2068 2068 2069 char *owl_function_perl(int argc, c har **argv,char *buff, int type)2069 char *owl_function_perl(int argc, const char *const *argv, const char *buff, int type) 2070 2070 { 2071 2071 /* if type == 1 display in a popup … … 2104 2104 * should have the pointer. 2105 2105 */ 2106 void owl_function_change_currentview_filter(c har *filtname)2106 void owl_function_change_currentview_filter(const char *filtname) 2107 2107 { 2108 2108 owl_view *v; … … 2152 2152 * with a new definition. 2153 2153 */ 2154 void owl_function_create_filter(int argc, c har **argv)2154 void owl_function_create_filter(int argc, const char *const *argv) 2155 2155 { 2156 2156 owl_filter *f; … … 2244 2244 * Returns the name of the negated filter, which the caller must free. 2245 2245 */ 2246 char *owl_function_create_negative_filter(c har *filtername)2246 char *owl_function_create_negative_filter(const char *filtername) 2247 2247 { 2248 2248 char *newname; 2249 2249 owl_filter *tmpfilt; 2250 c har *argv[5];2250 const char *argv[5]; 2251 2251 2252 2252 owl_function_debugmsg("owl_function_create_negative_filter"); … … 2300 2300 } 2301 2301 2302 void owl_function_show_filter(c har *name)2302 void owl_function_show_filter(const char *name) 2303 2303 { 2304 2304 owl_filter *f; … … 2348 2348 * name of the filter, which the caller must free. 2349 2349 */ 2350 char *owl_function_classinstfilt(c har *c,char *i)2350 char *owl_function_classinstfilt(const char *c, const char *i) 2351 2351 { 2352 2352 owl_filter *f; … … 2426 2426 * the filter, which the caller must free. 2427 2427 */ 2428 char *owl_function_zuserfilt(c har *user)2428 char *owl_function_zuserfilt(const char *user) 2429 2429 { 2430 2430 owl_filter *f; … … 2473 2473 * Returns the name of the filter, which the caller must free. 2474 2474 */ 2475 char *owl_function_aimuserfilt(c har *user)2475 char *owl_function_aimuserfilt(const char *user) 2476 2476 { 2477 2477 owl_filter *f; … … 2509 2509 } 2510 2510 2511 char *owl_function_typefilt(c har *type)2511 char *owl_function_typefilt(const char *type) 2512 2512 { 2513 2513 owl_filter *f; … … 2582 2582 owl_message *m; 2583 2583 char *zperson, *filtname=NULL; 2584 c har *argv[1];2584 const char *argv[1]; 2585 2585 2586 2586 v=owl_global_get_current_view(&g); … … 2653 2653 owl_view *v; 2654 2654 owl_message *m; 2655 c har *cmdprefix, *mclass, *minst;2655 const char *cmdprefix, *mclass, *minst; 2656 2656 char *cmd; 2657 2657 … … 2702 2702 * be 'color' 2703 2703 */ 2704 void owl_function_color_current_filter(c har *fgcolor,char *bgcolor)2705 { 2706 c har *name;2704 void owl_function_color_current_filter(const char *fgcolor, const char *bgcolor) 2705 { 2706 const char *name; 2707 2707 2708 2708 name=owl_view_get_filtname(owl_global_get_current_view(&g)); … … 2714 2714 * the "all" filter, return -2. Return 0 on success 2715 2715 */ 2716 int owl_function_color_filter(c har *filtname, char *fgcolor,char *bgcolor)2716 int owl_function_color_filter(const char *filtname, const char *fgcolor, const char *bgcolor) 2717 2717 { 2718 2718 owl_filter *f; … … 2797 2797 * if direction==1 then unpunt 2798 2798 */ 2799 void owl_function_zpunt(c har *class, char *inst,char *recip, int direction)2799 void owl_function_zpunt(const char *class, const char *inst, const char *recip, int direction) 2800 2800 { 2801 2801 char *puntexpr, *classexpr, *instexpr, *recipexpr; … … 2844 2844 } 2845 2845 2846 void owl_function_punt(c har *filter, int direction)2846 void owl_function_punt(const char *filter, int direction) 2847 2847 { 2848 2848 owl_filter *f; … … 2890 2890 } 2891 2891 2892 void owl_function_activate_keymap(c har *keymap)2892 void owl_function_activate_keymap(const char *keymap) 2893 2893 { 2894 2894 if (!owl_keyhandler_activate(owl_global_get_keyhandler(&g), keymap)) { … … 2904 2904 owl_keyhandler *kh; 2905 2905 int i, numkm; 2906 c har *kmname;2906 const char *kmname; 2907 2907 2908 2908 kh = owl_global_get_keyhandler(&g); … … 2928 2928 } 2929 2929 2930 char *owl_function_keymap_summary(c har *name)2930 char *owl_function_keymap_summary(const char *name) 2931 2931 { 2932 2932 owl_keymap *km … … 2937 2937 2938 2938 /* TODO: implement for real */ 2939 void owl_function_show_keymap(c har *name)2939 void owl_function_show_keymap(const char *name) 2940 2940 { 2941 2941 owl_fmtext fm; … … 2953 2953 } 2954 2954 2955 void owl_function_help_for_command(c har *cmdname)2955 void owl_function_help_for_command(const char *cmdname) 2956 2956 { 2957 2957 owl_fmtext fm; … … 2963 2963 } 2964 2964 2965 void owl_function_search_start(c har *string, int direction)2965 void owl_function_search_start(const char *string, int direction) 2966 2966 { 2967 2967 /* direction is OWL_DIRECTION_DOWNWARDS or OWL_DIRECTION_UPWARDS or … … 3059 3059 /* strips formatting from ztext and returns the unformatted text. 3060 3060 * caller is responsible for freeing. */ 3061 char *owl_function_ztext_stylestrip(c har *zt)3061 char *owl_function_ztext_stylestrip(const char *zt) 3062 3062 { 3063 3063 owl_fmtext fm; … … 3072 3072 3073 3073 /* Popup a buddylisting. If filename is NULL use the default .anyone */ 3074 void owl_function_buddylist(int aim, int zephyr, c har *filename)3074 void owl_function_buddylist(int aim, int zephyr, const char *filename) 3075 3075 { 3076 3076 int i, j, idle; … … 3083 3083 int x; 3084 3084 owl_list anyone; 3085 c har *user;3085 const char *user; 3086 3086 char *tmp; 3087 3087 ZLocations_t location[200]; … … 3189 3189 3190 3190 /* Dump messages in the current view to the file 'filename'. */ 3191 void owl_function_dump(c har *filename)3191 void owl_function_dump(const char *filename) 3192 3192 { 3193 3193 int i, j, count; … … 3299 3299 * startupfile. 3300 3300 */ 3301 void owl_function_addstartup(c har *buff)3301 void owl_function_addstartup(const char *buff) 3302 3302 { 3303 3303 FILE *file; 3304 c har *filename;3304 const char *filename; 3305 3305 3306 3306 filename=owl_global_get_startupfile(&g); … … 3321 3321 3322 3322 /* Remove the specified command from the startup file. */ 3323 void owl_function_delstartup(c har *buff)3324 { 3325 c har *filename;3323 void owl_function_delstartup(const char *buff) 3324 { 3325 const char *filename; 3326 3326 filename=owl_global_get_startupfile(&g); 3327 3327 owl_util_file_deleteline(filename, buff, 1); … … 3331 3331 * is NULL, use the default owl startup commands file. 3332 3332 */ 3333 void owl_function_source(c har *filename)3333 void owl_function_source(const char *filename) 3334 3334 { 3335 3335 char *path; … … 3360 3360 } 3361 3361 3362 void owl_function_change_style(owl_view *v, c har *stylename)3362 void owl_function_change_style(owl_view *v, const char *stylename) 3363 3363 { 3364 3364 owl_style *s; … … 3394 3394 } 3395 3395 3396 void owl_function_error(c har *fmt, ...)3396 void owl_function_error(const char *fmt, ...) 3397 3397 { 3398 3398 va_list ap; 3399 3399 char *buff; 3400 c har *nl;3400 const char *nl; 3401 3401 3402 3402 va_start(ap, fmt); … … 3416 3416 } 3417 3417 3418 void owl_function_log_err(c har *string)3418 void owl_function_log_err(const char *string) 3419 3419 { 3420 3420 char *date; … … 3444 3444 } 3445 3445 3446 void owl_function_makemsg(c har *fmt, ...)3446 void owl_function_makemsg(const char *fmt, ...) 3447 3447 { 3448 3448 va_list ap; … … 3474 3474 owl_message *m; 3475 3475 owl_zbuddylist *zbl; 3476 c har *user;3476 const char *user; 3477 3477 ZLocations_t location[200]; 3478 3478 int numlocs, ret; … … 3525 3525 } 3526 3526 3527 void owl_function_aimsearch_results(c har *email, owl_list *namelist)3527 void owl_function_aimsearch_results(const char *email, owl_list *namelist) 3528 3528 { 3529 3529 owl_fmtext fm;
Note: See TracChangeset
for help on using the changeset viewer.