Diff for /src/usr.sbin/usbd/usbd.c between versions 1.4 and 1.5

version 1.4, 2003/11/03 19:31:44 version 1.5, 2003/12/30 01:01:48
Line 1 Line 1
/*        $NetBSD: usbd.c,v 1.4 1998/12/09 00:57:19 augustss Exp $        *//*
/*        $FreeBSD: src/usr.sbin/usbd/usbd.c,v 1.10.2.6 2002/12/31 09:05:27 maxim Exp $  */ * $NetBSD: usbd.c,v 1.4 1998/12/09 00:57:19 augustss Exp $
/*        $DragonFly$     */ * $FreeBSD: src/usr.sbin/usbd/usbd.c,v 1.29 2003/10/25 22:03:10 jmg Exp $
  * $DragonFly$
  */
   
 /*  /*
  * Copyright (c) 1998 The NetBSD Foundation, Inc.   * Copyright (c) 1998 The NetBSD Foundation, Inc.
Line 55 Line 57
 #include <ctype.h>  #include <ctype.h>
 #include <signal.h>  #include <signal.h>
 #include <paths.h>  #include <paths.h>
   #include <sys/param.h>
 #include <sys/types.h>  #include <sys/types.h>
 #include <sys/time.h>  
 #include <sys/ioctl.h>  
 #include <sys/errno.h>  #include <sys/errno.h>
   #include <sys/ioctl.h>
   #include <sys/linker.h>
   #include <sys/module.h>
 #include <sys/queue.h>  #include <sys/queue.h>
   #include <sys/time.h>
 #include <sys/wait.h>  #include <sys/wait.h>
 #include <regex.h>  #include <regex.h>
   
Line 162  typedef struct action_match_s { Line 167  typedef struct action_match_s {
 /* the function returns 0 for failure, 1 for all arguments found and 2 for  /* the function returns 0 for failure, 1 for all arguments found and 2 for
  * arguments left over in trail.   * arguments left over in trail.
  */   */
typedef int (*config_field_fn)(action_t *action, char *args,typedef int (*config_field_fn)  __P((action_t *action, char *args,
                                        char **trail);                                        char **trail));
   
 int set_device_field(action_t *action, char *args, char **trail);  int set_device_field(action_t *action, char *args, char **trail);
 int set_vendor_field(action_t *action, char *args, char **trail);  int set_vendor_field(action_t *action, char *args, char **trail);
Line 202  config_field_t config_fields[] = { Line 207  config_field_t config_fields[] = {
   
   
 /* prototypes for some functions */  /* prototypes for some functions */
void print_event(struct usb_event *event);void print_event        __P((struct usb_event *event));
void print_action(action_t *action, int i);void print_action       __P((action_t *action, int i));
void print_actions(void);void print_actions      __P((void));
int  find_action(struct usb_device_info *devinfo,int  find_action        __P((struct usb_device_info *devinfo,
                        action_match_t *action_match);                        action_match_t *action_match));
   
   
 void  void
Line 424  read_configuration(void) Line 429  read_configuration(void)
         char *field;            /* first part, the field name */          char *field;            /* first part, the field name */
         char *args;             /* second part, arguments */          char *args;             /* second part, arguments */
         char *trail;            /* remaining part after parsing, should be '' */          char *trail;            /* remaining part after parsing, should be '' */
        int len;          /* length of current line */        size_t len;          /* length of current line */
         int i,j;                /* loop counters */          int i,j;                /* loop counters */
         action_t *action = NULL;        /* current action */          action_t *action = NULL;        /* current action */
   
Line 909  process_event_queue(int fd) Line 914  process_event_queue(int fd)
                         break;                          break;
                 case USB_EVENT_DRIVER_ATTACH:                  case USB_EVENT_DRIVER_ATTACH:
                         if (verbose)                          if (verbose)
                                printf("USB_EVENT_DRIVER_DETACH\n");                                printf("USB_EVENT_DRIVER_ATTACH\n");
                         break;                          break;
                 case USB_EVENT_DRIVER_DETACH:                  case USB_EVENT_DRIVER_DETACH:
                         if (verbose)                          if (verbose)
Line 927  main(int argc, char **argv) Line 932  main(int argc, char **argv)
 {  {
         int error, i;          int error, i;
         int ch;                 /* getopt option */          int ch;                 /* getopt option */
         extern char *optarg;    /* from getopt */  
         extern int optind;      /* from getopt */  
         int debug = 0;          /* print debugging output */          int debug = 0;          /* print debugging output */
         int explore_once = 0;   /* don't do only explore */          int explore_once = 0;   /* don't do only explore */
         int handle_events = 1;  /* do handle the event queue */          int handle_events = 1;  /* do handle the event queue */

Removed from v.1.4  
changed lines
  Added in v.1.5