yast2-core
Classes | Macros | Typedefs | Functions | Variables
ycpc.cc File Reference
#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 recurseTrecurseStart (const char *path)
 
static recurseTrecurseNext (recurseT *handle, struct stat *st=0)
 
static void recurseEnd (recurseT *handle)
 
FileDep resolveDep (const char *name, bool as_module)
 
std::list< FileDepparseFile (const char *path, const char *expected)
 
std::list< FileDepmakeDirList (const char *dir)
 
std::map< std::string,
std::list< FileDep > > 
makeDependMap (const std::list< FileDep > &dep)
 
std::list< FileDepdepTree (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 Parserparser = 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
 

Macro Definition Documentation

#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().

#define progress (   ...)    { if (!quiet) fprintf (stderr, __VA_ARGS__); }
#define STAMPNAME   "/.stamp"
#define UI_NCURSES_NAME   "ncurses"

Referenced by main().

#define UI_QT_NAME   "qt"

Referenced by main().

Typedef Documentation

typedef struct recurse_struct recurseT

directory recursion (ycpc)

Function Documentation

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().

std::list<FileDep> depTree ( std::string  module,
const std::map< std::string, std::list< FileDep > > &  depmap 
)

References verbose.

Referenced by main().

int main ( int  argc,
char *  argv[] 
)
std::map<std::string, std::list <FileDep> > makeDependMap ( const std::list< FileDep > &  dep)

References parseFile(), and verbose.

Referenced by main().

std::list<FileDep> makeDirList ( const char *  dir)
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)
void print_help ( const char *  name)

Display help text

References opt_fmt.

Referenced by main().

void print_version ( )

Display version

References VERSION.

Referenced by main().

template<typename toStringAble >
int printcode ( const char *  outfname,
const toStringAble &  c 
)

Print the code to the given file 0 is success

References progress.

Referenced by processfile().

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.

Referenced by main(), and recurse().

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(), and recurse().

static void recurseEnd ( recurseT handle)
static

end recurse through directory

clean up handle

References recurse_struct::d.

Referenced by makeDirList(), recurse(), and recurseNext().

static recurseT * recurseNext ( recurseT handle,
struct stat *  st 
)
static

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 recurseT * recurseStart ( const char *  path)
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 
)

Variable Documentation

int compile = 0
static

Referenced by main(), and processfile().

int force = 0
static

Referenced by main().

int freshen = 0
static

Referenced by main().

int no_implicit_namespaces = 0
static

Referenced by main().

int no_std_path = 0
static

Referenced by main().

char* outname = NULL
static

Referenced by main().

int parse = 0
static

Referenced by main(), and processfile().

Parser* parser = NULL
static
int quiet = 0
static

Referenced by main(), and processfile().

int read_n_print = 0
static

Referenced by main(), and processfile().

int read_n_run = 0
static

Referenced by main(), and processfile().

int recursive = 0
static

Referenced by main().

int SymbolTableDebug
int to_xml = 0
static

Referenced by compilefile(), and main().

const char* ui_name = 0
static

Referenced by main(), and processfile().

int verbose = 0
static
int yydebug

Referenced by Parser::parse().


Generated on a sunny day for yast2-core by doxygen 1.8.5