Changes in / [93ee554:34509d5]
- Files:
-
- 1 deleted
- 27 edited
Legend:
- Unmodified
- Added
- Removed
-
Makefile.in
r2bdfed9 r702aee7 45 45 #AUTOGEN=$(GEN_C) 46 46 47 HEADERS=$(GEN_H) owl.h config.h test.h47 HEADERS=$(GEN_H) owl.h config.h 48 48 49 49 %.o: %.c $(HEADERS) … … 127 127 ${INSTALL} -d ${DESTDIR}${datadir}/lib 128 128 ${INSTALL} -d ${DESTDIR}${datadir}/modules 129 tar -C perl/lib --exclude .svn -c f - . | tar -C ${DESTDIR}${datadir}/lib -xf -129 tar -C perl/lib --exclude .svn -c . | tar -C ${DESTDIR}${datadir}/lib -x 130 130 for i in $(PERL_MODULES); do \ 131 131 ${INSTALL_DATA} perl/modules/$$i/$$i.par ${DESTDIR}${datadir}/modules/$$i.par; \ -
commands.c
rfa4f9c3 r987ff51 132 132 OWLCMD_ARGS("aimwrite", owl_command_aimwrite, OWL_CTX_INTERACTIVE, 133 133 "send an AIM message", 134 "aimwrite <user> [-m <message...>]", 135 "Send an aim message to a user.\n\n" 136 "The following options are available:\n\n" 137 "-m Specifies a message to send without prompting.\n"), 134 "aimzwrite <user>", 135 "Send an aim message to a user.\n"), 138 136 139 137 OWLCMD_ARGS("loopwrite", owl_command_loopwrite, OWL_CTX_INTERACTIVE, … … 282 280 "suppressed to be received again.\n\n" 283 281 "SEE ALSO: zpunt, show zpunts\n"), 284 285 OWLCMD_ARGS("punt", owl_command_punt, OWL_CTX_ANY,286 "suppress an arbitrary filter",287 "punt <filter-name>",288 "punt <filter-text (multiple words)>\n"289 "The punt command will supress message to the specified\n"290 "filter\n\n"291 "SEE ALSO: unpunt, zpunt, show zpunts\n"),292 293 OWLCMD_ARGS("unpunt", owl_command_unpunt, OWL_CTX_ANY,294 "remove an entry from the punt list",295 "zpunt <filter-name>\n"296 "zpunt <filter-text>\n"297 "zpunt <number>\n",298 "The unpunt command will remove an entry from the puntlist.\n"299 "The first two forms correspond to the first two forms of the :punt\n"300 "command. The latter allows you to remove a specific entry from the\n"301 "the list (see :show zpunts)\n\n"302 "SEE ALSO: punt, zpunt, zunpunt, show zpunts\n"),303 282 304 283 OWLCMD_VOID("info", owl_command_info, OWL_CTX_INTERACTIVE, … … 1888 1867 char *owl_command_aimwrite(int argc, char **argv, char *buff) 1889 1868 { 1890 char *newbuff, *recip, **myargv; 1891 int i, j, myargc; 1892 owl_message *m; 1869 char *newbuff; 1870 int i, j; 1893 1871 1894 1872 if (!owl_global_is_aimloggedin(&g)) { … … 1900 1878 owl_function_makemsg("Not enough arguments to the aimwrite command."); 1901 1879 return(NULL); 1902 }1903 1904 myargv=argv;1905 if (argc<0) {1906 owl_function_error("Unbalanced quotes in aimwrite");1907 return(NULL);1908 }1909 myargc=argc;1910 if (myargc && *(myargv[0])!='-') {1911 myargc--;1912 myargv++;1913 }1914 while (myargc) {1915 if (!strcmp(myargv[0], "-m")) {1916 if (myargc<2) {1917 break;1918 }1919 1920 /* Once we have -m, gobble up everything else on the line */1921 myargv++;1922 myargc--;1923 newbuff=owl_malloc(1);1924 newbuff=owl_strdup("");1925 while (myargc) {1926 newbuff=realloc(newbuff, strlen(newbuff)+strlen(myargv[0])+5);1927 strcat(newbuff, myargv[0]);1928 strcat(newbuff, " ");1929 myargc--;1930 myargv++;1931 }1932 newbuff[strlen(newbuff)-1]='\0'; /* remove last space */1933 1934 recip=owl_malloc(strlen(argv[0])+5);1935 sprintf(recip, "%s ", argv[1]);1936 owl_aim_send_im(recip, newbuff);1937 m=owl_function_make_outgoing_aim(newbuff, recip);1938 if (m) {1939 owl_global_messagequeue_addmsg(&g, m);1940 } else {1941 owl_function_error("Could not create outgoing AIM message");1942 }1943 1944 owl_free(recip);1945 owl_free(newbuff);1946 return(NULL);1947 } else {1948 /* we don't care */1949 myargv++;1950 myargc--;1951 }1952 1880 } 1953 1881 … … 2214 2142 char *filename; 2215 2143 2216 filename=owl_ global_get_startupfile(&g);2144 filename=owl_sprintf("%s/%s", owl_global_get_homedir(&g), OWL_STARTUP_FILE); 2217 2145 owl_function_popless_file(filename); 2146 owl_free(filename); 2218 2147 } else if (!strcmp(argv[1], "errors")) { 2219 2148 owl_function_showerrs(); … … 2365 2294 return NULL; 2366 2295 } 2296 2367 2297 2368 2298 void owl_command_zpunt_and_zunpunt(int argc, char **argv, int type) … … 2415 2345 } 2416 2346 2417 char *owl_command_punt(int argc, char **argv, char *buff)2418 {2419 owl_command_punt_unpunt(argc, argv, buff, 0);2420 return NULL;2421 }2422 2423 char *owl_command_unpunt(int argc, char **argv, char *buff)2424 {2425 owl_command_punt_unpunt(argc, argv, buff, 1);2426 return NULL;2427 }2428 2429 void owl_command_punt_unpunt(int argc, char ** argv, char *buff, int unpunt)2430 {2431 owl_list * fl;2432 owl_filter * f;2433 char * text;2434 int i;2435 2436 fl = owl_global_get_puntlist(&g);2437 if(argc == 1) {2438 owl_function_show_zpunts();2439 }2440 2441 if(argc == 2) {2442 /* Handle :unpunt <number> */2443 if(unpunt && (i=atoi(argv[1])) !=0) {2444 i--; /* Accept 1-based indexing */2445 if(i < owl_list_get_size(fl)) {2446 f = (owl_filter*)owl_list_get_element(fl, i);2447 owl_list_remove_element(fl, i);2448 owl_filter_free(f);2449 return;2450 } else {2451 owl_function_error("No such filter number: %d", i+1);2452 }2453 }2454 text = owl_sprintf("filter %s", argv[1]);2455 } else {2456 text = skiptokens(buff, 1);2457 }2458 2459 owl_function_punt(text, unpunt);2460 }2461 2462 2463 2347 char *owl_command_getview(int argc, char **argv, char *buff) 2464 2348 { … … 2585 2469 owl_message *m; 2586 2470 owl_view *v; 2587 char *cmd;2588 2471 2589 2472 v = owl_global_get_current_view(&g); … … 2604 2487 return; 2605 2488 } 2606 c md = owl_message_get_attribute_value(m, "yescommand");2489 char * cmd = owl_message_get_attribute_value(m, "yescommand"); 2607 2490 if(!cmd) { 2608 2491 owl_function_error("No yes command!"); … … 2619 2502 owl_message *m; 2620 2503 owl_view *v; 2621 char *cmd;2622 2504 2623 2505 v = owl_global_get_current_view(&g); … … 2638 2520 return; 2639 2521 } 2640 c md = owl_message_get_attribute_value(m, "nocommand");2522 char * cmd = owl_message_get_attribute_value(m, "nocommand"); 2641 2523 if(!cmd) { 2642 2524 owl_function_error("No no command!"); -
configure.in
r34509d5 r34509d5 33 33 34 34 dnl Check for kerberosIV include 35 AC_MSG_CHECKING(for kerberosIV)35 AC_MSG_CHECKING(for /usr/include/kerberosIV) 36 36 if test -d /usr/include/kerberosIV; then 37 37 CFLAGS=${CFLAGS}\ -I/usr/include/kerberosIV 38 38 CPPFLAGS=${CPPFLAGS}\ -I/usr/include/kerberosIV 39 AC_MSG_RESULT(yes)40 elif test -d /usr/local/include/kerberosIV; then41 CFLAGS=${CFLAGS}\ -I/usr/local/include/kerberosIV42 CPPFLAGS=${CPPFLAGS}\ -I/usr/local/include/kerberosIV43 39 AC_MSG_RESULT(yes) 44 40 else … … 106 102 fi 107 103 108 dnl Add LDFLAGS for embed ded perl104 dnl Add LDFLAGS for embeded perl 109 105 FOO=`perl -MExtUtils::Embed -e ldopts` 110 106 echo Adding perl LDFLAGS ${FOO} … … 121 117 122 118 dnl Checks for typedefs, structures, and compiler characteristics. 119 AC_CHECK_FILE(/usr/share/terminfo, AC_DEFINE(TERMINFO, "/usr/share/terminfo", [Have terminfo]), 120 AC_CHECK_FILE(/usr/share/lib/terminfo, AC_DEFINE(TERMINFO, "/usr/share/lib/terminfo", [Have terminfo]), 121 AC_MSG_ERROR(No terminfo found for this system))) 123 122 124 123 AC_SUBST(XSUBPPDIR) -
debian/control
rc7172b3 r8d1a33f 3 3 Priority: optional 4 4 Maintainer: Sam Hartman <hartmans@debian.org> 5 Build-Depends: debhelper (>> 4.0.0), libzephyr-dev (>= 2.1.20010518.SNAPSHOT-7), libncurses5-dev, libkrb5-dev, libperl-dev , zip5 Build-Depends: debhelper (>> 4.0.0), libzephyr-dev (>= 2.1.20010518.SNAPSHOT-7), libncurses5-dev, libkrb5-dev, libperl-dev 6 6 Standards-Version: 3.5.2 7 7 … … 12 12 Description: A curses-based tty Jabber and Zephyr client. 13 13 An alternative standalone (doesn't use zwgc) Zephyr (instant 14 messaging) client. Also supports AIM andJabber.14 messaging) client. Also supports Jabber. 15 15 Much of the functionality is written in Perl, which is supported as 16 16 an extension language. 17 17 . 18 This is a fork of ktools software's owl Zephyr/AIM client18 ktools software -- The 'k' is for Quality! -
dict.c
r1cf3f8d3 r0138478 152 152 char *av="aval", *bv="bval", *cv="cval", *dv="dval"; 153 153 154 printf(" #BEGIN testing owl_dict\n");154 printf("BEGIN testing owl_dict\n"); 155 155 FAIL_UNLESS("create", 0==owl_dict_create(&d)); 156 156 FAIL_UNLESS("insert b", 0==owl_dict_insert_element(&d, "b", (void*)bv, owl_dict_noop_free)); … … 179 179 owl_dict_free_all(&d, NULL); 180 180 181 //if (numfailed) printf("*** WARNING: failures encountered with owl_dict\n");182 printf(" #END testing owl_dict (%d failures)\n", numfailed);181 if (numfailed) printf("*** WARNING: failures encountered with owl_dict\n"); 182 printf("END testing owl_dict (%d failures)\n", numfailed); 183 183 return(numfailed); 184 184 } -
filter.c
rad15610 rd791cdb 63 63 static owl_filterelement * owl_filter_parse_primitive_expression(int argc, char **argv, int *next) 64 64 { 65 owl_filterelement *fe, *op; 65 if(!argc) return NULL; 66 67 owl_filterelement * fe = owl_malloc(sizeof(owl_filterelement)); 68 owl_filterelement *op; 69 70 owl_filterelement_create(fe); 66 71 int i = 0, skip; 67 68 if(!argc) return NULL;69 70 fe = owl_malloc(sizeof(owl_filterelement));71 owl_filterelement_create(fe);72 72 73 73 if(!strcasecmp(argv[i], "(")) { … … 118 118 { 119 119 int i = 0, skip; 120 owl_filterelement * op1 = NULL, * op2 = NULL , *tmp;120 owl_filterelement * op1 = NULL, * op2 = NULL; 121 121 122 122 op1 = owl_filter_parse_primitive_expression(argc-i, argv+i, &skip); … … 129 129 op2 = owl_filter_parse_primitive_expression(argc-i-1, argv+i+1, &skip); 130 130 if(!op2) goto err; 131 tmp = owl_malloc(sizeof(owl_filterelement));131 owl_filterelement * tmp = owl_malloc(sizeof(owl_filterelement)); 132 132 if(!strcasecmp(argv[i], "and")) { 133 133 owl_filterelement_create_and(tmp, op1, op2); … … 204 204 int owl_filter_message_match(owl_filter *f, owl_message *m) 205 205 { 206 int ret;207 206 if(!f->root) return 0; 208 ret = owl_filterelement_match(f->root, m);207 int ret = owl_filterelement_match(f->root, m); 209 208 if(f->polarity) ret = !ret; 210 209 return ret; … … 284 283 int failed = 0; 285 284 if(owl_filter_init_fromstring(&f, "test-filter", filt)) { 286 printf(" not ok can'tparse %s\n", filt);285 printf("\tFAIL: parse %s\n", filt); 287 286 failed = 1; 288 287 goto out; … … 290 289 ok = owl_filter_message_match(&f, m); 291 290 if((shouldmatch && !ok) || (!shouldmatch && ok)) { 292 printf(" not okmatch %s (got %d, expected %d)\n", filt, ok, shouldmatch);291 printf("\tFAIL: match %s (got %d, expected %d)\n", filt, ok, shouldmatch); 293 292 failed = 1; 294 293 } … … 296 295 owl_filter_free(&f); 297 296 if(!failed) { 298 printf(" ok%s %s\n", shouldmatch ? "matches" : "doesn't match", filt);297 printf("\tok : %s %s\n", shouldmatch ? "matches" : "doesn't match", filt); 299 298 } 300 299 return failed; … … 306 305 307 306 int owl_filter_regtest(void) { 307 owl_list_create(&(g.filterlist)); 308 308 int numfailed=0; 309 309 owl_message m; 310 owl_filter f1, f2, f3, f4;311 312 owl_list_create(&(g.filterlist));313 310 owl_message_init(&m); 314 311 owl_message_set_type_zephyr(&m); … … 348 345 TEST_FILTER("true and false or false", 0); 349 346 347 owl_filter f1, f2, f3, f4; 348 350 349 owl_filter_init_fromstring(&f1, "f1", "class owl"); 351 350 owl_global_add_filter(&g, &f1); -
functions.c
r34509d5 r34509d5 580 580 581 581 if (i>owl_view_get_size(v)-1) i=owl_view_get_size(v)-1; 582 if (i<0) i=0;583 582 584 583 if (!found) { … … 849 848 { 850 849 int ret, ret2; 851 char *foo , *path;850 char *foo; 852 851 853 852 if (file==NULL) { 854 853 ret=owl_zephyr_loadsubs(NULL, 0); 855 854 } else { 856 path = owl_util_makepath(file); 857 ret=owl_zephyr_loadsubs(path, 1); 858 free(path); 855 ret=owl_zephyr_loadsubs(file, 1); 859 856 } 860 857 … … 2060 2057 /* if it's a zephyr we sent, send it out the same way again */ 2061 2058 if (owl_message_is_direction_out(m)) { 2062 buff = owl_strdup(owl_message_get_zwriteline(m)); 2059 owl_function_zwrite_setup(owl_message_get_zwriteline(m)); 2060 owl_global_set_buffercommand(&g, owl_message_get_zwriteline(m)); 2061 return; 2062 } 2063 2064 /* Special case a personal reply to a webzephyr user on a class */ 2065 if ((type==1) && !strcasecmp(owl_message_get_opcode(m), OWL_WEBZEPHYR_OPCODE)) { 2066 class=OWL_WEBZEPHYR_CLASS; 2067 inst=owl_message_get_sender(m); 2068 to=OWL_WEBZEPHYR_PRINCIPAL; 2069 } else if (!strcasecmp(owl_message_get_class(m), OWL_WEBZEPHYR_CLASS) && owl_message_is_loginout(m)) { 2070 /* Special case LOGIN/LOGOUT notifications on class "webzephyr" */ 2071 class=OWL_WEBZEPHYR_CLASS; 2072 inst=owl_message_get_instance(m); 2073 to=OWL_WEBZEPHYR_PRINCIPAL; 2074 } else if (owl_message_is_loginout(m)) { 2075 /* Normal LOGIN/LOGOUT messages */ 2076 class="MESSAGE"; 2077 inst="PERSONAL"; 2078 to=owl_message_get_sender(m); 2079 } else if (type==1) { 2080 /* Personal reply */ 2081 class="MESSAGE"; 2082 inst="PERSONAL"; 2083 to=owl_message_get_sender(m); 2063 2084 } else { 2064 2065 /* Special case a personal reply to a webzephyr user on a class */ 2066 if ((type==1) && !strcasecmp(owl_message_get_opcode(m), OWL_WEBZEPHYR_OPCODE)) { 2067 class=OWL_WEBZEPHYR_CLASS; 2068 inst=owl_message_get_sender(m); 2069 to=OWL_WEBZEPHYR_PRINCIPAL; 2070 } else if (!strcasecmp(owl_message_get_class(m), OWL_WEBZEPHYR_CLASS) && owl_message_is_loginout(m)) { 2071 /* Special case LOGIN/LOGOUT notifications on class "webzephyr" */ 2072 class=OWL_WEBZEPHYR_CLASS; 2073 inst=owl_message_get_instance(m); 2074 to=OWL_WEBZEPHYR_PRINCIPAL; 2075 } else if (owl_message_is_loginout(m)) { 2076 /* Normal LOGIN/LOGOUT messages */ 2077 class="MESSAGE"; 2078 inst="PERSONAL"; 2079 to=owl_message_get_sender(m); 2080 } else if (type==1) { 2081 /* Personal reply */ 2082 class="MESSAGE"; 2083 inst="PERSONAL"; 2084 to=owl_message_get_sender(m); 2085 } else { 2086 /* General reply */ 2087 class=owl_message_get_class(m); 2088 inst=owl_message_get_instance(m); 2089 to=owl_message_get_recipient(m); 2090 cc=owl_message_get_cc_without_recipient(m); 2091 if (!strcmp(to, "") || !strcmp(to, "*")) { 2092 to=""; 2093 } else if (to[0]=='@') { 2094 /* leave it, to get the realm */ 2095 } else { 2096 to=owl_message_get_sender(m); 2097 } 2098 } 2099 2100 /* create the command line */ 2101 if (!strcasecmp(owl_message_get_opcode(m), "CRYPT")) { 2102 buff=owl_strdup("zcrypt"); 2103 } else { 2104 buff = owl_strdup("zwrite"); 2105 } 2106 if (strcasecmp(class, "message")) { 2107 buff = owl_sprintf("%s -c %s%s%s", oldbuff=buff, owl_getquoting(class), class, owl_getquoting(class)); 2108 owl_free(oldbuff); 2109 } 2110 if (strcasecmp(inst, "personal")) { 2111 buff = owl_sprintf("%s -i %s%s%s", oldbuff=buff, owl_getquoting(inst), inst, owl_getquoting(inst)); 2112 owl_free(oldbuff); 2113 } 2114 if (*to != '\0') { 2115 char *tmp, *oldtmp, *tmp2; 2116 tmp=short_zuser(to); 2117 if (cc) { 2118 tmp = owl_util_uniq(oldtmp=tmp, cc, "-"); 2119 owl_free(oldtmp); 2120 buff = owl_sprintf("%s -C %s", oldbuff=buff, tmp); 2121 owl_free(oldbuff); 2122 } else { 2123 if (owl_global_is_smartstrip(&g)) { 2124 tmp2=tmp; 2125 tmp=owl_zephyr_smartstripped_user(tmp2); 2126 owl_free(tmp2); 2127 } 2128 buff = owl_sprintf("%s %s", oldbuff=buff, tmp); 2129 owl_free(oldbuff); 2130 } 2131 owl_free(tmp); 2132 } 2133 if (cc) owl_free(cc); 2085 /* General reply */ 2086 class=owl_message_get_class(m); 2087 inst=owl_message_get_instance(m); 2088 to=owl_message_get_recipient(m); 2089 cc=owl_message_get_cc_without_recipient(m); 2090 if (!strcmp(to, "") || !strcmp(to, "*")) { 2091 to=""; 2092 } else if (to[0]=='@') { 2093 /* leave it, to get the realm */ 2094 } else { 2095 to=owl_message_get_sender(m); 2096 } 2134 2097 } 2098 2099 /* create the command line */ 2100 if (!strcasecmp(owl_message_get_opcode(m), "CRYPT")) { 2101 buff=owl_strdup("zcrypt"); 2102 } else { 2103 buff = owl_strdup("zwrite"); 2104 } 2105 if (strcasecmp(class, "message")) { 2106 buff = owl_sprintf("%s -c %s%s%s", oldbuff=buff, owl_getquoting(class), class, owl_getquoting(class)); 2107 owl_free(oldbuff); 2108 } 2109 if (strcasecmp(inst, "personal")) { 2110 buff = owl_sprintf("%s -i %s%s%s", oldbuff=buff, owl_getquoting(inst), inst, owl_getquoting(inst)); 2111 owl_free(oldbuff); 2112 } 2113 if (*to != '\0') { 2114 char *tmp, *oldtmp, *tmp2; 2115 tmp=short_zuser(to); 2116 if (cc) { 2117 tmp = owl_util_uniq(oldtmp=tmp, cc, "-"); 2118 owl_free(oldtmp); 2119 buff = owl_sprintf("%s -C %s", oldbuff=buff, tmp); 2120 owl_free(oldbuff); 2121 } else { 2122 if (owl_global_is_smartstrip(&g)) { 2123 tmp2=tmp; 2124 tmp=owl_zephyr_smartstripped_user(tmp2); 2125 owl_free(tmp2); 2126 } 2127 buff = owl_sprintf("%s %s", oldbuff=buff, tmp); 2128 owl_free(oldbuff); 2129 } 2130 owl_free(tmp); 2131 } 2132 if (cc) owl_free(cc); 2135 2133 } else if (owl_message_is_type_aim(m)) { 2136 2134 /* aim */ … … 2559 2557 for (i=0; i<j; i++) { 2560 2558 f=owl_list_get_element(fl, i); 2561 snprintf(buff, sizeof(buff), "[% 2d] ", i+1);2562 owl_fmtext_append_normal(&fm, buff);2563 2559 owl_filter_print(f, buff); 2564 2560 owl_fmtext_append_normal(&fm, buff); … … 2626 2622 sprintf(argbuff, "class ^(un)*%s(\\.d)*$", tmpclass); 2627 2623 if (tmpinstance) { 2628 sprintf(argbuff, "%s and ( instance ^ (un)*%s(\\.d)*$ )", argbuff, tmpinstance);2624 sprintf(argbuff, "%s and ( instance ^%s(\\.d)*$ )", argbuff, tmpinstance); 2629 2625 } 2630 2626 owl_free(tmpclass); … … 2674 2670 2675 2671 argbuff=owl_malloc(strlen(longuser)+1000); 2676 sprintf(argbuff, "( type ^zephyr$ and filter personaland ");2672 sprintf(argbuff, "( type ^zephyr$ and ( class ^message$ and instance ^personal$ and "); 2677 2673 sprintf(argbuff, "%s ( ( direction ^in$ and sender ^%s$ ) or ( direction ^out$ and recipient ^%s$ ) ) )", argbuff, longuser, longuser); 2678 sprintf(argbuff, "%s or ( ( class ^login$ ) and ( sender ^%s$ ) ) ", argbuff, longuser);2674 sprintf(argbuff, "%s or ( ( class ^login$ ) and ( sender ^%s$ ) ) )", argbuff, longuser); 2679 2675 2680 2676 owl_filter_init_fromstring(f, filtname, argbuff); … … 2804 2800 owl_message *m; 2805 2801 char *zperson, *filtname=NULL; 2806 char *argv[1];2807 2802 2808 2803 v=owl_global_get_current_view(&g); … … 2836 2831 /* narrow personal and login messages to the sender or recip as appropriate */ 2837 2832 if (owl_message_is_type_zephyr(m)) { 2838 if (owl_message_is_p ersonal(m) || owl_message_is_loginout(m)) {2833 if (owl_message_is_private(m) || owl_message_is_loginout(m)) { 2839 2834 if (owl_message_is_direction_in(m)) { 2840 2835 zperson=short_zuser(owl_message_get_sender(m)); … … 2863 2858 2864 2859 /* pass it off to perl */ 2860 char *argv[1]; 2865 2861 if(type) { 2866 2862 argv[0] = "-i"; … … 3020 3016 void owl_function_zpunt(char *class, char *inst, char *recip, int direction) 3021 3017 { 3018 owl_filter *f; 3019 owl_list *fl; 3022 3020 char *buff; 3023 3021 char *quoted; 3024 3022 int ret, i, j; 3023 3024 fl=owl_global_get_puntlist(&g); 3025 3026 /* first, create the filter */ 3027 f=owl_malloc(sizeof(owl_filter)); 3025 3028 buff=owl_malloc(strlen(class)+strlen(inst)+strlen(recip)+100); 3026 3029 strcpy(buff, "class"); … … 3053 3056 owl_free(quoted); 3054 3057 } 3055 3056 owl_function_punt(buff, direction); 3058 3059 owl_function_debugmsg("About to filter %s", buff); 3060 ret=owl_filter_init_fromstring(f, "punt-filter", buff); 3057 3061 owl_free(buff); 3058 }3059 3060 void owl_function_punt(char *filter, int direction)3061 {3062 owl_filter *f;3063 owl_list *fl;3064 int ret, i, j;3065 fl=owl_global_get_puntlist(&g);3066 3067 /* first, create the filter */3068 f=malloc(sizeof(owl_filter));3069 3070 owl_function_debugmsg("About to filter %s", filter);3071 ret=owl_filter_init_fromstring(f, "punt-filter", filter);3072 3062 if (ret) { 3073 3063 owl_function_error("Error creating filter for zpunt"); … … 3080 3070 for (i=0; i<j; i++) { 3081 3071 if (owl_filter_equiv(f, owl_list_get_element(fl, i))) { 3082 owl_function_debugmsg("found an equivalent punt filter");3083 3072 /* if we're punting, then just silently bow out on this duplicate */ 3084 3073 if (direction==0) { … … 3091 3080 owl_filter_free(owl_list_get_element(fl, i)); 3092 3081 owl_list_remove_element(fl, i); 3093 owl_filter_free(f);3094 3082 return; 3095 3083 } … … 3097 3085 } 3098 3086 3099 owl_function_debugmsg("punting");3100 3087 /* If we're punting, add the filter to the global punt list */ 3101 3088 if (direction==0) { … … 3474 3461 char *filename; 3475 3462 3476 filename=owl_ global_get_startupfile(&g);3463 filename=owl_sprintf("%s/%s", owl_global_get_homedir(&g), OWL_STARTUP_FILE); 3477 3464 file=fopen(filename, "a"); 3478 3465 if (!file) { 3479 3466 owl_function_error("Error opening startupfile for new command"); 3467 owl_free(filename); 3480 3468 return; 3481 3469 } … … 3483 3471 /* delete earlier copies */ 3484 3472 owl_util_file_deleteline(filename, buff, 1); 3473 owl_free(filename); 3485 3474 3486 3475 /* add this line */ … … 3494 3483 { 3495 3484 char *filename; 3496 filename=owl_ global_get_startupfile(&g);3485 filename=owl_sprintf("%s/%s", owl_global_get_homedir(&g), OWL_STARTUP_FILE); 3497 3486 owl_util_file_deleteline(filename, buff, 1); 3487 owl_free(filename); 3498 3488 } 3499 3489 … … 3507 3497 3508 3498 if (!filename) { 3509 filename=owl_ global_get_startupfile(&g);3499 filename=owl_sprintf("%s/%s", owl_global_get_homedir(&g), OWL_STARTUP_FILE); 3510 3500 file=fopen(filename, "r"); 3501 owl_free(filename); 3511 3502 } else { 3512 3503 file=fopen(filename, "r"); -
global.c
r34509d5 r34509d5 18 18 struct hostent *hent; 19 19 char hostname[MAXHOSTNAMELEN]; 20 char *cd;21 20 22 21 g->malloced=0; … … 87 86 g->homedir=owl_strdup(getenv("HOME")); 88 87 89 g->confdir = NULL;90 g->startupfile = NULL;91 cd = owl_sprintf("%s/%s", g->homedir, OWL_CONFIG_DIR);92 owl_global_set_confdir(g, cd);93 owl_free(cd);94 95 88 owl_messagelist_create(&(g->msglist)); 96 89 owl_mainwin_init(&(g->mw)); … … 326 319 } 327 320 328 char *owl_global_get_confdir(owl_global *g) {329 if (g->confdir) return(g->confdir);330 return("/");331 }332 333 /*334 * Setting this also sets startupfile to confdir/startup335 */336 void owl_global_set_confdir(owl_global *g, char *cd) {337 free(g->confdir);338 g->confdir = owl_strdup(cd);339 free(g->startupfile);340 g->startupfile = owl_sprintf("%s/startup", cd);341 }342 343 char *owl_global_get_startupfile(owl_global *g) {344 if(g->startupfile) return(g->startupfile);345 return("/");346 }347 348 321 int owl_global_get_direction(owl_global *g) { 349 322 return(g->direction); -
keys.c
r8938188 r51c57f8 180 180 BIND_CMD("M-<", "popless:scroll-to-top", ""); 181 181 182 BIND_CMD("END", "popless:scroll-to-bottom", "");183 182 BIND_CMD(">", "popless:scroll-to-bottom", ""); 184 183 BIND_CMD("M->", "popless:scroll-to-bottom", ""); -
message.c
r34509d5 r34509d5 27 27 owl_fmtext_cache * owl_message_next_fmtext() /*noproto*/ 28 28 { 29 owl_fmtext_cache * f = fmtext_cache_next;30 29 if(fmtext_cache_next->message != NULL) { 31 30 owl_message_invalidate_format(fmtext_cache_next->message); 32 31 } 32 owl_fmtext_cache * f = fmtext_cache_next; 33 33 fmtext_cache_next++; 34 34 if(fmtext_cache_next - fmtext_cache == OWL_FMTEXT_CACHE_SIZE) … … 121 121 p=owl_list_get_element(&(m->attributes), i); 122 122 buff=owl_sprintf(" %-15.15s: %-35.35s\n", owl_pair_get_key(p), owl_pair_get_value(p)); 123 if(buff == NULL) {124 buff=owl_sprintf(" %-15.15s: %-35.35s\n", owl_pair_get_key(p), "<error>");125 if(buff == NULL)126 buff=owl_strdup(" <error>\n");127 }128 123 owl_fmtext_append_normal(fm, buff); 129 124 owl_free(buff); … … 422 417 char *owl_message_get_text(owl_message *m) 423 418 { 424 owl_message_format(m);425 419 return(owl_fmtext_get_text(&(m->fmtext->fmtext))); 426 420 } … … 572 566 573 567 int owl_message_is_answered(owl_message *m) { 574 char *q;575 568 if(!owl_message_is_question(m)) return 0; 576 q = owl_message_get_attribute_value(m, "question");569 char * q = owl_message_get_attribute_value(m, "question"); 577 570 if(!q) return 0; 578 571 return !strcmp(q, "answered"); … … 820 813 struct hostent *hent; 821 814 char *ptr, *tmp, *tmp2; 822 int len;823 815 824 816 owl_message_init(m); … … 849 841 owl_message_set_opcode(m, ""); 850 842 } 851 owl_message_set_zsig(m, owl_zephyr_get_zsig(n, &len));843 owl_message_set_zsig(m, n->z_message); 852 844 853 845 if ((ptr=strchr(n->z_recipient, '@'))!=NULL) { -
obarray.c
r535d68b rdb90f03 80 80 owl_obarray_init(&oa); 81 81 82 printf(" #BEGIN testing owl_obarray\n");82 printf("BEGIN testing owl_obarray\n"); 83 83 84 84 p = owl_obarray_insert(&oa, "test"); … … 96 96 FAIL_UNLESS("Didn't find a string that isn't there", p == NULL); 97 97 98 printf(" #END testing owl_obarray (%d failures)\n", numfailed);98 printf("END testing owl_obarray (%d failures)\n", numfailed); 99 99 100 100 return numfailed; -
owl.c
r34509d5 r34509d5 65 65 owl_global g; 66 66 67 char * owl_get_datadir() {68 char * datadir = getenv("BARNOWL_DATA_DIR");69 if(datadir != NULL)70 return strchr(datadir, '=') + 1;71 return DATADIR;72 }73 74 67 int main(int argc, char **argv, char **env) 75 68 { … … 81 74 struct sigaction sigact; 82 75 char *configfile, *tty, *perlout, *perlerr, **argvsave, buff[LINE], startupmsg[LINE]; 83 char *confdir;84 76 owl_filter *f; 85 77 owl_style *s; … … 96 88 argvsave=argv; 97 89 configfile=NULL; 98 confdir = NULL;99 90 tty=NULL; 100 91 debug=0; … … 114 105 } else if (!strcmp(argv[0], "-c")) { 115 106 if (argc<2) { 116 117 118 107 fprintf(stderr, "Too few arguments to -c\n"); 108 usage(); 109 exit(1); 119 110 } 120 111 configfile=argv[1]; … … 123 114 } else if (!strcmp(argv[0], "-t")) { 124 115 if (argc<2) { 125 126 127 116 fprintf(stderr, "Too few arguments to -t\n"); 117 usage(); 118 exit(1); 128 119 } 129 120 tty=argv[1]; 130 argv+=2;131 argc-=2;132 } else if (!strcmp(argv[0], "-s")){133 if (argc<2) {134 fprintf(stderr, "Too few arguments to -s\n");135 usage();136 exit(1);137 }138 confdir = argv[1];139 121 argv+=2; 140 122 argc-=2; … … 149 131 argc--; 150 132 } else if (!strcmp(argv[0], "-v")) { 151 printf("This is barnowl version %s\n", OWL_VERSION_STRING);133 printf("This is owl version %s\n", OWL_VERSION_STRING); 152 134 exit(0); 153 135 } else { … … 181 163 /* screen init */ 182 164 if (!getenv("TERMINFO")) { 183 owl_function_debugmsg("startup: Not setting TERMINFO"); 165 sprintf(buff, "TERMINFO=%s", TERMINFO); 166 putenv(buff); 167 owl_function_debugmsg("startup: setting TERMINFO to %s", TERMINFO); 184 168 } else { 185 169 owl_function_debugmsg("startup: leaving TERMINFO as %s from envrionment", getenv("TERMINFO")); … … 211 195 /* owl global init */ 212 196 owl_global_init(&g); 213 if (debug) owl_global_set_debug_on(&g); 214 if (confdir) owl_global_set_confdir(&g, confdir); 197 if (debug) owl_global_set_debug_on(&g); 215 198 owl_function_debugmsg("startup: first available debugging message"); 216 199 owl_global_set_startupargs(&g, argcsave, argvsave); … … 234 217 /* create the owl directory, in case it does not exist */ 235 218 owl_function_debugmsg("startup: creating owl directory, if not present"); 236 dir=owl_ global_get_confdir(&g);219 dir=owl_sprintf("%s/%s", owl_global_get_homedir(&g), OWL_CONFIG_DIR); 237 220 mkdir(dir, S_IRWXU); 221 owl_free(dir); 238 222 239 223 /* set the tty, either from the command line, or by figuring it out */ … … 279 263 owl_function_debugmsg("startup: creating default filters"); 280 264 f=owl_malloc(sizeof(owl_filter)); 281 owl_filter_init_fromstring(f, "personal", "isprivate ^true$ and ( not type ^zephyr$" 282 " or ( class ^message and" 283 " ( instance ^personal$ or instance ^urgent$ ) ) )"); 265 owl_filter_init_fromstring(f, "personal", "isprivate ^true$"); 284 266 owl_list_append_element(owl_global_get_filterlist(&g), f); 285 267 … … 551 533 j=wgetch(typwin); 552 534 if (j==ERR) { 553 usleep(10 000);535 usleep(10); 554 536 } else { 555 537 owl_global_update_lastinputtime(&g); … … 718 700 void usage() 719 701 { 720 fprintf(stderr, " Barnowl version %s\n", OWL_VERSION_STRING);721 fprintf(stderr, "Usage: barnowl [-n] [-d] [-D] [-v] [-h] [-c <configfile>] [-s <confdir>] [-t <ttyname>]\n");702 fprintf(stderr, "Owl version %s\n", OWL_VERSION_STRING); 703 fprintf(stderr, "Usage: owl [-n] [-d] [-D] [-v] [-h] [-c <configfile>] [-t <ttyname>]\n"); 722 704 fprintf(stderr, " -n don't load zephyr subscriptions\n"); 723 705 fprintf(stderr, " -d enable debugging\n"); 724 706 fprintf(stderr, " -D enable debugging and delete previous debug file\n"); 725 fprintf(stderr, " -v print the Barnowl version number and exit\n");707 fprintf(stderr, " -v print the Owl version number and exit\n"); 726 708 fprintf(stderr, " -h print this help message\n"); 727 709 fprintf(stderr, " -c specify an alternate config file\n"); 728 fprintf(stderr, " -s specify an alternate config dir (default ~/.owl)\n");729 710 fprintf(stderr, " -t set the tty name\n"); 730 711 } -
owl.h
r34509d5 r34509d5 64 64 #ifdef OWL_PERL 65 65 typedef void WINDOW; 66 /* logout is defined in FreeBSD. */67 #define logout logout_68 66 #include <perl.h> 69 #undef logout70 67 #include "XSUB.h" 71 68 #else … … 563 560 char *thishost; 564 561 char *homedir; 565 char *confdir;566 char *startupfile;567 562 int direction; 568 563 int zaway; -
perl/lib/BarnOwl/ModuleLoader.pm
rbe98ba5 r9de39410 6 6 use lib (BarnOwl::get_data_dir() . "/modules/"); 7 7 use PAR (BarnOwl::get_data_dir() . "/modules/*.par"); 8 use PAR ( BarnOwl::get_config_dir() . "/modules/*.par");8 use PAR ($ENV{HOME} . "/.owl/modules/*.par"); 9 9 10 10 sub load_all { 11 11 my %modules; 12 12 my @modules; 13 14 my @moddirs = ();15 push @moddirs, BarnOwl::get_data_dir() . "/modules";16 push @moddirs, BarnOwl::get_config_dir() . "/modules";17 13 18 for my $dir (@moddirs) { 14 for my $dir ( BarnOwl::get_data_dir() . "/modules", 15 $ENV{HOME} . "/.owl/modules" ) { 19 16 opendir(my $dh, $dir) or next; 20 17 while(defined(my $f = readdir($dh))) { -
perl/modules/Jabber/lib/BarnOwl/Module/Jabber.pm
r892568b rf032974 581 581 or die("Usage: jmuc join MUC [-p password] [-a account]"); 582 582 583 die("Error: Must specify a fully-qualified MUC name (e.g. barnowl\@conference.mit.edu)\n")584 unless $muc =~ /@/;585 583 $muc = Net::Jabber::JID->new($muc); 586 584 $jid = Net::Jabber::JID->new($jid); … … 588 586 589 587 $conn->getConnectionFromJID($jid)->MUCJoin(JID => $muc, 590 Password => $password,591 History => {592 MaxChars => 0593 });588 Password => $password, 589 History => { 590 MaxChars => 0 591 }); 594 592 return; 595 593 } … … 601 599 die("Usage: jmuc part MUC [-a account]") unless $muc; 602 600 603 if($conn->getConnectionFromJID($jid)->MUCLeave(JID => $muc)) { 604 queue_admin_msg("$jid has left $muc."); 605 } else { 606 die("Error: Not joined to $muc"); 607 } 601 $conn->getConnectionFromJID($jid)->MUCLeave(JID => $muc); 602 queue_admin_msg("$jid has left $muc."); 608 603 } 609 604 … … 644 639 my $m = shift; 645 640 my @jids = $m->Presence(); 646 647 my $presence = "JIDs present in " . $m->BaseJID; 648 if($m->Anonymous) { 649 $presence .= " [anonymous MUC]"; 650 } 651 $presence .= "\n\t"; 652 $presence .= join("\n\t", map {pp_jid($m, $_);} @jids) . "\n"; 653 return $presence; 654 } 655 656 sub pp_jid { 657 my ($m, $jid) = @_; 658 my $nick = $jid->GetResource; 659 my $full = $m->GetFullJID($jid); 660 if($full && $full ne $nick) { 661 return "$nick ($full)"; 662 } else { 663 return "$nick"; 664 } 641 return "JIDs present in " . $m->BaseJID . "\n\t" 642 . join("\n\t", map {$_->GetResource}@jids) . "\n"; 665 643 } 666 644 … … 926 904 sid => $sid } ); 927 905 $jhash{type} = 'admin'; 928 929 906 BarnOwl::queue_message( BarnOwl::Message->new(%jhash) ); 930 907 } … … 1157 1134 } 1158 1135 elsif ( $jtype eq 'normal' ) { 1159 $props{replycmd} = "";1136 $props{replycmd} = undef; 1160 1137 $props{private} = 1; 1161 1138 } 1162 1139 elsif ( $jtype eq 'headline' ) { 1163 $props{replycmd} = "";1140 $props{replycmd} = undef; 1164 1141 } 1165 1142 elsif ( $jtype eq 'error' ) { 1166 $props{replycmd} = "";1143 $props{replycmd} = undef; 1167 1144 $props{body} = "Error " 1168 1145 . $props{error_code} -
perl/modules/Jabber/lib/BarnOwl/Module/Jabber/Connection.pm
r892568b r3c455b4 52 52 Leave a MUC. The MUC is specified in the same form as L</FindMUC> 53 53 54 Returns true if successful, false if this connection was not in the55 named MUC.56 57 54 =cut 58 55 … … 64 61 $muc->Leave(); 65 62 $self->{_BARNOWL_MUCS} = [grep {$_->BaseJID ne $muc->BaseJID} $self->MUCs]; 66 return 1;67 63 } 68 64 -
perl/modules/Jabber/lib/Net/Jabber/MUC.pm
r892568b rc2bed55 64 64 $self->{JID} = $args{jid}; 65 65 $self->{PRESENCE} = { }; 66 $self->{ANONYMOUS} = 1;67 66 68 67 bless($self, $class); … … 189 188 delete $self->{PRESENCE}->{$from->GetJID('full')}; 190 189 } elsif($type eq 'available') { 191 $self->{PRESENCE}->{$from->GetJID('full')} = {ROOMNICK => $from}; 192 my $x = $presence->GetX('http://jabber.org/protocol/muc#user'); 193 if($x && $x->DefinedItem()) { 194 my $item = $x->GetItem(); 195 if($item->DefinedJID()) { 196 $self->{PRESENCE}->{$from->GetJID('full')}->{FULLJID} = $item->GetJID(); 197 $self->{ANONYMOUS} = 0; 198 } 199 } 190 $self->{PRESENCE}->{$from->GetJID('full')} = $from; 200 191 } 201 192 } … … 216 207 } 217 208 218 =head2 GetFullJID roomjid219 220 Given the roomnick of a user in the MUC, return their full NIC if the221 MUC makes it available. If the MUC is anonymous or the user does not222 exist in the MUC, return undef.223 224 =cut225 226 sub GetFullJID {227 my $self = shift;228 my $jid = shift;229 230 $jid = $jid->GetJID('full') if UNIVERSAL::isa($jid, 'Net::Jabber::JID');231 my $pres = $self->{PRESENCE}->{$jid};232 return unless $pres;233 return $pres->{FULLJID};234 }235 236 209 =head2 Presence 237 210 … … 242 215 sub Presence { 243 216 my $self = shift; 244 return map {$_->{ROOMNICK}} values %{$self->{PRESENCE}}; 245 } 246 247 =head2 Anonymous 248 249 Returns true if the MUC is anonymous (hides participants real JIDs) 250 251 =cut 252 253 sub Anonymous { 254 my $self = shift; 255 return $self->{ANONYMOUS}; 217 return values %{$self->{PRESENCE}}; 256 218 } 257 219 -
perl/modules/Jabber/lib/XML/Stream.pm
r5073972 rc2bed55 1161 1161 } 1162 1162 1163 # 08.04.05(Fri) slipstream@yandex.ru for compapility with ejabberd since it reuses stream id 1164 delete($self->{SIDS}->{$currsid}) unless ($currsid eq $sid); 1163 delete($self->{SIDS}->{$currsid}); 1165 1164 1166 1165 if (exists($self->GetRoot($sid)->{version}) && -
perlconfig.c
rad15610 rf6b319c 137 137 char *key,*val; 138 138 HV * hash; 139 struct tm tm;140 139 141 140 hash = (HV*)SvRV(msg); … … 163 162 } else if (!strcmp(key, "time")) { 164 163 m->timestr = owl_strdup(val); 164 struct tm tm; 165 165 strptime(val, "%a %b %d %T %Y", &tm); 166 166 m->time = mktime(&tm); … … 445 445 int i, count; 446 446 char * ret = NULL; 447 SV *rv;448 447 STRLEN n_a; 449 448 dSP; … … 468 467 if(count != 1) 469 468 croak("Perl command %s returned more than one value!", cmd->name); 470 rv = POPs;469 SV * rv = POPs; 471 470 if(SvTRUE(rv)) { 472 471 ret = owl_strdup(SvPV(rv, n_a)); … … 489 488 SV *cb = (SV*)(e->cbdata); 490 489 unsigned int n_a; 491 dSP;492 493 490 if(cb == NULL) { 494 491 owl_function_error("Perl callback is NULL!"); 495 492 } 493 494 dSP; 496 495 497 496 ENTER; … … 517 516 void owl_perlconfig_mainloop() 518 517 { 519 dSP;520 518 if (!owl_perlconfig_is_function("BarnOwl::Hooks::_mainloop_hook")) 521 519 return; 520 dSP ; 522 521 PUSHMARK(SP) ; 523 522 call_pv("BarnOwl::Hooks::_mainloop_hook", G_DISCARD|G_EVAL); -
perlglue.xs
rb363d83 r13a3c1db 199 199 get_data_dir () 200 200 CODE: 201 RETVAL = (char *) owl_get_datadir();201 RETVAL = (char *) DATADIR; 202 202 OUTPUT: 203 203 RETVAL 204 205 char *206 get_config_dir ()207 CODE:208 RETVAL = (char *) owl_global_get_confdir(&g);209 OUTPUT:210 RETVAL211 204 212 205 void -
perlwrap.pm
r18fb3d4f r42947f1 21 21 }; 22 22 23 use lib(get_data_dir() . "/lib"); 24 use lib(get_config_dir() . "/lib"); 25 26 # perlconfig.c will set this to the value of the -c command-line 27 # switch, if present. 23 use lib(get_data_dir()."/lib"); 24 use lib($ENV{HOME}."/.owl/lib"); 25 28 26 our $configfile; 29 27 … … 522 520 if ( $m->is_loginout) { 523 521 return format_login($m); 524 } elsif($m->is_ping && $m->is_personal) {522 } elsif($m->is_ping) { 525 523 return ( "\@b(PING) from \@b(" . $m->pretty_sender . ")\n" ); 526 524 } elsif($m->is_admin) { … … 570 568 } 571 569 572 if($m->opcode) {573 $header .= " [" . $m->opcode . "]";574 }575 570 $header .= " " . time_hhmm($m); 576 571 my $sender = $m->long_sender; -
test.h
r1cf3f8d3 r0138478 3 3 4 4 #define FAIL_UNLESS(desc,pred) do { int __pred = (pred); \ 5 printf(" %s %s", (__pred)?"ok":(numfailed++,"not ok"), desc); \5 printf("\t%-4s: %s", (__pred)?"ok":(numfailed++,"FAIL"), desc); \ 6 6 if(!(__pred)) printf("\t(%s:%d)", __FILE__, __LINE__); printf("%c", '\n'); } while(0) 7 7 -
tester.c
r1cf3f8d3 re7dc035 143 143 144 144 145 #define OWL_DICT_NTESTS 20146 #define OWL_UTIL_NTESTS 9147 #define OWL_OBARRAY_NTESTS 5148 #define OWL_VARIABLE_NTESTS 52149 #define OWL_FILTER_NTESTS 23150 151 145 int main(int argc, char **argv, char **env) 152 146 { … … 155 149 156 150 int numfailures=0; 157 if (argc==1 || (argc==2 && 0==strcmp(argv[1],"reg"))) { 158 printf("1..%d\n", OWL_UTIL_NTESTS+OWL_DICT_NTESTS+OWL_VARIABLE_NTESTS 159 +OWL_FILTER_NTESTS+OWL_OBARRAY_NTESTS); 151 if (argc==2 && 0==strcmp(argv[1],"reg")) { 160 152 numfailures += owl_util_regtest(); 161 153 numfailures += owl_dict_regtest(); … … 164 156 numfailures += owl_obarray_regtest(); 165 157 if (numfailures) { 166 fprintf(stderr, " #*** WARNING: %d failures total\n", numfailures);158 fprintf(stderr, "*** WARNING: %d failures total\n", numfailures); 167 159 } 168 160 return(numfailures); -
util.c
r34509d5 r34509d5 759 759 char * owl_util_baseclass(char * class) 760 760 { 761 char *ret; 761 762 char *start, *end; 762 763 … … 768 769 start = owl_strdup(start); 769 770 end = start + strlen(start) - 1; 770 while( end > start &&*end == 'd' && *(end-1) == '.') {771 while(*end == 'd' && *(end-1) == '.') { 771 772 end -= 2; 772 773 } … … 788 789 int numfailed=0; 789 790 790 printf(" #BEGIN testing owl_util\n");791 printf("BEGIN testing owl_util\n"); 791 792 792 793 FAIL_UNLESS("owl_util_substitute 1", … … 811 812 !strcmp("meep foo bar", owl_util_uniq("meep foo", "bar foo meep", "-"))); 812 813 813 //if (numfailed) printf("*** WARNING: failures encountered with owl_util\n");814 printf(" #END testing owl_util (%d failures)\n", numfailed);814 if (numfailed) printf("*** WARNING: failures encountered with owl_util\n"); 815 printf("END testing owl_util (%d failures)\n", numfailed); 815 816 return(numfailed); 816 817 } -
variable.c
rad15610 ra695a68 974 974 int numfailed=0; 975 975 char buf[1024]; 976 owl_variable * v;977 976 978 977 in_regtest = 1; 979 978 980 printf(" #BEGIN testing owl_variable\n");979 printf("BEGIN testing owl_variable\n"); 981 980 FAIL_UNLESS("setup", 0==owl_variable_dict_setup(&vd)); 982 981 … … 1028 1027 FAIL_UNLESS("get enum 10", OWL_WEBBROWSER_NETSCAPE==owl_variable_get_int(&vd,"webbrowser")); 1029 1028 1029 owl_variable * v; 1030 1030 1031 owl_variable_dict_newvar_string(&vd, "stringvar", "", "", "testval"); 1031 1032 FAIL_UNLESS("get new string var", NULL != (v = owl_variable_get(&vd, "stringvar", OWL_VARIABLE_STRING))); … … 1048 1049 owl_variable_dict_free(&vd); 1049 1050 1050 //if (numfailed) printf("*** WARNING: failures encountered with owl_variable\n");1051 printf(" #END testing owl_variable (%d failures)\n", numfailed);1051 if (numfailed) printf("*** WARNING: failures encountered with owl_variable\n"); 1052 printf("END testing owl_variable (%d failures)\n", numfailed); 1052 1053 return(numfailed); 1053 1054 } -
zephyr.c
r50e29e3 r13a3c1db 328 328 char *out; 329 329 330 /* If there's no message here, just run along now */331 if (n->z_message_len == 0)332 return(owl_strdup(""));333 334 330 count=save=0; 335 331 for (i=0; i<n->z_message_len; i++) { … … 366 362 { 367 363 int i, fields; 368 369 if(n->z_message_len == 0)370 return 0;371 364 372 365 fields=1; -
zwrite.c
r34509d5 r34509d5 125 125 } 126 126 127 if (z->class == NULL &&128 z->inst == NULL &&129 owl_list_get_size(&(z->recips))==0) {130 owl_function_error("You must specify a recipient for zwrite");131 return(-1);132 }133 134 127 /* now deal with defaults */ 135 128 if (z->class==NULL) z->class=owl_strdup("message"); … … 139 132 /* z->message is allowed to stay NULL */ 140 133 134 if (!strcasecmp(z->class, "message") && 135 !strcasecmp(z->inst, "personal") && 136 owl_list_get_size(&(z->recips))==0) { 137 owl_function_error("You must specify a recipient for zwrite"); 138 return(-1); 139 } 140 141 141 /* get a zsig, if not given */ 142 142 if (z->zsig==NULL) {
Note: See TracChangeset
for help on using the changeset viewer.