/[cvs]/eggdrop1.8/src/tclhash.c
ViewVC logotype

Diff of /eggdrop1.8/src/tclhash.c

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.3.2.2 by pseudo, Wed Jan 12 13:54:00 2011 UTC revision 1.3.2.5 by thommey, Sat Jun 16 15:59:49 2012 UTC
# Line 744  static inline int trigger_bind(const cha Line 744  static inline int trigger_bind(const cha
744    if (x == TCL_ERROR) {    if (x == TCL_ERROR) {
745      /* FIXME: we really should be able to log longer errors */      /* FIXME: we really should be able to log longer errors */
746      putlog(LOG_MISC, "*", "Tcl error [%s]: %.*s", proc, 400, tcl_resultstring());      putlog(LOG_MISC, "*", "Tcl error [%s]: %.*s", proc, 400, tcl_resultstring());
747        Tcl_BackgroundError(interp);
748    
749      return BIND_EXECUTED;      return BIND_EXECUTED;
750    }    }
# Line 1181  void check_tcl_cron(struct tm *tm) Line 1182  void check_tcl_cron(struct tm *tm)
1182                   MATCH_CRON | BIND_STACKABLE);                   MATCH_CRON | BIND_STACKABLE);
1183  }  }
1184    
1185  int check_tcl_event(const char *event)  void check_tcl_event(const char *event)
1186    {
1187      Tcl_SetVar(interp, "_event1", (char *) event, 0);
1188      check_tcl_bind(H_event, event, 0, " $_event1",
1189                     MATCH_EXACT | BIND_STACKABLE);
1190    }
1191    
1192    int check_tcl_signal(const char *event)
1193  {  {
1194    int x;    int x;
1195    
1196    Tcl_SetVar(interp, "_event1", (char *) event, 0);    Tcl_SetVar(interp, "_event1", (char *) event, 0);
1197    x = check_tcl_bind(H_event, event, 0, " $_event1",    x = check_tcl_bind(H_event, event, 0, " $_event1",
1198                   MATCH_EXACT | BIND_STACKABLE | BIND_WANTRET);                   MATCH_EXACT | BIND_STACKABLE | BIND_STACKRET);
1199    return (x == BIND_EXEC_LOG);    return (x == BIND_EXEC_LOG);
1200  }  }
1201    
# Line 1309  void add_builtins(tcl_bind_list_t *tl, c Line 1317  void add_builtins(tcl_bind_list_t *tl, c
1317    for (i = 0; cc[i].name; i++) {    for (i = 0; cc[i].name; i++) {
1318      egg_snprintf(p, sizeof p, "*%s:%s", tl->name,      egg_snprintf(p, sizeof p, "*%s:%s", tl->name,
1319                   cc[i].funcname ? cc[i].funcname : cc[i].name);                   cc[i].funcname ? cc[i].funcname : cc[i].name);
1320      l = nmalloc(Tcl_ScanElement(p, &k));      l = nmalloc(Tcl_ScanElement(p, &k) + 1);
1321      Tcl_ConvertElement(p, l, k | TCL_DONT_USE_BRACES);      Tcl_ConvertElement(p, l, k | TCL_DONT_USE_BRACES);
1322      table[0].cdata = (void *) cc[i].func;      table[0].cdata = (void *) cc[i].func;
1323      add_cd_tcl_cmds(table);      add_cd_tcl_cmds(table);
# Line 1327  void rem_builtins(tcl_bind_list_t *table Line 1335  void rem_builtins(tcl_bind_list_t *table
1335    for (i = 0; cc[i].name; i++) {    for (i = 0; cc[i].name; i++) {
1336      egg_snprintf(p, sizeof p, "*%s:%s", table->name,      egg_snprintf(p, sizeof p, "*%s:%s", table->name,
1337                   cc[i].funcname ? cc[i].funcname : cc[i].name);                   cc[i].funcname ? cc[i].funcname : cc[i].name);
1338      l = nmalloc(Tcl_ScanElement(p, &k));      l = nmalloc(Tcl_ScanElement(p, &k) + 1);
1339      Tcl_ConvertElement(p, l, k | TCL_DONT_USE_BRACES);      Tcl_ConvertElement(p, l, k | TCL_DONT_USE_BRACES);
1340      Tcl_DeleteCommand(interp, p);      Tcl_DeleteCommand(interp, p);
1341      unbind_bind_entry(table, cc[i].flags, cc[i].name, l);      unbind_bind_entry(table, cc[i].flags, cc[i].name, l);

Legend:
Removed from v.1.3.2.2  
changed lines
  Added in v.1.3.2.5

webmaster@eggheads.org
ViewVC Help
Powered by ViewVC 1.1.23