Main Page | Modules | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

driver2l.cpp File Reference

One of the original OpenC++ source files, considerably modified by Josef Troch. More...

#include "occCommon.h"
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <limits.h>
#include <fstream>
#include <iostream>
#include "types.h"
#include <dlfcn.h>

Include dependency graph for driver2l.cpp:

Include dependency graph


#define lt_dlhandle   void *
#define PREPROCESSOR_EXT   ".i"
#define TRANSLATOR_EXT   ".ii"
#define SLIB_EXT   ".so"
#define OBJ_EXT   ".o"


int execvp (...)
int wait (int *)
void ParseCmdOptions (int from, int argc, char **argv, char *&source)
void AddCppOption (const char *arg)
void AddCcOption (const char *arg)
void CloseCcOptions ()
void ShowCommandLine (const char *cmd, const char **args)
bool ParseTargetSpecificOptions (char *arg, char *&source_file)
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)
lt_dlhandle LoadSoLib (char *file_name)
void * LookupSymbol (lt_dlhandle handle, char *symbol)
void RunSoLinker (const char *org_src, char *target)
char * MakeTempFilename (const char *src, const char *suffix)
void SetTargetDirectory (const char *dirPath)
const char * GetTargetDirectory ()
void AddCc2Option (const char *arg)


const char * compilerName = "g++"
const char * linkerName = "ld"
bool showProgram
bool doCompile
bool makeExecutable
bool doPreprocess
bool doTranslate
bool verboseMode
bool regularCpp
bool makeSharedLibrary
char * sharedLibraryName
bool preprocessTwice
const int NARGS
int cppArgc
int ccArgc
int cc2Argc
const char * cppArgv []
const char * ccArgv []
const char * cc2Argv []
char targetDir [PATH_MAX] = ""

Detailed Description

One of the original OpenC++ source files, considerably modified by Josef Troch.

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 Linux / gcc platform. The same functions for Windows / MSVC platform can be found in driver2.cpp.

Only functions added or modified by Josef Troch are commented.

Define Documentation

#define lt_dlhandle   void *

#define PREPROCESSOR_EXT   ".i"

Extension of files generated by preprocessor.

#define TRANSLATOR_EXT   ".ii"

Extension of files that are the results of IOPC SP / OpenC++ translation.

#define SLIB_EXT   ".so"

#define OBJ_EXT   ".o"

Function Documentation

int execvp ...   ) 

int wait int *   ) 

void ParseCmdOptions int  from,
int  argc,
char **  argv,
char *&  source

void AddCppOption const char *  arg  ) 

void AddCcOption const char *  arg  ) 

void CloseCcOptions  ) 

void ShowCommandLine const char *  cmd,
const char **  args

bool ParseTargetSpecificOptions char *  arg,
char *&  source_file

void RunLinker  ) 

char* RunPreprocessor const char *  src  ) 

Runs preprocessor (g++ / cpre) on file_in.

Name of the file that contains preprocessor output. (The name is generated using MakeTempFilename().)
See also:
PREPROCESSOR_EXT, SetTargetDirectory()

char* OpenCxxOutputFileName const char *  src  ) 

void RunCompiler const char *  org_src,
const char *  occ_src

Runs compiler (g++) on occ_src.

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 (two bytes wchar_t support).

org_src The original (not translated) C++ source file name. Used in OpenC++ if generating shared library.
occ_src Name of the translated C++ source file - input for the compiler.
See also:

void RunSoCompiler const char *  src_file  ) 

lt_dlhandle LoadSoLib char *  file_name  ) 

void * LookupSymbol lt_dlhandle  handle,
char *  symbol

void RunSoLinker const char *  org_src,
char *  target

char * MakeTempFilename const char *  src,
const char *  suffix

Creates temporary filename from given filename (src) and extension (suffix).

Rewritten by JT - uses targetDir now..

See also:
The filename.

void SetTargetDirectory const char *  dirPath  ) 

Sets path (targetDir) into which files generated by IOPC SP / OpenC++ should be placed.

Sets drive and directory (targetDrive, targetDir) into which files generated by IOPC SP / OpenC++ should be placed.

const char* GetTargetDirectory  ) 

Gets path into which files generated by IOPC SP / OpenC++ should be placed. See SetTargetDirectory().

void AddCc2Option const char *  arg  ) 

Variable Documentation

const char* compilerName = "g++"

const char* linkerName = "ld"

bool showProgram

bool doCompile

bool makeExecutable

bool doPreprocess

bool doTranslate

bool verboseMode

bool regularCpp

bool makeSharedLibrary

char* sharedLibraryName

bool preprocessTwice

const int NARGS

int cppArgc

int ccArgc

int cc2Argc

const char* cppArgv[]

const char* ccArgv[]

const char* cc2Argv[]

char targetDir[PATH_MAX] = ""

Path into which files generated by IOPC SP / OpenC++ should be placed.

Generated on Wed Aug 11 22:33:46 2004 for IOPC by Doxygen 1.3.6