Back to index

tetex-bin  3.0
Defines | Functions | Variables
winmain.c File Reference
#include <windows.h>
#include <dos.h>
#include <stdio.h>
#include <string.h>

Go to the source code of this file.

Defines

#define MAXSTR   255

Functions

void help ()
void error ()
int main (int argc, char *argv[], char *env[])
int system (char *command)
void winargs ()
int PASCAL WinMain (HANDLE hInstance, HANDLE hPrevInstance, LPSTR lpszCmdLine, int cmdShow)

Variables

HWND FAR hwndeasy
static char FAR szAppName [] = "dvips"
char winline [MAXSTR]
int wargc
char * wargv [32]
POINT _ScreenSize

Define Documentation

#define MAXSTR   255

Definition at line 13 of file winmain.c.


Function Documentation

void error ( )
void help ( )

Here is the caller graph for this function:

int main ( int  argc,
char *  argv[],
char *  env[] 
)
int system ( char *  command)

Definition at line 31 of file winmain.c.

{
char str[MAXSTR];
   strcpy(str,"Windows can't do system(\042");
   if (command) {
     strncat(str,command,MAXSTR-strlen(str));
   }
   strncat(str,"\042);",MAXSTR-strlen(str));
   error(str);
   return(1);  /* error */
}

Here is the call graph for this function:

Definition at line 46 of file winmain.c.

{
   fputs("Options: ",stdout);
   fgets(winline,MAXSTR,stdin);
   wargc=1;
   if ( (wargv[1] = strtok(winline," \n")) != (char *)NULL ) {
      wargc=2;
      while ( ((wargv[wargc] = strtok((char *)NULL," \n")) != (char *)NULL)
            && (wargc < 31) )
         wargc++;
   }
   wargv[wargc] = (char *)NULL;
}

Here is the call graph for this function:

Here is the caller graph for this function:

int PASCAL WinMain ( HANDLE  hInstance,
HANDLE  hPrevInstance,
LPSTR  lpszCmdLine,
int  cmdShow 
)

Definition at line 60 of file winmain.c.

{
       char modulename[MAXSTR];

        /* start up the text window */
       _ScreenSize.y = 50;
       _InitEasyWin();

       /* fix up the EasyWindows window provided by Borland */
       GetModuleFileName(hInstance, (LPSTR) modulename, MAXSTR);
       hwndeasy = FindWindow("BCEasyWin", modulename);
       SetWindowText(hwndeasy, szAppName);            /* change title */
       SetClassWord(hwndeasy, GCW_HICON, LoadIcon(hInstance, "RadicalEye")); /* change icon */

       if (_argc==1) {
              /* get new command line if no options or filenames */
              help();
              winargs();
              wargv[0] = _argv[0];
              _argc=wargc;
              _argv=wargv;
       }

       main(_argc, _argv, environ);
       /* unfortunately dvips doesn't return from main(), it exits */
       /* so the following code is never executed */
       DestroyWindow(hwndeasy);
       return 0;
}

Here is the call graph for this function:


Variable Documentation

POINT _ScreenSize
HWND FAR hwndeasy

Definition at line 14 of file winmain.c.

char FAR szAppName[] = "dvips" [static]

Definition at line 15 of file winmain.c.

Definition at line 17 of file winmain.c.

char* wargv[32]

Definition at line 18 of file winmain.c.

char winline[MAXSTR]

Definition at line 16 of file winmain.c.