/[svn]/hopm/branches/1.1.x/src/config-parser.y
ViewVC logotype

Diff of /hopm/branches/1.1.x/src/config-parser.y

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

revision 8580 by michael, Sun Oct 14 15:15:05 2018 UTC revision 8581 by michael, Sun Oct 14 16:58:58 2018 UTC
# Line 268  irc_password: PASSWORD '=' STRING ';' Line 268  irc_password: PASSWORD '=' STRING ';'
268    
269  irc_perform: PERFORM '=' STRING ';'  irc_perform: PERFORM '=' STRING ';'
270  {  {
271    node_t *node;    list_add(xstrdup($3), node_create(), &IRCItem.performs);
   
   node = node_create(xstrdup($3));  
   list_add(&IRCItem.performs, node);  
272  };  };
273    
274  irc_notice: NOTICE '=' STRING ';'  irc_notice: NOTICE '=' STRING ';'
275  {  {
276    node_t *node;    list_add(xstrdup($3), node_create(), &IRCItem.notices);
   
   node = node_create(xstrdup($3));  
   list_add(&IRCItem.notices, node);  
277  };  };
278    
279  irc_port: PORT '=' NUMBER ';'  irc_port: PORT '=' NUMBER ';'
# Line 331  irc_connregex: CONNREGEX '=' STRING ';' Line 325  irc_connregex: CONNREGEX '=' STRING ';'
325  /************************** CHANNEL BLOCK *************************/  /************************** CHANNEL BLOCK *************************/
326  channel_entry:  channel_entry:
327  {  {
   node_t *node;  
328    struct ChannelConf *item;    struct ChannelConf *item;
329    
330    item = xcalloc(sizeof(*item));    item = xcalloc(sizeof(*item));
# Line 339  channel_entry: Line 332  channel_entry:
332    item->key = xstrdup("");    item->key = xstrdup("");
333    item->invite = xstrdup("");    item->invite = xstrdup("");
334    
335    node = node_create(item);    list_add(item, &item->node, &IRCItem.channels);
   
   list_add(&IRCItem.channels, node);  
336    tmp = item;    tmp = item;
337  }  }
338  CHANNEL '{' channel_items '}' ';';  CHANNEL '{' channel_items '}' ';';
# Line 381  channel_invite: INVITE '=' STRING ';' Line 372  channel_invite: INVITE '=' STRING ';'
372  /*************************** USER BLOCK ***************************/  /*************************** USER BLOCK ***************************/
373  user_entry:  user_entry:
374  {  {
   node_t *node;  
375    struct UserConf *item;    struct UserConf *item;
376    
377    item = xcalloc(sizeof(*item));    item = xcalloc(sizeof(*item));
378    
379    node = node_create(item);    list_add(item, &item->node, &UserItemList);
   
   list_add(&UserItemList, node);  
380    tmp = item;    tmp = item;
381  }  }
382  USER '{' user_items '}' ';' ;  USER '{' user_items '}' ';' ;
# Line 403  user_item: user_mask     | Line 391  user_item: user_mask     |
391  user_mask: MASK '=' STRING ';'  user_mask: MASK '=' STRING ';'
392  {  {
393    struct UserConf *item = tmp;    struct UserConf *item = tmp;
   node_t *node;  
   
   node = node_create(xstrdup($3));  
394    
395    list_add(&item->masks, node);    list_add(xstrdup($3), node_create(), &item->masks);
396  };  };
397    
398  user_scanner: SCANNER '=' STRING ';'  user_scanner: SCANNER '=' STRING ';'
399  {  {
400    struct UserConf *item = tmp;    struct UserConf *item = tmp;
   node_t *node;  
401    
402    node = node_create(xstrdup($3));    list_add(xstrdup($3), node_create(), &item->scanners);
   
   list_add(&item->scanners, node);  
403  };  };
404    
405    
406  /*************************** SCANNER BLOCK ***************************/  /*************************** SCANNER BLOCK ***************************/
407  scanner_entry:  scanner_entry:
408  {  {
   node_t *node;  
409    struct ScannerConf *item, *olditem;    struct ScannerConf *item, *olditem;
410    
411    item = xcalloc(sizeof(*item));    item = xcalloc(sizeof(*item));
# Line 456  scanner_entry: Line 437  scanner_entry:
437      item->target_string_created = 1;      item->target_string_created = 1;
438    }    }
439    
440    node = node_create(item);    list_add(item, &item->node, &ScannerItemList);
   
   list_add(&ScannerItemList, node);  
441    tmp = item;    tmp = item;
442  }  }
443  SCANNER '{' scanner_items '}' ';' ;  SCANNER '{' scanner_items '}' ';' ;
# Line 504  scanner_target_ip: TARGET_IP '=' STRING Line 483  scanner_target_ip: TARGET_IP '=' STRING
483  scanner_target_string: TARGET_STRING '=' STRING ';'  scanner_target_string: TARGET_STRING '=' STRING ';'
484  {  {
485    struct ScannerConf *item = tmp;    struct ScannerConf *item = tmp;
   node_t *node;  
   
   node = node_create(xstrdup($3));  
486    
487    if (item->target_string_created == 0)    if (item->target_string_created == 0)
488      memset(&item->target_string, 0, sizeof(item->target_string));      memset(&item->target_string, 0, sizeof(item->target_string));
489    
490    list_add(&item->target_string, node);    list_add(xstrdup($3), node_create(), &item->target_string);
491  };  };
492    
493  scanner_fd: FD '=' NUMBER ';'  scanner_fd: FD '=' NUMBER ';'
# Line 546  scanner_protocol: PROTOCOL '=' PROTOCOLT Line 522  scanner_protocol: PROTOCOL '=' PROTOCOLT
522  {  {
523    struct ProtocolConf *item;    struct ProtocolConf *item;
524    struct ScannerConf *item2;    struct ScannerConf *item2;
   node_t *node;  
525    
526    item = xcalloc(sizeof(*item));    item = xcalloc(sizeof(*item));
527    item->type = $3;    item->type = $3;
# Line 554  scanner_protocol: PROTOCOL '=' PROTOCOLT Line 529  scanner_protocol: PROTOCOL '=' PROTOCOLT
529    
530    item2 = tmp;    item2 = tmp;
531    
532    node = node_create(item);    list_add(item, node_create(), &item2->protocols);
   list_add(&item2->protocols, node);  
533  };  };
534    
535    
# Line 593  opm_sendmail: SENDMAIL '=' STRING ';' Line 567  opm_sendmail: SENDMAIL '=' STRING ';'
567  /************************** BLACKLIST BLOCK *************************/  /************************** BLACKLIST BLOCK *************************/
568  opm_blacklist_entry:  opm_blacklist_entry:
569  {  {
   node_t *node;  
570    struct BlacklistConf *item;    struct BlacklistConf *item;
571    
572    item = xcalloc(sizeof(*item));    item = xcalloc(sizeof(*item));
# Line 603  opm_blacklist_entry: Line 576  opm_blacklist_entry:
576    item->ban_unknown = 0;    item->ban_unknown = 0;
577    item->type = A_BITMASK;    item->type = A_BITMASK;
578    
579    node = node_create(item);    list_add(item, node_create(), &OpmItem.blacklists);
   list_add(&OpmItem.blacklists, node);  
580    
581    tmp = item;    tmp = item;
582  }  }
# Line 686  blacklist_reply_item: NUMBER '=' STRING Line 658  blacklist_reply_item: NUMBER '=' STRING
658  {  {
659    struct BlacklistReplyConf *item;    struct BlacklistReplyConf *item;
660    struct BlacklistConf *blacklist = tmp;    struct BlacklistConf *blacklist = tmp;
   node_t *node;  
661    
662    item = xcalloc(sizeof(*item));    item = xcalloc(sizeof(*item));
663    item->number = $1;    item->number = $1;
664    item->type = xstrdup($3);    item->type = xstrdup($3);
665    
666    node = node_create(item);    list_add(item, node_create(), &blacklist->reply);
   list_add(&blacklist->reply, node);  
667  };  };
668    
669    
# Line 708  exempt_item: exempt_mask | Line 678  exempt_item: exempt_mask |
678    
679  exempt_mask: MASK '=' STRING ';'  exempt_mask: MASK '=' STRING ';'
680  {  {
681    node_t *node;    list_add(xstrdup($3), node_create(), &ExemptItem.masks);
   node = node_create(xstrdup($3));  
   
   list_add(&ExemptItem.masks, node);  
682  };  };
683    
684  %%  %%

Legend:
Removed from v.8580  
changed lines
  Added in v.8581

svnadmin@ircd-hybrid.org
ViewVC Help
Powered by ViewVC 1.1.28