#ifdef INCRCSDATA static char RCSid[]="$Id: gnupmdrv.c,v 1.10 1998/03/22 22:34:23 drd Exp $" ; #endif /**************************************************************************** PROGRAM: gnupmdrv Outboard PM driver for GNUPLOT 3.3 MODULE: gnupmdrv.c This file contains the startup procedures for gnupmdrv ****************************************************************************/ /* PM driver for GNUPLOT */ /*[ * Copyright 1992, 1993, 1998 Roger Fearick * * Permission to use, copy, and distribute this software and its * documentation for any purpose with or without fee is hereby granted, * provided that the above copyright notice appear in all copies and * that both that copyright notice and this permission notice appear * in supporting documentation. * * Permission to modify the software is granted, but not the right to * distribute the complete modified source code. Modifications are to * be distributed as patches to the released version. Permission to * distribute binaries produced by compiling modified sources is granted, * provided you * 1. distribute the corresponding source modifications from the * released version in the form of a patch file along with the binaries, * 2. add special version identification to distinguish your version * in addition to the base release version number, * 3. provide your name and address as the primary contact for the * support of your modified version, and * 4. retain our contact information in regard to use of the base * software. * Permission to distribute the released version of the source code along * with corresponding source modifications in the form of a patch file is * granted with same provisions 2 through 4 for binary distributions. * * This software is provided "as is" without express or implied warranty * to the extent permitted by applicable law. ]*/ /* * AUTHOR * * Gnuplot driver for OS/2: Roger Fearick * * Send your comments or suggestions to * info-gnuplot@dartmouth.edu. * This is a mailing list; to join it send a note to * majordomo@dartmouth.edu. * Send bug reports to * bug-gnuplot@dartmouth.edu. **/ #define INCL_PM #define INCL_WIN #define INCL_SPL #define INCL_SPLDOSPRINT #define INCL_DOSMEMMGR #define INCL_DOSPROCESS #define INCL_DOSFILEMGR #include #include #include #include #include "gnupmdrv.h" /*==== g l o b a l d a t a ================================================*/ char szIPCName[256] ; char szIniFile[256] ; #define IPCDEFAULT "gnuplot" int bServer=0 ; int bPersist=0 ; int bWideLines=0 ; int bEnhanced=0 ; /*==== l o c a l d a t a ==================================================*/ /* class names for window registration */ static char szChildName [] = "Gnuchild" ; static char szTitle[256] = "Gnuplot" ; /*==== f u n c t i o n s =====================================================*/ BOOL QueryIni( HAB ) ; int main( int, char** ) ; static HWND InitHelp( HAB, HWND ) ; /*==== c o d e ===============================================================*/ int main ( int argc, char **argv ) /* ** args: argv[1] : name to be used for IPC (pipes/semaphores) with gnuplot ** ** Standard PM initialisation: ** -- set up message processing loop ** -- register all window classes ** -- start up main window ** -- subclass main window for help and dde message trapping to frame window ** -- init help system ** -- check command line and open any filename found there ** */ { static ULONG flFrameFlags = (FCF_ACCELTABLE|FCF_STANDARD);//&(~FCF_TASKLIST) ; static ULONG flClientFlags = WS_VISIBLE ; HMQ hmq ; QMSG qmsg ; PFNWP pfnOldFrameWndProc ; HWND hwndHelp ; BOOL bPos ; /* (am, 19981001) * A subtile problem is fixed here: * upon the first initialization of this driver (i.e. we're here in main()) * it may inherit handles of files opened (temporarily) by gnuplot itself! * We close them here. */ fcloseall(); if( argc <= 1 ) strcpy( szIPCName, IPCDEFAULT ) ; else { int i ; strcpy( szIPCName, argv[1] ) ; for ( i=2; i