Example #1
0
extern int RcPass1IoInit( void )
/******************************/
/* Open the two files for input and output. The input stream starts at the */
/* top   infilename   and continues as the directives in the file indicate */
/* Returns false if there is a problem opening one of the files. */
{
    int         error;
    char       *includepath = NULL;

    if( !CmdLineParms.IgnoreINCLUDE ) {
        if( CmdLineParms.TargetOS == RC_TARGET_OS_WIN16 ) {
            includepath = RcGetEnv( "WINDOWS_INCLUDE" );
        } else if( CmdLineParms.TargetOS == RC_TARGET_OS_WIN32 ) {
            includepath = RcGetEnv( "NT_INCLUDE" );
        } else if( CmdLineParms.TargetOS == RC_TARGET_OS_OS2 ) {
            includepath = RcGetEnv( "OS2_INCLUDE" );
        }
        if( includepath != NULL ) {
            PP_AddIncludePath( includepath );
        }
        includepath = RcGetEnv( "INCLUDE" );
        if( includepath != NULL ) {
            PP_AddIncludePath( includepath );
        }
    }
    if( !CmdLineParms.NoPreprocess ) {
        if( PreprocessInputFile() ) {
            return( FALSE );
        }
    }
    RcIoTextInputInit();
    error = RcIoPushInputFile( CmdLineParms.InFileName );
    if( error )
        return( FALSE );

    if( !CmdLineParms.PreprocessOnly ) {
        error = Pass1InitRes();
    }
    if( error )  {
        PP_Fini();
        RcIoTextInputShutdown();
        return( FALSE );
    }

    return( TRUE );
}
Example #2
0
static void SetIncludeVar( void )
/*******************************/
{
    char *  old_inc_dirs;

    if( !CmdLineParms.IgnoreINCLUDE ) {
        old_inc_dirs = RcGetEnv( "INCLUDE" );
        if( old_inc_dirs != NULL ) {
            AddNewIncludeDirs( old_inc_dirs );
        }
    }
} /* SetIncludeVar */
Example #3
0
extern void RcTmpFileName( char *tmpfilename )
/********************************************/
/* uses the TMP env. var. if it is set and puts the result into tmpfilename */
/* which is assumed to be a buffer of at least _MAX_PATH characters */
{
    char    *nextchar;
    char    *tmpdir;

    tmpdir = RcGetEnv( "TMP" );
    nextchar = tmpfilename;
    if( tmpdir != NULL && *tmpdir != '\0' ) {
        GetPathElement( tmpdir, NULL, &nextchar );
        if( !IS_PATH_SEP( nextchar[-1] ) ) {
            *nextchar++ = DIR_SEP;
        }
    }
    tmpnam( nextchar );
}