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/Import.h>
#include <ycp/y2log.h>
#include <../../libycp/src/parser.h>
#include <ycp/pathsearch.h>
#include <y2/Y2Component.h>
#include <y2/Y2ComponentBroker.h>
#include <UI.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...

Defines

#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

Typedefs

typedef recurse_struct recurseT
 directory recursion (ycpc)

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
ExecutionEnvironment ee
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 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 char * ui_name = 0

Define Documentation

#define DEPENDNAME   "/.depend"

#define LBUFSIZE   8192

#define MAXPATHLEN   2048

#define progress ( ...   )     { if (!quiet) fprintf (stderr, __VA_ARGS__); }

#define STAMPNAME   "/.stamp"

#define UI_NCURSES_NAME   "ncurses"

#define UI_QT_NAME   "qt"


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

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

int main ( int  argc,
char *  argv[] 
)

main() function

std::map<std::string, std::list <FileDep> > makeDependMap ( const std::list< FileDep > &  dep  ) 

std::list<FileDep> makeDirList ( const char *  dir  ) 

YCodePtr parsefile ( const char *  infname  ) 

parse file and return corresponding YCode or NULL for error "-" is stdin

std::list<FileDep> parseFile ( const char *  path,
const char *  expected 
)

void print_help ( const char *  name  ) 

Display help text

void print_version (  ) 

Display version

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

Print the code to the given file 0 is success

int processfile ( const char *  infname,
const char *  outfname 
)

Process one file according to the command: compile, check syntax

int recompileAll ( const std::list< std::string > &  deplist,
const char *  depend 
)

int recurse ( const char *  path  ) 

Recurse through directories, processing

static void recurseEnd ( recurseT handle  )  [static]

end recurse through directory

clean up handle

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

static recurseT * recurseStart ( const char *  path  )  [static]

recurse through directory

start recursion at path, return recurseT handle

FileDep resolveDep ( const char *  name,
bool  as_module 
)


Variable Documentation

int compile = 0 [static]

ExecutionEnvironment ee

int force = 0 [static]

int freshen = 0 [static]

int no_implicit_namespaces = 0 [static]

int no_std_path = 0 [static]

char* outname = NULL [static]

int parse = 0 [static]

Parser* parser = NULL [static]

int quiet = 0 [static]

int read_n_print = 0 [static]

int read_n_run = 0 [static]

int recursive = 0 [static]

int SymbolTableDebug

char* ui_name = 0 [static]

int verbose = 0 [static]

int yydebug


Generated on Tue Nov 6 01:20:21 2007 for yast2-core by  doxygen 1.5.0