home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-385-Vol-1of3.iso / r / ril.zip / ril_main.c < prev    next >
C/C++ Source or Header  |  1992-09-08  |  2KB  |  80 lines

  1. /*                               -*- Mode: C -*- 
  2.  * main.c
  3.  * 
  4.  * Description     : Demo program using RIL and WCL
  5.  * 
  6.  * Author          : roger
  7.  * Created On      : Fri Apr 24 19:42:25 1992
  8.  * 
  9.  * Configuration Management
  10.  * 
  11.  * @(#)ril_main.c    1.1    6/17/92
  12.  * 
  13.  * VERSION   SPR   MODIFIER   DATE AND TIME
  14.  * 1.3       0     rogerr     Tue Jul 28 14:11:13 1992
  15.  *           use basename of file for class name 
  16.  * 1.2       0     rogerr     Tue Jul 14 16:43:17 1992
  17.  *           fix up 
  18.  * 
  19.  */
  20.  
  21. #include <stdio.h>
  22. #include <Xm/Xm.h>
  23.  
  24. #include <X11/Wc/WcCreate.h>
  25. extern void MriRegisterMotif();
  26.  
  27. #include <ril.h>
  28.  
  29. Widget appShell;
  30. XtAppContext appContext;
  31.  
  32.  
  33. main ( argc, argv )
  34.     int argc;
  35.     char* argv[];
  36. {   
  37.     char *appClass, *appName, filename[80];
  38.     XtActionsRec actions;
  39.  
  40.     if ((appName = (char*)strrchr(argv[0], '/')) != NULL)
  41.         ++appName;
  42.     else
  43.         appName = argv[0]; 
  44.  
  45.     if (argv[1] == NULL)
  46.     {
  47.         fprintf (stderr, "ril file name required\n");
  48.         exit(-1);
  49.     }
  50.  
  51.     if ((appClass = (char*)strrchr(argv[1], '/')) != NULL)
  52.         ++appClass;
  53.     else
  54.         appClass = argv[1];
  55.  
  56. #if 1
  57.     appShell = rilInitialize(&appContext, appClass, NULL, 0,
  58.                              &argc, argv, NULL,
  59.                              NULL, 0);
  60. #else
  61.     appShell = XtAppInitialize(&appContext, appClass, NULL, 0,
  62.                              &argc, argv, NULL,
  63.                              NULL, 0);
  64. #endif
  65.  
  66.     /* -- Register all Motif classes and constructors */
  67.     MriRegisterMotif (appContext);
  68.  
  69.  
  70.     /* -- Create widget tree below toplevel shell using Xrm database */
  71.     WcWidgetCreation (appShell);
  72.  
  73.     /*  -- Realize the widget tree and enter the main application loop */
  74.     XtRealizeWidget (appShell);
  75.  
  76.     XtAppMainLoop (appContext);
  77. }
  78.  
  79.  
  80.