home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: WPS_PM / WPS_PM.zip / console.zip / Console / src / common / cmdline.h < prev    next >
C/C++ Source or Header  |  1997-07-30  |  2KB  |  47 lines

  1. /******************************************************************************\
  2. |*                                                                            *|
  3. |* Command-line parsing library: header file                                  *|
  4. |* Copyright (C) 1997 by FRIENDS software                                     *|
  5. |* All Rights Reserved                                                        *|
  6. |* Portability: universal                                                     *|
  7. |*                                                                            *|
  8. |* This program is free software; you can redistribute it and/or modify       *|
  9. |* it under the terms of the GNU General Public License as published by       *|
  10. |* the Free Software Foundation; either version 2 of the License, or          *|
  11. |* (at your option) any later version.                                        *|
  12. |*                                                                            *|
  13. |* This program is distributed in the hope that it will be useful,            *|
  14. |* but WITHOUT ANY WARRANTY; without even the implied warranty of             *|
  15. |* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the              *|
  16. |* GNU General Public License for more details.                               *|
  17. |*                                                                            *|
  18. |* You should have received a copy of the GNU General Public License          *|
  19. |* along with this program; if not, write to the Free Software                *|
  20. |* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA  *|
  21. |*                                                                            *|
  22. \******************************************************************************/
  23.  
  24. #ifndef __CMDLINE_H__
  25. #define __CMDLINE_H__
  26.  
  27. #include "stype.h"
  28.  
  29. #ifdef __cplusplus
  30.  extern "C" {
  31. #endif
  32.  
  33. /* Allocate and return a pointer to a string containing original command line */
  34. char *CmdLine(int argc, char *argv[]);
  35.  
  36. /* Parse the line passed to procedure calling either Opt or Str handlers */
  37. void ParseCmdLine(char *Line, int (*Opt)(char *), int (*Str)(char *));
  38.  
  39. /* Return 1 if Switch in [-+], 0 otherwise. Set State to 0 if '-', 1 otherwise */
  40. int OptState(char Switch, boolean *State);
  41.  
  42. #ifdef __cplusplus
  43.  }
  44. #endif
  45.  
  46. #endif __CMDLINE_H__
  47.