Changes in / [f0d5ef5:12505e3]
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
barnowl
rde18326 rb14f8cb 7 7 EXE="$0.bin" 8 8 9 if ! test-x "$EXE"; then9 if test ! -x "$EXE"; then 10 10 echo "Cannot find barnowl.bin" >&2 11 11 exit 1 12 12 fi 13 13 14 export BARNOWL_DATA_DIR="$SRCDIR/perl/" 15 export BARNOWL_BIN_DIR="$SRCDIR/" 14 BARNOWL_DATA_DIR="$SRCDIR/perl/" 15 BARNOWL_BIN_DIR="$SRCDIR/" 16 export BARNOWL_DATA_DIR 17 export BARNOWL_BIN_DIR 16 18 exec "$EXE" "$@" -
cmd.c
r4c7c21f raad166a 5 5 #include "owl.h" 6 6 7 extern const owl_cmd commands_to_init[];8 9 7 /**************************************************************************/ 10 8 /***************************** COMMAND DICT *******************************/ … … 13 11 int owl_cmddict_setup(owl_cmddict *cd) { 14 12 owl_cmddict_init(cd); 15 if (0 != owl_cmddict_add_from_list(cd, commands_to_init)) return(-1); 16 return(0); 13 return owl_cmd_add_defaults(cd); 17 14 } 18 15 -
commands.c
rb9d22f7 r117c21c 8 8 /* fn is "char *foo(int argc, const char *const *argv, const char *buff)" */ 9 9 #define OWLCMD_ARGS(name, fn, ctx, summary, usage, description) \ 10 { name, summary, usage, description, ctx, \10 { g_strdup(name), g_strdup(summary), g_strdup(usage), g_strdup(description), ctx, \ 11 11 NULL, fn, NULL, NULL, NULL, NULL, NULL, NULL } 12 12 13 13 /* fn is "void foo(void)" */ 14 14 #define OWLCMD_VOID(name, fn, ctx, summary, usage, description) \ 15 { name, summary, usage, description, ctx, \15 { g_strdup(name), g_strdup(summary), g_strdup(usage), g_strdup(description), ctx, \ 16 16 NULL, NULL, fn, NULL, NULL, NULL, NULL, NULL } 17 17 18 18 /* fn is "void foo(int)" */ 19 19 #define OWLCMD_INT(name, fn, ctx, summary, usage, description) \ 20 { name, summary, usage, description, ctx, \20 { g_strdup(name), g_strdup(summary), g_strdup(usage), g_strdup(description), ctx, \ 21 21 NULL, NULL, NULL, fn, NULL, NULL, NULL, NULL } 22 22 23 23 #define OWLCMD_ALIAS(name, actualname) \ 24 { name, OWL_CMD_ALIAS_SUMMARY_PREFIX actualname, "", "", OWL_CTX_ANY, \25 actualname, NULL, NULL, NULL, NULL, NULL, NULL, NULL }24 { g_strdup(name), g_strdup(OWL_CMD_ALIAS_SUMMARY_PREFIX actualname), g_strdup(""), g_strdup(""), OWL_CTX_ANY, \ 25 g_strdup(actualname), NULL, NULL, NULL, NULL, NULL, NULL, NULL } 26 26 27 27 /* fn is "char *foo(void *ctx, int argc, const char *const *argv, const char *buff)" */ 28 28 #define OWLCMD_ARGS_CTX(name, fn, ctx, summary, usage, description) \ 29 { name, summary, usage, description, ctx, \29 { g_strdup(name), g_strdup(summary), g_strdup(usage), g_strdup(description), ctx, \ 30 30 NULL, NULL, NULL, NULL, ((char*(*)(void*,int,const char*const *,const char*))fn), NULL, NULL, NULL } 31 31 32 32 /* fn is "void foo(void)" */ 33 33 #define OWLCMD_VOID_CTX(name, fn, ctx, summary, usage, description) \ 34 { name, summary, usage, description, ctx, \34 { g_strdup(name), g_strdup(summary), g_strdup(usage), g_strdup(description), ctx, \ 35 35 NULL, NULL, NULL, NULL, NULL, ((void(*)(void*))(fn)), NULL, NULL } 36 36 37 37 /* fn is "void foo(int)" */ 38 38 #define OWLCMD_INT_CTX(name, fn, ctx, summary, usage, description) \ 39 { name, summary, usage, description, ctx, \39 { g_strdup(name), g_strdup(summary), g_strdup(usage), g_strdup(description), ctx, \ 40 40 NULL, NULL, NULL, NULL, NULL, NULL, ((void(*)(void*,int))fn), NULL } 41 41 42 42 43 const owl_cmd commands_to_init[] 44 = { 43 int owl_cmd_add_defaults(owl_cmddict *cd) 44 { 45 owl_cmd commands_to_init[] = { 46 45 47 OWLCMD_ARGS("zlog", owl_command_zlog, OWL_CTX_ANY, 46 48 "send a login or logout notification", … … 1036 1038 { NULL, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL } 1037 1039 1038 }; 1040 }; 1041 1042 int ret = owl_cmddict_add_from_list(cd, commands_to_init); 1043 owl_cmd *cmd; 1044 for (cmd = commands_to_init; cmd->name != NULL; cmd++) 1045 owl_cmd_cleanup(cmd); 1046 return ret; 1047 } 1039 1048 1040 1049 void owl_command_info(void) -
configure.ac
rdb4f7c3 r9d43dcc 8 8 9 9 AC_PROG_CC 10 AC_PROG_CC_C99 10 11 11 12 AC_ARG_WITH([stack-protector], … … 80 81 AC_HEADER_STDC 81 82 AC_HEADER_SYS_WAIT 82 AC_HEADER_STDBOOL 83 AC_CHECK_HEADERS(strings.h sys/ioctl.h sys/filio.h unistd.h) 83 AC_CHECK_HEADERS(stdbool.h strings.h sys/ioctl.h sys/filio.h unistd.h) 84 84 85 85 dnl Add CFLAGS for embeded perl … … 130 130 AX_CFLAGS_WARN_ALL([AM_CFLAGS]) 131 131 AX_C_CHECK_FLAG([-Wstrict-prototypes],[],[],[AM_CFLAGS="$AM_CFLAGS -Wstrict-prototypes"]) 132 AX_C_CHECK_FLAG([-Wwrite-strings],[],[],[AM_CFLAGS="$AM_CFLAGS -Wwrite-strings"]) 132 133 133 134 dnl Shut gcc up about zero-length format strings; the warning's apparently for … … 143 144 test "$HAVE_DES_ECB_ENCRYPT"]) 144 145 145 AM_CFLAGS="$AM_CFLAGS -D_XOPEN_SOURCE= 500"146 AM_CFLAGS="$AM_CFLAGS -D_XOPEN_SOURCE=600" 146 147 dnl Define _BSD_SOURCE because zephyr needs caddr_t. 147 148 AM_CFLAGS="$AM_CFLAGS -D_BSD_SOURCE" -
libfaim/aim.h
r63de71c rfe73d0c 18 18 19 19 #include "config.h" 20 #ifdef HAVE_STDBOOL_H21 20 #include <stdbool.h> 22 #else23 #ifndef HAVE__BOOL24 #define _Bool signed char25 #endif26 #define bool _Bool27 #define false 028 #define true 129 #define __bool_true_false_are_defined 130 #endif /* HAVE_STDBOOL_H */31 21 32 22 #include <stdio.h> -
owl.h
rc5c5686 rc5c5686 14 14 #include "compat/compat.h" 15 15 16 #ifdef HAVE_STDBOOL_H17 16 #include <stdbool.h> 18 #else19 #ifndef HAVE__BOOL20 #define _Bool signed char21 #endif22 #define bool _Bool23 #define false 024 #define true 125 #define __bool_true_false_are_defined 126 #endif /* HAVE_STDBOOL_H */27 17 28 18 #ifndef OWL_PERL 19 #define NCURSES_ENABLE_STDBOOL_H 1 29 20 #include <curses.h> 30 21 #include <panel.h> … … 238 229 void *pval_default; /* for types other and string */ 239 230 int ival_default; /* for types int and bool */ 240 c har *validsettings;/* documentation of valid settings */231 const char *validsettings; /* documentation of valid settings */ 241 232 char *summary; /* summary of usage */ 242 233 char *description; /* detailed description */ -
perlconfig.c
rf21bc36 rf21bc36 215 215 owl_message_set_zwriteline(m, val); 216 216 } else if (!strcmp(key, "time")) { 217 g_free(m->timestr); 217 218 m->timestr = g_strdup(val); 218 219 strptime(val, "%a %b %d %T %Y", &tm); … … 492 493 PUTBACK; 493 494 494 call_pv("BarnOwl::Hooks::_new_command", G_ SCALAR|G_VOID|G_EVAL);495 call_pv("BarnOwl::Hooks::_new_command", G_VOID|G_EVAL); 495 496 496 497 SPAGAIN; -
scripts/locker-build
r0fd5bd5 r4f5e38f 102 102 esac 103 103 104 C FLAGS="-I$BARNOWL/include" \105 LDFLAGS="-L$BARNOWL/lib $opt_rpath$BARNOWL/lib" \104 CPPFLAGS="-I$BARNOWL/include -I/usr/athena/include" \ 105 LDFLAGS="-L$BARNOWL/lib -L/usr/athena/lib $opt_rpath$BARNOWL/lib" \ 106 106 ./configure --exec-prefix="/mit/barnowl/arch/$ATHENA_SYS" \ 107 107 --prefix="/mit/barnowl/builds/barnowl-$VERS" --mandir=/mit/barnowl/man \ -
select.c
rf0d5ef5 rf0d5ef5 17 17 if (loop) { 18 18 g_main_loop_quit(loop); 19 g_main_loop_unref(loop); 19 20 loop = NULL; 20 21 } -
tester.c
r4c7c21f r4e37d56 32 32 char *perlerr; 33 33 int status = 0; 34 SCREEN *screen; 34 35 35 36 if (argc <= 1) { … … 41 42 wnull = fopen("/dev/null", "w"); 42 43 rnull = fopen("/dev/null", "r"); 43 newterm("xterm", wnull, rnull);44 screen = newterm("xterm", wnull, rnull); 44 45 /* initialize global structures */ 45 46 owl_global_init(&g); … … 91 92 /* probably not necessary, but tear down the screen */ 92 93 endwin(); 94 delscreen(screen); 93 95 fclose(rnull); 94 96 fclose(wnull); … … 218 220 owl_string_appendf_quoted(g, "%q foo %q%q %s %", "hello", "world is", "can't"); 219 221 FAIL_UNLESS("owl_string_appendf", 220 !strcmp(g _string_free(g, false),221 "hello foo 'world is'\"can't\" %s %"));222 !strcmp(g->str, "hello foo 'world is'\"can't\" %s %")); 223 g_string_free(g, true); 222 224 223 225 /* if (numfailed) printf("*** WARNING: failures encountered with owl_util\n"); */ … … 230 232 owl_list l; 231 233 int numfailed=0; 232 char *av="aval", *bv="bval", *cv="cval", *dv="dval"; 234 char *av = g_strdup("aval"), *bv = g_strdup("bval"), *cv = g_strdup("cval"), 235 *dv = g_strdup("dval"); 233 236 234 237 printf("# BEGIN testing owl_dict\n"); … … 259 262 owl_list_cleanup(&l, g_free); 260 263 owl_dict_cleanup(&d, NULL); 264 265 g_free(av); 266 g_free(bv); 267 g_free(cv); 268 g_free(dv); 261 269 262 270 /* if (numfailed) printf("*** WARNING: failures encountered with owl_dict\n"); */ -
variable.c
r89fe67e r9efc154 7 7 8 8 #define OWLVAR_BOOL(name,default,summary,description) \ 9 { name, OWL_VARIABLE_BOOL, NULL, default, "on,off", summary,description, NULL, \9 { g_strdup(name), OWL_VARIABLE_BOOL, NULL, default, "on,off", g_strdup(summary), g_strdup(description), NULL, \ 10 10 NULL, NULL, NULL, NULL, NULL, NULL } 11 11 12 12 #define OWLVAR_BOOL_FULL(name,default,summary,description,validate,set,get) \ 13 { name, OWL_VARIABLE_BOOL, NULL, default, "on,off", summary,description, NULL, \13 { g_strdup(name), OWL_VARIABLE_BOOL, NULL, default, "on,off", g_strdup(summary), g_strdup(description), NULL, \ 14 14 validate, set, NULL, get, NULL, NULL } 15 15 16 16 #define OWLVAR_INT(name,default,summary,description) \ 17 { name, OWL_VARIABLE_INT, NULL, default, "<int>", summary,description, NULL, \17 { g_strdup(name), OWL_VARIABLE_INT, NULL, default, "<int>", g_strdup(summary), g_strdup(description), NULL, \ 18 18 NULL, NULL, NULL, NULL, NULL, NULL } 19 19 20 20 #define OWLVAR_INT_FULL(name,default,summary,description,validset,validate,set,get) \ 21 { name, OWL_VARIABLE_INT, NULL, default, validset, summary,description, NULL, \21 { g_strdup(name), OWL_VARIABLE_INT, NULL, default, validset, g_strdup(summary), g_strdup(description), NULL, \ 22 22 validate, set, NULL, get, NULL, NULL } 23 23 24 24 #define OWLVAR_PATH(name,default,summary,description) \ 25 { name, OWL_VARIABLE_STRING, default, 0, "<path>", summary,description, NULL, \25 { g_strdup(name), OWL_VARIABLE_STRING, g_strdup(default), 0, "<path>", g_strdup(summary), g_strdup(description), NULL, \ 26 26 NULL, NULL, NULL, NULL, NULL, NULL } 27 27 28 28 #define OWLVAR_STRING(name,default,summary,description) \ 29 { name, OWL_VARIABLE_STRING, default, 0, "<string>", summary,description, NULL, \29 { g_strdup(name), OWL_VARIABLE_STRING, g_strdup(default), 0, "<string>", g_strdup(summary), g_strdup(description), NULL, \ 30 30 NULL, NULL, NULL, NULL, NULL, NULL } 31 31 32 32 #define OWLVAR_STRING_FULL(name,default,validset,summary,description,validate,set,get) \ 33 { name, OWL_VARIABLE_STRING, default, 0, validset, summary,description, NULL, \33 { g_strdup(name), OWL_VARIABLE_STRING, g_strdup(default), 0, validset, g_strdup(summary), g_strdup(description), NULL, \ 34 34 validate, set, NULL, get, NULL, NULL } 35 35 … … 38 38 * correspond to the values that may be specified. */ 39 39 #define OWLVAR_ENUM(name,default,summary,description,validset) \ 40 { name, OWL_VARIABLE_INT, NULL, default, validset, summary,description, NULL, \40 { g_strdup(name), OWL_VARIABLE_INT, NULL, default, validset, g_strdup(summary), g_strdup(description), NULL, \ 41 41 owl_variable_enum_validate, \ 42 42 NULL, owl_variable_enum_set_fromstring, \ … … 45 45 46 46 #define OWLVAR_ENUM_FULL(name,default,summary,description,validset,validate, set, get) \ 47 { name, OWL_VARIABLE_INT, NULL, default, validset, summary,description, NULL, \47 { g_strdup(name), OWL_VARIABLE_INT, NULL, default, validset, g_strdup(summary), g_strdup(description), NULL, \ 48 48 validate, \ 49 49 set, owl_variable_enum_set_fromstring, \ … … 51 51 NULL } 52 52 53 static owl_variable variables_to_init[] = { 53 int owl_variable_add_defaults(owl_vardict *vd) 54 { 55 owl_variable variables_to_init[] = { 54 56 55 57 OWLVAR_STRING( "personalbell" /* %OwlVarStub */, "off", … … 439 441 NULL, NULL, NULL, NULL, NULL, NULL } 440 442 441 }; 443 }; 444 445 int ret = owl_variable_dict_add_from_list(vd, variables_to_init); 446 owl_variable *var; 447 for (var = variables_to_init; var->name != NULL; var++) 448 owl_variable_cleanup(var); 449 return ret; 450 } 442 451 443 452 /**************************************************************************/ … … 557 566 558 567 int owl_variable_dict_setup(owl_vardict *vd) { 568 owl_dict_create(vd); 569 return owl_variable_add_defaults(vd); 570 } 571 572 int owl_variable_dict_add_from_list(owl_vardict *vd, owl_variable *variables_to_init) 573 { 559 574 owl_variable *var, *cur; 560 owl_dict_create(vd);561 575 for (var = variables_to_init; var->name != NULL; var++) { 562 576 cur = g_new(owl_variable, 1); … … 583 597 if (!cur->delete_fn) 584 598 cur->delete_fn = owl_variable_delete_default; 599 cur->pval_default = g_strdup(var->pval_default); 585 600 cur->set_fn(cur, cur->pval_default); 586 601 break; … … 717 732 } 718 733 719 void owl_variable_ delete(owl_variable *v)734 void owl_variable_cleanup(owl_variable *v) 720 735 { 721 736 if (v->delete_fn) v->delete_fn(v); … … 723 738 g_free(v->summary); 724 739 g_free(v->description); 740 if (v->type == OWL_VARIABLE_STRING) 741 g_free(v->pval_default); 742 } 743 744 void owl_variable_delete(owl_variable *v) 745 { 746 owl_variable_cleanup(v); 725 747 g_free(v); 726 748 } -
window.h
r4cc49bc rfe73d0c 5 5 #include <glib-object.h> 6 6 7 #ifdef HAVE_STDBOOL_H8 7 #include <stdbool.h> 9 #else10 #ifndef HAVE__BOOL11 #define _Bool signed char12 #endif13 #define bool _Bool14 #define false 015 #define true 116 #define __bool_true_false_are_defined 117 #endif /* HAVE_STDBOOL_H */18 8 19 9 G_BEGIN_DECLS -
zcrypt.c
r3b8a563 r5b197f7 11 11 #include <unistd.h> 12 12 #include <sys/types.h> 13 #include <zephyr/zephyr.h>14 13 #include <glib.h> 15 14 #include <string.h>
Note: See TracChangeset
for help on using the changeset viewer.