|
FAUST compiler
0.9.9.6b8
|
#include "enrobage.hh"#include <vector>#include <list>#include <set>#include <string>#include <ctype.h>#include <limits.h>#include <stdlib.h>#include "compatibility.hh"#include "sourcefetcher.hh"#include <errno.h>#include <climits>
Go to the source code of this file.
Classes | |
| class | myparser |
| A minimalistic parser used to recognize '#include <faust/...>' patterns when copying architecture files. More... | |
Macros | |
| #define | TRY_OPEN(filename) |
| #define | DIR_SEPARATOR '/' |
| filebasename returns the basename of a path. More... | |
| #define | IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) |
Functions | |
| static bool | isBlank (const string &s) |
| Returns true is a line is blank (contains only white caracters) More... | |
| static string & | replaceOccurences (string &str, const string &oldstr, const string &newstr) |
| Replace every occurrence of oldstr by newstr inside str. More... | |
| static string & | replaceClassName (string &str) |
| Used when copying architecture files to replace default mydsp class name with the user specified one. More... | |
| void | streamCopyLicense (istream &src, ostream &dst, const string &exceptiontag) |
| Copy or remove license header. More... | |
| bool | isFaustInclude (const string &s, string &fname) |
| True if string s match '#include <faust/fname>'. More... | |
| void | inject (ostream &dst, const string fname) |
| void | streamCopyUntil (istream &src, ostream &dst, const string &until) |
| Copy src to dst until specific line. More... | |
| void | streamCopy (istream &src, ostream &dst) |
| Copy src to dst. More... | |
| void | streamCopyUntilEnd (istream &src, ostream &dst) |
| Copy src to dst until end. More... | |
| ifstream * | open_arch_stream (const char *filename) |
| Try to open an architecture file searching in various directories. More... | |
| const char * | strip_start (const char *filename) |
| bool | check_url (const char *filename) |
| Check if an URL exists. More... | |
| static FILE * | fopenat (string &fullpath, const char *dir, const char *filename) |
| Try to open the file '<dir>/<filename>'. More... | |
| static FILE * | fopenat (string &fullpath, const string &dir, const char *filename) |
| Try to open the file '<dir>/<filename>'. More... | |
| static FILE * | fopenat (string &fullpath, const string &dir, const char *path, const char *filename) |
| Try to open the file '<dir>/<path>/<filename>'. More... | |
| static bool | isAbsolutePathname (const string &filename) |
| Test absolute pathname. More... | |
| static void | buildFullPathname (string &fullpath, const char *filename) |
| Build a full pathname of <filename>. More... | |
| FILE * | fopensearch (const char *filename, string &fullpath) |
| Try to open the file <filename> searching in various directories. More... | |
| const char * | filebasename (const char *name) |
| returns a pointer on the basename part of name More... | |
| string | filedirname (const string &name) |
| returns a string containing the dirname of name If no dirname, returns "." More... | |
Variables | |
| string | gFaustSuperSuperDirectory |
| string | gFaustSuperDirectory |
| string | gFaustDirectory |
| string | gMasterDirectory |
| string | gClassName |
| bool | gInlineArchSwitch |
| list< string > | gImportDirList |
| set< string > | alreadyIncluded |
| Inject file fname into dst ostream if not already done. More... | |
| #define DIR_SEPARATOR '/' |
filebasename returns the basename of a path.
(adapted by kb from basename.c)
| [in] | The | path to parse. |
Definition at line 522 of file enrobage.cpp.
| #define IS_DIR_SEPARATOR | ( | ch | ) | ((ch) == DIR_SEPARATOR) |
Definition at line 534 of file enrobage.cpp.
Referenced by filebasename().
| #define TRY_OPEN | ( | filename | ) |
Definition at line 212 of file enrobage.cpp.
Referenced by open_arch_stream().
|
static |
Build a full pathname of <filename>.
<fullpath> = <currentdir>/<filename>
Definition at line 412 of file enrobage.cpp.
References FAUST_PATH_MAX, and isAbsolutePathname().
Referenced by fopensearch().


| bool check_url | ( | const char * | filename | ) |
Check if an URL exists.
Definition at line 296 of file enrobage.cpp.
References http_fetch(), and http_strerror().
Referenced by process_cmdline().


| const char* filebasename | ( | const char * | name | ) |
returns a pointer on the basename part of name
Definition at line 544 of file enrobage.cpp.
References IS_DIR_SEPARATOR, and name().
Referenced by copyFaustSources(), filedirname(), and printfaustlisting().


| string filedirname | ( | const string & | name | ) |
returns a string containing the dirname of name If no dirname, returns "."
Definition at line 568 of file enrobage.cpp.
References filebasename().
Referenced by initFaustDirectories().


|
static |
Try to open the file '<dir>/<filename>'.
If it succeed, it stores the full pathname of the file into <fullpath>
Definition at line 337 of file enrobage.cpp.
References FAUST_PATH_MAX.
Referenced by fopenat(), and fopensearch().

|
static |
Try to open the file '<dir>/<filename>'.
If it succeed, it stores the full pathname of the file into <fullpath>
Definition at line 362 of file enrobage.cpp.
References fopenat().

|
static |
Try to open the file '<dir>/<path>/<filename>'.
If it succeed, it stores the full pathname of the file into <fullpath>
Definition at line 371 of file enrobage.cpp.
References FAUST_PATH_MAX.
| FILE* fopensearch | ( | const char * | filename, |
| string & | fullpath | ||
| ) |
Try to open the file <filename> searching in various directories.
If succesful place its full pathname in the string <fullpath>
Definition at line 458 of file enrobage.cpp.
References buildFullPathname(), fopenat(), gFaustDirectory, gFaustSuperDirectory, gFaustSuperSuperDirectory, gImportDirList, and gMasterDirectory.
Referenced by SourceReader::parse().


| void inject | ( | ostream & | dst, |
| const string | fname | ||
| ) |
Definition at line 167 of file enrobage.cpp.
References alreadyIncluded, open_arch_stream(), and streamCopy().
Referenced by streamCopyUntil().


|
static |
Test absolute pathname.
Definition at line 396 of file enrobage.cpp.
Referenced by buildFullPathname().

|
static |
Returns true is a line is blank (contains only white caracters)
Definition at line 48 of file enrobage.cpp.
Referenced by streamCopyLicense().

| bool isFaustInclude | ( | const string & | s, |
| string & | fname | ||
| ) |
True if string s match '#include <faust/fname>'.
Definition at line 149 of file enrobage.cpp.
References myparser::filename(), myparser::parse(), and myparser::skip().
Referenced by streamCopyUntil().


| ifstream* open_arch_stream | ( | const char * | filename | ) |
Try to open an architecture file searching in various directories.
Definition at line 220 of file enrobage.cpp.
References FAUST_PATH_MAX, gFaustDirectory, gFaustSuperDirectory, gFaustSuperSuperDirectory, and TRY_OPEN.
Referenced by inject(), main(), and openArchFile().

|
static |
Used when copying architecture files to replace default mydsp class name with the user specified one.
Definition at line 76 of file enrobage.cpp.
References gClassName, and replaceOccurences().
Referenced by streamCopyUntil().


|
static |
Replace every occurrence of oldstr by newstr inside str.
str is modified and returned as reference for convenience
Definition at line 59 of file enrobage.cpp.
Referenced by replaceClassName().

| void streamCopy | ( | istream & | src, |
| ostream & | dst | ||
| ) |
Copy src to dst.
Definition at line 199 of file enrobage.cpp.
References streamCopyUntil().
Referenced by inject(), and main().


| void streamCopyLicense | ( | istream & | src, |
| ostream & | dst, | ||
| const string & | exceptiontag | ||
| ) |
Copy or remove license header.
Architecture files can contain a header specifying the license. If this header contains an exception tag (for example "FAUST COMPILER EXCEPTION") it is an indication for the compiler to remove the license header from the resulting code. A header is the first non blank line that begins a comment.
Definition at line 87 of file enrobage.cpp.
References isBlank().

| void streamCopyUntil | ( | istream & | src, |
| ostream & | dst, | ||
| const string & | until | ||
| ) |
Copy src to dst until specific line.
Definition at line 183 of file enrobage.cpp.
References gInlineArchSwitch, inject(), isFaustInclude(), and replaceClassName().
Referenced by main(), streamCopy(), and streamCopyUntilEnd().


| void streamCopyUntilEnd | ( | istream & | src, |
| ostream & | dst | ||
| ) |
Copy src to dst until end.
Definition at line 207 of file enrobage.cpp.
References streamCopyUntil().
Referenced by main().


| const char* strip_start | ( | const char * | filename | ) |
Definition at line 281 of file enrobage.cpp.
| set<string> alreadyIncluded |
Inject file fname into dst ostream if not already done.
Definition at line 165 of file enrobage.cpp.
Referenced by inject().
| string gClassName |
Definition at line 158 of file main.cpp.
Referenced by main(), process_cmdline(), and replaceClassName().
| string gFaustDirectory |
Definition at line 103 of file main.cpp.
Referenced by fopensearch(), initFaustDirectories(), and open_arch_stream().
| string gFaustSuperDirectory |
Definition at line 102 of file main.cpp.
Referenced by fopensearch(), initFaustDirectories(), and open_arch_stream().
| string gFaustSuperSuperDirectory |
Definition at line 101 of file main.cpp.
Referenced by fopensearch(), initFaustDirectories(), and open_arch_stream().
| list<string> gImportDirList |
Definition at line 161 of file main.cpp.
Referenced by fopensearch(), and process_cmdline().
| bool gInlineArchSwitch |
Definition at line 156 of file main.cpp.
Referenced by process_cmdline(), and streamCopyUntil().
| string gMasterDirectory |
Definition at line 105 of file main.cpp.
Referenced by fopensearch(), and initFaustDirectories().
1.8.7