Changes in / [f0d5ef5:12505e3]


Ignore:
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • barnowl

    rde18326 rb14f8cb  
    77EXE="$0.bin"
    88
    9 if ! test -x "$EXE"; then
     9if test ! -x "$EXE"; then
    1010    echo "Cannot find barnowl.bin" >&2
    1111    exit 1
    1212fi
    1313
    14 export BARNOWL_DATA_DIR="$SRCDIR/perl/"
    15 export BARNOWL_BIN_DIR="$SRCDIR/"
     14BARNOWL_DATA_DIR="$SRCDIR/perl/"
     15BARNOWL_BIN_DIR="$SRCDIR/"
     16export BARNOWL_DATA_DIR
     17export BARNOWL_BIN_DIR
    1618exec "$EXE" "$@"
  • cmd.c

    r4c7c21f raad166a  
    55#include "owl.h"
    66
    7 extern const owl_cmd commands_to_init[];
    8 
    97/**************************************************************************/
    108/***************************** COMMAND DICT *******************************/
     
    1311int owl_cmddict_setup(owl_cmddict *cd) {
    1412  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);
    1714}
    1815
  • commands.c

    rb9d22f7 r117c21c  
    88/* fn is "char *foo(int argc, const char *const *argv, const char *buff)" */
    99#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, \
    1111          NULL, fn, NULL, NULL, NULL, NULL, NULL, NULL }
    1212
    1313/* fn is "void foo(void)" */
    1414#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, \
    1616          NULL, NULL, fn, NULL, NULL, NULL, NULL, NULL }
    1717
    1818/* fn is "void foo(int)" */
    1919#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, \
    2121          NULL, NULL, NULL, fn, NULL, NULL, NULL, NULL }
    2222
    2323#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 }
    2626
    2727/* fn is "char *foo(void *ctx, int argc, const char *const *argv, const char *buff)" */
    2828#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, \
    3030          NULL, NULL, NULL, NULL, ((char*(*)(void*,int,const char*const *,const char*))fn), NULL, NULL, NULL }
    3131
    3232/* fn is "void foo(void)" */
    3333#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, \
    3535          NULL, NULL, NULL, NULL, NULL, ((void(*)(void*))(fn)), NULL, NULL }
    3636
    3737/* fn is "void foo(int)" */
    3838#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, \
    4040          NULL, NULL, NULL, NULL, NULL, NULL, ((void(*)(void*,int))fn), NULL }
    4141
    4242
    43 const owl_cmd commands_to_init[]
    44   = {
     43int owl_cmd_add_defaults(owl_cmddict *cd)
     44{
     45  owl_cmd commands_to_init[] = {
     46
    4547  OWLCMD_ARGS("zlog", owl_command_zlog, OWL_CTX_ANY,
    4648              "send a login or logout notification",
     
    10361038  { NULL, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL }
    10371039
    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}
    10391048
    10401049void owl_command_info(void)
  • configure.ac

    rdb4f7c3 r9d43dcc  
    88
    99AC_PROG_CC
     10AC_PROG_CC_C99
    1011
    1112AC_ARG_WITH([stack-protector],
     
    8081AC_HEADER_STDC
    8182AC_HEADER_SYS_WAIT
    82 AC_HEADER_STDBOOL
    83 AC_CHECK_HEADERS(strings.h sys/ioctl.h sys/filio.h unistd.h)
     83AC_CHECK_HEADERS(stdbool.h strings.h sys/ioctl.h sys/filio.h unistd.h)
    8484
    8585dnl Add CFLAGS for embeded perl
     
    130130AX_CFLAGS_WARN_ALL([AM_CFLAGS])
    131131AX_C_CHECK_FLAG([-Wstrict-prototypes],[],[],[AM_CFLAGS="$AM_CFLAGS -Wstrict-prototypes"])
     132AX_C_CHECK_FLAG([-Wwrite-strings],[],[],[AM_CFLAGS="$AM_CFLAGS -Wwrite-strings"])
    132133
    133134dnl Shut gcc up about zero-length format strings; the warning's apparently for
     
    143144                                 test "$HAVE_DES_ECB_ENCRYPT"])
    144145
    145 AM_CFLAGS="$AM_CFLAGS -D_XOPEN_SOURCE=500"
     146AM_CFLAGS="$AM_CFLAGS -D_XOPEN_SOURCE=600"
    146147dnl Define _BSD_SOURCE because zephyr needs caddr_t.
    147148AM_CFLAGS="$AM_CFLAGS -D_BSD_SOURCE"
  • libfaim/aim.h

    r63de71c rfe73d0c  
    1818
    1919#include "config.h"
    20 #ifdef HAVE_STDBOOL_H
    2120#include <stdbool.h>
    22 #else
    23 #ifndef HAVE__BOOL
    24 #define _Bool signed char
    25 #endif
    26 #define bool _Bool
    27 #define false 0
    28 #define true 1
    29 #define __bool_true_false_are_defined 1
    30 #endif  /* HAVE_STDBOOL_H */
    3121
    3222#include <stdio.h>
  • owl.h

    rc5c5686 rc5c5686  
    1414#include "compat/compat.h"
    1515
    16 #ifdef HAVE_STDBOOL_H
    1716#include <stdbool.h>
    18 #else
    19 #ifndef HAVE__BOOL
    20 #define _Bool signed char
    21 #endif
    22 #define bool _Bool
    23 #define false 0
    24 #define true 1
    25 #define __bool_true_false_are_defined 1
    26 #endif  /* HAVE_STDBOOL_H */
    2717
    2818#ifndef OWL_PERL
     19#define NCURSES_ENABLE_STDBOOL_H 1
    2920#include <curses.h>
    3021#include <panel.h>
     
    238229  void *pval_default;  /* for types other and string */
    239230  int   ival_default;  /* for types int and bool     */
    240   char *validsettings;          /* documentation of valid settings */
     231  const char *validsettings;    /* documentation of valid settings */
    241232  char *summary;                /* summary of usage */
    242233  char *description;            /* detailed description */
  • perlconfig.c

    rf21bc36 rf21bc36  
    215215      owl_message_set_zwriteline(m, val);
    216216    } else if (!strcmp(key, "time")) {
     217      g_free(m->timestr);
    217218      m->timestr = g_strdup(val);
    218219      strptime(val, "%a %b %d %T %Y", &tm);
     
    492493  PUTBACK;
    493494
    494   call_pv("BarnOwl::Hooks::_new_command", G_SCALAR|G_VOID|G_EVAL);
     495  call_pv("BarnOwl::Hooks::_new_command", G_VOID|G_EVAL);
    495496
    496497  SPAGAIN;
  • scripts/locker-build

    r0fd5bd5 r4f5e38f  
    102102    esac
    103103
    104     CFLAGS="-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" \
    106106        ./configure --exec-prefix="/mit/barnowl/arch/$ATHENA_SYS" \
    107107        --prefix="/mit/barnowl/builds/barnowl-$VERS" --mandir=/mit/barnowl/man \
  • select.c

    rf0d5ef5 rf0d5ef5  
    1717  if (loop) {
    1818    g_main_loop_quit(loop);
     19    g_main_loop_unref(loop);
    1920    loop = NULL;
    2021  }
  • tester.c

    r4c7c21f r4e37d56  
    3232  char *perlerr;
    3333  int status = 0;
     34  SCREEN *screen;
    3435
    3536  if (argc <= 1) {
     
    4142  wnull = fopen("/dev/null", "w");
    4243  rnull = fopen("/dev/null", "r");
    43   newterm("xterm", wnull, rnull);
     44  screen = newterm("xterm", wnull, rnull);
    4445  /* initialize global structures */
    4546  owl_global_init(&g);
     
    9192  /* probably not necessary, but tear down the screen */
    9293  endwin();
     94  delscreen(screen);
    9395  fclose(rnull);
    9496  fclose(wnull);
     
    218220  owl_string_appendf_quoted(g, "%q foo %q%q %s %", "hello", "world is", "can't");
    219221  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);
    222224
    223225  /* if (numfailed) printf("*** WARNING: failures encountered with owl_util\n"); */
     
    230232  owl_list l;
    231233  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");
    233236
    234237  printf("# BEGIN testing owl_dict\n");
     
    259262  owl_list_cleanup(&l, g_free);
    260263  owl_dict_cleanup(&d, NULL);
     264
     265  g_free(av);
     266  g_free(bv);
     267  g_free(cv);
     268  g_free(dv);
    261269
    262270  /*  if (numfailed) printf("*** WARNING: failures encountered with owl_dict\n"); */
  • variable.c

    r89fe67e r9efc154  
    77
    88#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, \
    1010        NULL, NULL, NULL, NULL, NULL, NULL }
    1111
    1212#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, \
    1414        validate, set, NULL, get, NULL, NULL }
    1515
    1616#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, \
    1818        NULL, NULL, NULL, NULL, NULL, NULL }
    1919
    2020#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, \
    2222        validate, set, NULL, get, NULL, NULL }
    2323
    2424#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, \
    2626        NULL, NULL, NULL, NULL, NULL, NULL }
    2727
    2828#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, \
    3030        NULL, NULL, NULL, NULL, NULL, NULL }
    3131
    3232#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, \
    3434        validate, set, NULL, get, NULL, NULL }
    3535
     
    3838 * correspond to the values that may be specified. */
    3939#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, \
    4141        owl_variable_enum_validate, \
    4242        NULL, owl_variable_enum_set_fromstring, \
     
    4545
    4646#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, \
    4848        validate, \
    4949        set, owl_variable_enum_set_fromstring, \
     
    5151        NULL }
    5252
    53 static owl_variable variables_to_init[] = {
     53int owl_variable_add_defaults(owl_vardict *vd)
     54{
     55  owl_variable variables_to_init[] = {
    5456
    5557  OWLVAR_STRING( "personalbell" /* %OwlVarStub */, "off",
     
    439441    NULL, NULL, NULL, NULL, NULL, NULL }
    440442
    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}
    442451
    443452/**************************************************************************/
     
    557566
    558567int owl_variable_dict_setup(owl_vardict *vd) {
     568  owl_dict_create(vd);
     569  return owl_variable_add_defaults(vd);
     570}
     571
     572int owl_variable_dict_add_from_list(owl_vardict *vd, owl_variable *variables_to_init)
     573{
    559574  owl_variable *var, *cur;
    560   owl_dict_create(vd);
    561575  for (var = variables_to_init; var->name != NULL; var++) {
    562576    cur = g_new(owl_variable, 1);
     
    583597      if (!cur->delete_fn)
    584598        cur->delete_fn = owl_variable_delete_default;
     599      cur->pval_default = g_strdup(var->pval_default);
    585600      cur->set_fn(cur, cur->pval_default);
    586601      break;
     
    717732}
    718733
    719 void owl_variable_delete(owl_variable *v)
     734void owl_variable_cleanup(owl_variable *v)
    720735{
    721736  if (v->delete_fn) v->delete_fn(v);
     
    723738  g_free(v->summary);
    724739  g_free(v->description);
     740  if (v->type == OWL_VARIABLE_STRING)
     741    g_free(v->pval_default);
     742}
     743
     744void owl_variable_delete(owl_variable *v)
     745{
     746  owl_variable_cleanup(v);
    725747  g_free(v);
    726748}
  • window.h

    r4cc49bc rfe73d0c  
    55#include <glib-object.h>
    66
    7 #ifdef HAVE_STDBOOL_H
    87#include <stdbool.h>
    9 #else
    10 #ifndef HAVE__BOOL
    11 #define _Bool signed char
    12 #endif
    13 #define bool _Bool
    14 #define false 0
    15 #define true 1
    16 #define __bool_true_false_are_defined 1
    17 #endif  /* HAVE_STDBOOL_H */
    188
    199G_BEGIN_DECLS
  • zcrypt.c

    r3b8a563 r5b197f7  
    1111#include <unistd.h>
    1212#include <sys/types.h>
    13 #include <zephyr/zephyr.h>
    1413#include <glib.h>
    1514#include <string.h>
Note: See TracChangeset for help on using the changeset viewer.