home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / x / volume10 / infow / part01 / xinfo.c < prev   
Encoding:
C/C++ Source or Header  |  1993-04-28  |  2.7 KB  |  105 lines

  1. #ifndef lint
  2. static char *rcsid = "$Header: /usr3/xinfo/RCS/xinfo.c,v 1.3 90/11/12 18:07:52 jkh Exp $";
  3. #endif
  4.  
  5. /*
  6.  *
  7.  *                   Copyright 1989, 1990
  8.  *                    Jordan K. Hubbard
  9.  *
  10.  *                PCS Computer Systeme, GmbH.
  11.  *                   Munich, West Germany
  12.  *
  13.  *
  14.  * This file is part of GNU Info widget.
  15.  *
  16.  * The GNU Info widget is free software; you can redistribute it and/or
  17.  * modify it under the terms of the GNU General Public License as published
  18.  * by the Free Software Foundation; either version 1, or (at your option)
  19.  * any later version.
  20.  *
  21.  * This software is distributed in the hope that it will be useful,
  22.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  23.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  24.  * GNU General Public License for more details.
  25.  *
  26.  * You should have received a copy of the GNU General Public License
  27.  * along with this software; see the file COPYING.  If not, write to
  28.  * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
  29.  *
  30.  *
  31.  */
  32.  
  33. /*
  34.  * $Log:    xinfo.c,v $
  35.  * Revision 1.3  90/11/12  18:07:52  jkh
  36.  * Changed startup string to be more palatable to weird CPP's.
  37.  * 
  38.  * Revision 1.2  90/11/11  21:37:15  jkh
  39.  * Release 1.01.
  40.  * 
  41.  * Revision 1.1  90/11/06  22:52:39  jkh
  42.  * Initial revision.
  43.  * 
  44.  */
  45.  
  46. #include <X11/Intrinsic.h>
  47. #include <X11/StringDefs.h>
  48. #include <X11/Shell.h>
  49. #include <stdio.h>
  50. #include "Info.h"
  51.  
  52. static char info_msg[] = "\
  53. XInfo %2.2f, Copyright (C) 1990 Jordan K. Hubbard.\
  54. XInfo is free software and you are welcome to distribute copies of it\
  55. under certain conditions; you should have received a copy of these\
  56. conditions (see file 'COPYING') with this software. Type '?' for\
  57. a list of commands.\
  58. ";
  59.  
  60. int main(argc, argv)
  61. int argc;
  62. char **argv;
  63. {
  64.      Arg args[5];
  65.      Cardinal i;
  66.      Widget top;
  67.      static void quit();
  68.      static XtCallbackRec call[] = {
  69.       { quit, NULL },
  70.       { NULL, NULL },
  71.      };
  72.      static XrmOptionDescRec options[] = {
  73.       {"-node",    "*info.infoNode",    XrmoptionSepArg,    NULL},
  74.       {"-file",    "*info.infoFile",    XrmoptionSepArg,    NULL},
  75.       {"-path",    "*info.infoPath",    XrmoptionSepArg,    NULL},
  76.       {"-lpr",    "*info.printCommand",    XrmoptionSepArg,    NULL},
  77.      };
  78.  
  79.  
  80.      top = XtInitialize("xinfo", "XInfo", options, XtNumber(options),
  81.             &argc, argv);
  82.      i = 0;
  83.      XtSetArg(args[i], XtNcallback, call);        i++;
  84.      XtCreateManagedWidget("info", infoWidgetClass, top, args, i);
  85.  
  86.      XtRealizeWidget(top);
  87.  
  88.      /* Tell the user who we are */
  89.      fprintf(stderr, info_msg, XpInfoVersion);
  90.  
  91.      /* Spin until we get sick */
  92.      XtMainLoop();
  93.  
  94.      return(0); /* hope not, but lint likes this */
  95. }
  96.  
  97. static void quit(w, client_data, call_data)
  98. Widget w;
  99. caddr_t client_data, call_data;
  100. {
  101.      extern void exit();
  102.  
  103.      exit(0);
  104. }
  105.