TIP4.TXT 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. It is common for BBS door programs to accept command line parameters
  2. that permit various door-related settings, such as the serial port, baud
  3. rate, and node number. This tip demonstrates how you can do this when
  4. working with OpenDoors. This tip is presented in the following files:
  5. cmdline.h - Header file for command line processing function.
  6. cmdline.c - Implementation of command line processing function.
  7. tip4.c - Example of a program that uses the command line
  8. processing function.
  9. The cmdline.c module implements the ParseStandardCommandLine() function,
  10. which takes as its parameters the same argc and argv parameters that are
  11. passed to the main() function of any C program. The
  12. ParseStandardCommandLine() function then sets the appropriate OpenDoors
  13. settings based on the following optional command-line parameters:
  14. -L or -LOCAL - Causes door to operate in local mode, without
  15. requiring a door information (drop) file.
  16. -B x or -BPS x - Sets the bps (baud) rate to use.
  17. -P x or -PORT x - Sets the serial port to use, were 0=COM1, 1=COM2,
  18. etc.
  19. -N x or -NODE x - Sets the node number to use.
  20. -?, -H or -HELP - Displays command-line help and exits
  21. -PERSONALITY x - Sets the sysop status line / function key
  22. personality to use.
  23. -MAXTIME x - Sets the maximum number of minutes that any
  24. user will be permitted to access the door.
  25. -ADDRESS x - Sets serial port address, to be used if FOSSIL
  26. driver is not being used.
  27. -IRQ x - Sets the serial port IRQ line, to be used if
  28. FOSSIL driver is not being used.
  29. -NOFOSSIL - Disables use of FOSSIL driver, even if it is
  30. present.
  31. -NOFIFO - Disables use of 16550 FIFO buffers (only if
  32. FOSSIL driver is not being used).
  33. -DROPFILE x - Door information file directory or
  34. directory+filename.
  35. -USERNAME x - Name of user who is currently online.
  36. -TIMELEFT x - User's time remaining online.
  37. -SECURITY x - User's security level.
  38. -LOCATION x - Location from which user is calling.
  39. Note that any information that is available from the door information
  40. file overrides information provided on the command-line. If sufficient
  41. parameters are provided on the command-line, the door can be operated
  42. without a door information file. In order to do this, cmdline.c provides
  43. a callback function that you can hook into od_control.od_no_file_func,
  44. as demonstrated in tip4.c.
  45. Case is not sensitive in the names of command line arguments.