#include <stdio.h>
#include <fstream.h>
#include <string.h>
#include "StdString.h"
#include <windows.h>
#include <process.h>
#include <fcntl.h>
#include <io.h>
#include <direct.h>
#include "occCommon.h"
Include dependency graph for driver2.cpp:
Defines | |
#define | PREPROCESSOR_EXT ".i" |
#define | TRANSLATOR_EXT ".occ" |
#define | is_blank(c) ((c) == ' ' || (c) == '\t' || (c) == '\f' || (c) == '\r' || (c) == '\n') |
Functions | |
void | SetTargetDirectory (const char *dirPath) |
const char * | GetTargetDirectory () |
void | ParseCmdOptions (int from, int argc, char **argv, char *&source) |
void | AddCppOption (const char *arg) |
void | AddCcOption (const char *arg) |
void | CloseCcOptions () |
bool | IsCxxSource (char *fname) |
void | ShowCommandLine (const char *cmd, const char **args) |
void | RunLinker () |
char * | RunPreprocessor (const char *src) |
char * | OpenCxxOutputFileName (const char *src) |
void | RunCompiler (const char *src, const char *occsrc) |
void | RunSoCompiler (const char *src_file) |
void | BaseClassUsed (char *name, int len) |
void * | LoadSoLib (char *file_name) |
void * | LookupSymbol (void *handle, char *symbol) |
bool | ParseTargetSpecificOptions (char *arg, char *&source_file) |
int | Launch (const char *tool, const char *const *argv) |
char * | MakeTempFilename (const char *src, const char *suffix) |
void | ParseFileOptions (const char *filename, char *&source_file) |
void | File2Args (const char *fname, int max, int &argc, char *argv[]) |
void | String2Args (const char *str, int max, int &argc, char *argv[]) |
char * | NewArg (const char *from, size_t size, int argc, int max) |
void | ParseBackslash (char arg[], size_t &i, const char *&string) |
void | ParseDoubleQuote (char arg[], size_t &i, const char *&string) |
void | AddCc2Option (const char *arg) |
Variables | |
const char * | compilerName = "cl" |
char | targetDrive [_MAX_DRIVE] = "" |
char | targetDir [_MAX_DIR] = "" |
bool | showProgram |
bool | doCompile |
bool | makeExecutable |
bool | doPreprocess |
bool | doTranslate |
bool | verboseMode |
bool | regularCpp |
bool | makeSharedLibrary |
const int | NARGS |
int | cppArgc |
int | ccArgc |
int | cc2Argc |
const char * | cppArgv [] |
const char * | ccArgv [] |
const char * | cc2Argv [] |
const | NLIBS = 32 |
int | libsArgc = 0 |
const char * | libsArgv [NLIBS] |
const | NLINKERARGS = 32 |
int | linkerArgc = 0 |
bool | linkerFlag = FALSE |
char * | linkerArgv [NLINKERARGS] |
This file contains platform dependent functions of the original OpenC++ plus a few new platform dependent functions added by Josef Troch.
Functions from this file are used on Windows / MSVC platform. The same functions for Linux / gcc platform can be found in driver2l.cpp.
Only functions added or modified by Josef Troch are commented.
|
Extension of files generated by preprocessor.
|
|
Extension of files that are the results of IOPC SP / OpenC++ translation.
|
|
|
|
Sets drive and directory (targetDrive, targetDir) into which files generated by IOPC SP / OpenC++ should be placed. |
|
Gets path into which files generated by IOPC SP / OpenC++ should be placed. See SetTargetDirectory().
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Runs preprocessor on Because MSVC preprocessor (cl.exe) is unable to generate preprocessed files into specified directory, redirection of standard input is used.
|
|
|
|
Runs compiler (MSVC / cl.exe) on Sends the compiler the parameters specified when executing IOPC SP / OpenC++ (only the "compiler" options). Adds to them some parameters specified by IOPC SP / OpenC++ options, if called from IOPC SP adds some parameters needed for translated source to compile (support for RTTI etc.)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Creates temporary filename from given filename ( Rewritten by JT - uses targetDir and targetDrive now.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Drive on which files generated by IOPC SP / OpenC++ should be placed.
|
|
Directory into which files generated by IOPC SP / OpenC++ should be placed.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|