yast2-core
|
#include <dirent.h>
#include <getopt.h>
#include <stdio.h>
#include <utime.h>
#include <errno.h>
#include <sys/stat.h>
#include <fstream>
#include <list>
#include <map>
#include <YCP.h>
#include <ycp/YCode.h>
#include <ycp/Parser.h>
#include <ycp/Bytecode.h>
#include <ycp/Xmlcode.h>
#include <ycp/Import.h>
#include <ycp/y2log.h>
#include <../../libycp/src/parser.hh>
#include <ycp/pathsearch.h>
#include <y2/Y2Component.h>
#include <y2/Y2ComponentBroker.h>
#include <scr/SCR.h>
#include <WFM.h>
#include "config.h"
Classes | |
struct | recurse_struct |
directory recursion (ycpc) More... | |
class | FileDep |
file dependency (ycpc) More... | |
Macros | |
#define | STAMPNAME "/.stamp" |
#define | DEPENDNAME "/.depend" |
#define | UI_QT_NAME "qt" |
#define | UI_NCURSES_NAME "ncurses" |
#define | progress(...) { if (!quiet) fprintf (stderr, __VA_ARGS__); } |
#define | MAXPATHLEN 2048 |
#define | LBUFSIZE 8192 |
#define | opt_fmt "\t%-25s %s\n" |
Typedefs | |
typedef struct recurse_struct | recurseT |
directory recursion (ycpc) More... | |
Functions | |
static recurseT * | recurseStart (const char *path) |
static recurseT * | recurseNext (recurseT *handle, struct stat *st=0) |
static void | recurseEnd (recurseT *handle) |
FileDep | resolveDep (const char *name, bool as_module) |
std::list< FileDep > | parseFile (const char *path, const char *expected) |
std::list< FileDep > | makeDirList (const char *dir) |
std::map< std::string, std::list< FileDep > > | makeDependMap (const std::list< FileDep > &dep) |
std::list< FileDep > | depTree (std::string module, const std::map< std::string, std::list< FileDep > > &depmap) |
int | recompileAll (const std::list< std::string > &deplist, const char *depend) |
YCodePtr | parsefile (const char *infname) |
int | compilefile (const char *infname, const char *outfname) |
template<typename toStringAble > | |
int | printcode (const char *outfname, const toStringAble &c) |
int | processfile (const char *infname, const char *outfname) |
int | recurse (const char *path) |
void | print_help (const char *name) |
void | print_version () |
int | main (int argc, char *argv[]) |
Variables | |
int | yydebug |
int | SymbolTableDebug |
static Parser * | parser = NULL |
static char * | outname = NULL |
static int | quiet = 0 |
static int | verbose = 0 |
static int | no_std_path = 0 |
static int | recursive = 0 |
static int | parse = 0 |
static int | compile = 0 |
static int | to_xml = 0 |
static int | read_n_print = 0 |
static int | read_n_run = 0 |
static int | freshen = 0 |
static int | force = 0 |
static int | no_implicit_namespaces = 0 |
static const char * | ui_name = 0 |
#define DEPENDNAME "/.depend" |
#define LBUFSIZE 8192 |
Referenced by parseFile().
#define MAXPATHLEN 2048 |
Referenced by recurseNext(), and recurseStart().
#define opt_fmt "\t%-25s %s\n" |
Referenced by print_help().
Referenced by compilefile(), parsefile(), printcode(), and processfile().
#define STAMPNAME "/.stamp" |
#define UI_NCURSES_NAME "ncurses" |
Referenced by main().
#define UI_QT_NAME "qt" |
Referenced by main().
typedef struct recurse_struct recurseT |
directory recursion (ycpc)
int compilefile | ( | const char * | infname, |
const char * | outfname | ||
) |
Compile one file infname: "-" is stdin outfname: if NULL it is created from infname by replacing .ycp by .ybc return: 0 - success 1 - writing failed 2 - parsing failed
References parsefile(), progress, to_xml, Xmlcode::writeFile(), and Bytecode::writeFile().
Referenced by main(), and processfile().
int main | ( | int | argc, |
char * | argv[] | ||
) |
main() function
References YCPPathSearch::addPath(), YCPPathSearch::clearPaths(), compile, compilefile(), depTree(), force, freshen, YCPPathSearch::Include, YCPPathSearch::initialize(), makeDependMap(), makeDirList(), YCPPathSearch::Module, no_implicit_namespaces, no_std_path, outname, parse, print_help(), print_version(), processfile(), quiet, read_n_print, read_n_run, recurse(), recursive, set_log_filename(), set_log_simple_mode(), to_xml, ui_name, UI_NCURSES_NAME, UI_QT_NAME, and verbose.
References parseFile(), and verbose.
Referenced by main().
std::list<FileDep> makeDirList | ( | const char * | dir | ) |
References recurse_struct::length, recurse_struct::path, recurseEnd(), recurseNext(), recurseStart(), and verbose.
Referenced by main().
std::list<FileDep> parseFile | ( | const char * | path, |
const char * | expected | ||
) |
References LBUFSIZE, FileDep::path(), resolveDep(), and verbose.
Referenced by makeDependMap().
YCodePtr parsefile | ( | const char * | infname | ) |
parse file and return corresponding YCode or NULL for error "-" is stdin
References Parser::atEOF(), YaST::ee, END_OF_FILE, Scanner::filename(), Scanner::lineNumber(), Parser::parse(), progress, Parser::scanner(), Parser::setBuffered(), YaST::ExecutionEnvironment::setFilename(), Parser::setInput(), YaST::ExecutionEnvironment::setLinenumber(), SymbolTableDebug, verbose, ycperror, and Scanner::yylex().
Referenced by compilefile(), and processfile().
int printcode | ( | const char * | outfname, |
const toStringAble & | c | ||
) |
int processfile | ( | const char * | infname, |
const char * | outfname | ||
) |
Process one file according to the command: compile, check syntax
References compile, compilefile(), Y2ComponentBroker::createServer(), parse, parsefile(), printcode(), progress, quiet, read_n_print, read_n_run, Bytecode::readFile(), and ui_name.
int recompileAll | ( | const std::list< std::string > & | deplist, |
const char * | depend | ||
) |
int recurse | ( | const char * | path | ) |
Recurse through directories, processing
References recurse_struct::length, recurse_struct::path, processfile(), recurseEnd(), recurseNext(), and recurseStart().
Referenced by main().
|
static |
end recurse through directory
clean up handle
References recurse_struct::d.
Referenced by makeDirList(), recurse(), and recurseNext().
recurse through directory
get first/next path from handle->path NULL at error or end-of-dir
References recurse_struct::d, recurse_struct::length, MAXPATHLEN, recurse_struct::parent, recurse_struct::path, recurseEnd(), and y2debug.
Referenced by makeDirList(), and recurse().
|
static |
recurse through directory
start recursion at path, return recurseT handle
References recurse_struct::d, recurse_struct::length, MAXPATHLEN, recurse_struct::parent, recurse_struct::path, and y2debug.
Referenced by makeDirList(), and recurse().
FileDep resolveDep | ( | const char * | name, |
bool | as_module | ||
) |
References YCPPathSearch::findInclude(), YCPPathSearch::findModule(), and verbose.
Referenced by parseFile().
|
static |
Referenced by main(), and processfile().
|
static |
Referenced by main().
|
static |
Referenced by main().
|
static |
Referenced by main().
|
static |
Referenced by main().
|
static |
Referenced by main().
|
static |
Referenced by main(), and processfile().
|
static |
|
static |
Referenced by main(), and processfile().
|
static |
Referenced by main(), and processfile().
|
static |
Referenced by main(), and processfile().
|
static |
Referenced by main().
int SymbolTableDebug |
Referenced by parsefile().
|
static |
Referenced by compilefile(), and main().
|
static |
Referenced by main(), and processfile().
|
static |
Referenced by depTree(), main(), makeDependMap(), makeDirList(), parseFile(), parsefile(), and resolveDep().
int yydebug |
Referenced by Parser::parse().