本文整理汇总了C++中dotty函数的典型用法代码示例。如果您正苦于以下问题:C++ dotty函数的具体用法?C++ dotty怎么用?C++ dotty使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了dotty函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: pmain
static int pmain (lua_State *L) {
struct Smain *s = (struct Smain *)lua_touserdata(L, 1);
char **argv = s->argv;
int script;
int has_i = 0, has_v = 0, has_e = 0;
globalL = L;
if (argv[0] && argv[0][0]) progname = argv[0];
lua_gc(L, LUA_GCSTOP, 0); /* stop collector during initialization */
luaL_openlibs(L); /* open libraries */
lua_gc(L, LUA_GCRESTART, 0);
s->status = handle_luainit(L);
if (s->status != 0) return 0;
script = collectargs(argv, &has_i, &has_v, &has_e);
if (script < 0) { /* invalid args? */
print_usage();
s->status = 1;
return 0;
}
if (has_v) print_version();
s->status = runargs(L, argv, (script > 0) ? script : s->argc);
if (s->status != 0) return 0;
if (script)
s->status = handle_script(L, argv, script);
if (s->status != 0) return 0;
if (has_i)
dotty(L);
else if (script == 0 && !has_e && !has_v) {
if (lua_stdin_is_tty()) {
print_version();
dotty(L);
}
else dofile(L, NULL); /* executes stdin as a file */
}
return 0;
}
开发者ID:andyvand,项目名称:UltraDefrag,代码行数:35,代码来源:lua.c
示例2: pmain
static int pmain (lua_State *L) {
int argc = (int)lua_tointeger(L, 1);
char **argv = (char **)lua_touserdata(L, 2);
int script;
int has_i = 0, has_v = 0, has_e = 0;
if (argv[0] && argv[0][0]) progname = argv[0];
script = collectargs(argv, &has_i, &has_v, &has_e);
if (script < 0) { /* invalid arg? */
print_usage(argv[-script]);
return 0;
}
if (has_v) print_version();
/* open standard libraries */
luaL_checkversion(L);
lua_gc(L, LUA_GCSTOP, 0); /* stop collector during initialization */
luaL_openlibs(L); /* open libraries */
lua_gc(L, LUA_GCRESTART, 0);
/* run LUA_INIT */
if (handle_luainit(L) != LUA_OK) return 0;
/* execute arguments -e and -l */
if (!runargs(L, argv, (script > 0) ? script : argc)) return 0;
/* execute main script (if there is one) */
if (script && handle_script(L, argv, script) != LUA_OK) return 0;
if (has_i) /* -i option? */
dotty(L);
else if (script == 0 && !has_e && !has_v) { /* no arguments? */
if (lua_stdin_is_tty()) {
print_version();
dotty(L);
}
else dofile(L, NULL); /* executes stdin as a file */
}
lua_pushboolean(L, 1); /* signal no errors */
return 1;
}
开发者ID:mabako,项目名称:iv-modlua,代码行数:35,代码来源:lua.c
示例3: pmain
static int pmain(lua_State *L)
{
int argc = (int)lua_tointeger(L, 1);
char **argv = (char**)lua_touserdata(L, 2);
int script;
int args[num_has];
args[has_i] = args[has_v] = args[has_e] = args[has_E] = 0;
if (argv[0] && argv[0][0])
progname = argv[0];
script = collectargs(argv, args);
if (script < 0) /* invalid arg? */
{
print_usage(argv[-script]);
return 0;
}
if (args[has_v])
print_version();
if (args[has_E]) /* option '-E'? */
{
lua_pushboolean(L, 1); /* signal for libraries to ignore env. vars. */
lua_setfield(L, LUA_REGISTRYINDEX, "LUA_NOENV");
}
/* open standard libraries */
luaL_checkversion(L);
lua_gc(L, LUA_GCSTOP, 0); /* stop collector during initialization */
luaL_openlibs(L); /* open libraries */
lua_gc(L, LUA_GCRESTART, 0);
if (!args[has_E] && handle_luainit(L) != LUA_OK)
return 0; /* error running LUA_INIT */
/* execute arguments -e and -l */
if (!runargs(L, argv, (script > 0) ? script : argc))
return 0;
/* execute main script (if there is one) */
if (script && handle_script(L, argv, script) != LUA_OK)
return 0;
if (args[has_i]) /* -i option? */
dotty(L);
else if (script == 0 && !args[has_e] && !args[has_v]) /* no arguments? */
{
if (lua_stdin_is_tty())
{
print_version();
dotty(L);
}
else
dofile(L, NULL); /* executes stdin as a file */
}
lua_pushboolean(L, 1); /* signal no errors */
return 1;
}
开发者ID:hyyh619,项目名称:OpenSceneGraph-3.4.0,代码行数:59,代码来源:lua.c
示例4: pmain
static int pmain(lua_State *L)
{
struct Smain *s = &smain;
char **argv = s->argv;
int script;
int flags = 0;
globalL = L;
if (argv[0] && argv[0][0]) progname = argv[0];
LUAJIT_VERSION_SYM(); /* linker-enforced version check */
script = collectargs(argv, &flags);
if (script < 0) { /* invalid args? */
print_usage();
s->status = 1;
return 0;
}
if ((flags & FLAGS_NOENV)) {
lua_pushboolean(L, 1);
lua_setfield(L, LUA_REGISTRYINDEX, "LUA_NOENV");
}
lua_gc(L, LUA_GCSTOP, 0); /* stop collector during initialization */
luaL_openlibs(L); /* open libraries */
s->status = tvm_loadbufferx(L, luaJIT_BC_op, luaJIT_BC_op_SIZE, "op", "b")
|| docall(L, 0, 1);
if (s->status != 0) return 0;
s->status = tvm_loadbufferx(L, luaJIT_BC_parse, luaJIT_BC_parse_SIZE, "parse", "b")
|| docall(L, 0, 1);
if (s->status != 0) return 0;
s->status = tvm_loadbufferx(L, luaJIT_BC_lunokhod, luaJIT_BC_lunokhod_SIZE, "lunokhod", "b")
|| docall(L, 0, 1);
if (s->status != 0) return 0;
lua_gc(L, LUA_GCRESTART, -1);
if (!(flags & FLAGS_NOENV)) {
s->status = handle_luainit(L);
if (s->status != 0) return 0;
}
if ((flags & FLAGS_VERSION)) print_version();
s->status = runargs(L, argv, (script > 0) ? script : s->argc);
if (s->status != 0) return 0;
if (script) {
s->status = handle_script(L, argv, script);
if (s->status != 0) return 0;
}
if ((flags & FLAGS_INTERACTIVE)) {
print_jit_status(L);
dotty(L);
} else if (script == 0 && !(flags & (FLAGS_EXEC|FLAGS_VERSION))) {
if (lua_stdin_is_tty()) {
print_version();
print_jit_status(L);
dotty(L);
} else {
dofile(L, NULL); /* executes stdin as a file */
}
}
return 0;
}
开发者ID:pfalcon-mirrors,项目名称:tvmjit,代码行数:56,代码来源:tvmjit.c
示例5: dotty
static void dotty(struct rb_node *n, FILE *fp)
{
/* Declare node */
fprintf(fp, " n%d [label=\"%d\",color=%s,fontcolor=white,style=filled, shape=circle, width=0.5, fixedsize=true,fontname=Palatino];\n",
n->key, n->key, (n->color == BLACK) ? "black" : "red");
if (n->left != nil) {
dotty(n->left, fp);
fprintf(fp, " n%d -- n%d;\n", n->key, n->left->key);
}
if (n->right != nil) {
dotty(n->right, fp);
fprintf(fp, " n%d -- n%d;\n", n->key, n->right->key);
}
}
开发者ID:laumann,项目名称:C,代码行数:16,代码来源:redblacktree.c
示例6: main
int main(int argc, char ** argv) {
progname = argv[0];
lua_State * L = luaL_newstate();
luaL_openlibs(L);
if(terra_init(L))
doerror(L);
bool interactive = false;
int scriptidx;
parse_args(L,argc,argv,&interactive,&scriptidx);
if(scriptidx < argc) {
int narg = getargs(L, argv, scriptidx);
lua_setglobal(L, "arg");
if(terra_loadfile(L,argv[scriptidx]))
doerror(L);
lua_insert(L, -(narg + 1));
if(lua_pcall(L, narg, LUA_MULTRET, 0))
doerror(L);
}
if(isatty(0) && (interactive || scriptidx == argc)) {
progname = NULL;
dotty(L);
}
printstats(L);
return 0;
}
开发者ID:aklofas,项目名称:terra,代码行数:30,代码来源:main.cpp
示例7: pmain
static int pmain(lua_State *L)
{
struct Smain *s = (struct Smain *)lua_touserdata(L, 1);
char **argv = s->argv;
int script;
int flags = 0;
globalL = L;
if (argv[0] && argv[0][0]) progname = argv[0];
LUAJIT_VERSION_SYM(); /* linker-enforced version check */
lua_gc(L, LUA_GCSTOP, 0); /* stop collector during initialization */
luaL_openlibs(L); /* open libraries */
lua_gc(L, LUA_GCRESTART, -1);
s->status = handle_luainit(L);
if (s->status != 0) return 0;
script = collectargs(argv, &flags);
if (script < 0) { /* invalid args? */
print_usage();
s->status = 1;
return 0;
}
if ((flags & FLAGS_VERSION)) print_version();
s->status = runargs(L, argv, (script > 0) ? script : s->argc);
if (s->status != 0) return 0;
if (script)
s->status = handle_script(L, argv, script);
if (s->status != 0) return 0;
if ((flags & FLAGS_INTERACTIVE)) {
print_jit_status(L);
dotty(L);
} else if (script == 0 && !(flags & (FLAGS_EXEC|FLAGS_VERSION))) {
if (lua_stdin_is_tty()) {
print_version();
print_jit_status(L);
dotty(L);
} else {
dofile(L, NULL); /* executes stdin as a file */
}
}
return 0;
}
开发者ID:loveshell,项目名称:ironbee,代码行数:40,代码来源:luajit.c
示例8: pmain
static int pmain (lua_State *L) {
/* open standard libraries */
luaL_checkversion(L);
lua_gc(L, LUA_GCSTOP, 0); /* stop collector during initialization */
luaL_openlibs(L); /* open libraries */
lua_gc(L, LUA_GCRESTART, 0);
print_version();
dotty(L);
lua_pushboolean(L, 1); /* signal no errors */
return 1;
}
开发者ID:xkentr,项目名称:lk,代码行数:13,代码来源:luash.c
示例9: main
int main(int argc, char ** argv) {
progname = argv[0];
lua_State * L = luaL_newstate();
luaL_openlibs(L);
terra_Options terra_options;
memset(&terra_options, 0, sizeof(terra_Options));
ebb_Options ebboptions;
memset(&ebboptions, 0, sizeof(ebb_Options));
char additional_args[ADDITIONAL_ARG_LEN] = "";
ebboptions.additional = additional_args;
bool interactive = false;
int scriptidx;
parse_args(L,argc,argv,&terra_options,&ebboptions,&interactive,&scriptidx);
// set some arguments by default
terra_options.usemcjit = 1;
// check other arguments
check_legion_arg_consistency(&ebboptions);
if(terra_initwithoptions(L, &terra_options))
doerror(L);
setupcrashsignal(L);
setupebb(L, &ebboptions);
if(scriptidx < argc) {
const char * filename = argv[scriptidx];
if(strcmp(filename,"-")) { // if not equal, then launch
int narg = getargs(L, argv, scriptidx);
lua_setglobal(L, "arg");
if(load_launchscript(L,&ebboptions))
doerror(L);
lua_insert(L, -(narg + 1));
if(docall(L,narg,0))
doerror(L);
}
}
if(isatty(0) && (interactive || scriptidx == argc)) {
progname = NULL;
dotty(L);
}
lua_close(L);
terra_llvmshutdown();
return 0;
}
开发者ID:jonathan-beard,项目名称:liszt-ebb,代码行数:51,代码来源:main.cpp
示例10: pmain
static int pmain (lua_State *L) {
struct Smain *s = (struct Smain *)lua_touserdata(L, 1);
int status;
int interactive = 1;
if (s->argv[0] && s->argv[0][0]) progname = s->argv[0];
globalL = L;
luaL_openlibs(L); /* open libraries */
luapreload_oilall(L); /* preload all OiL libraries */
status = handle_luainit(L);
if (status == 0) {
status = handle_argv(L, s->argc, s->argv, &interactive);
if (status == 0 && interactive) dotty(L);
}
s->status = status;
return 0;
}
开发者ID:LuaDist,项目名称:oil,代码行数:16,代码来源:console.c
示例11: main
int main(int argc, char **argv)
{
int fd;
struct stat st;
unsigned char *buf = NULL;
struct conf_c conf = {0};
struct s_comp comp = {0};
parse_opt(argc, argv, &conf);
check_opt(&conf, argv[0]);
fd = open(conf.in, O_RDONLY);
if (fd == -1)
{
perror("open()");
exit(EXIT_FAILURE);
}
if (fstat(fd, &st) == -1)
{
perror("fstat()");
exit(EXIT_FAILURE);
}
if ((buf = malloc(sizeof (char) * st.st_size)) == NULL)
{
perror("malloc()");
exit(EXIT_FAILURE);
}
if (read(fd, buf, st.st_size) != st.st_size)
{
perror("read()");
goto clean;
}
huff(buf, st.st_size, &comp);
if (comp.tree)
{
if (conf.dot)
dotty(comp.tree, conf.dot);
uncomp(&comp, buf + st.st_size);
if (comp.buf_out)
dump_to_file(conf.out, comp.buf_out, comp.size);
}
clean:
free(buf);
close(fd);
return 0;
}
开发者ID:w4kfu,项目名称:Stunts,代码行数:45,代码来源:main.c
示例12: dot
/* Write a dot graph of the tree to file */
void dot(struct redblack_tree *tree, const char *name, const char *file, const char *mode)
{
FILE *fp;
if (tree->root == nil) /* No tree - don't write anything! */
return;
/* printf("Writing tree to file '%s'\n", file); */
fp = fopen(file, (mode) ? "a" : mode);
if (!fp)
return;
fprintf(fp, "graph %s {\n", name);
dotty(tree->root, fp);
fprintf(fp, "}\n");
if (fclose(fp))
printf("Error closing file %s\n (%d)", file, errno);
}
开发者ID:laumann,项目名称:C,代码行数:20,代码来源:redblacktree.c
示例13: pmain
/*---------------------------------------------------------------------*/
static int
pmain(lua_State *L) {
TRACE_LUA_FUNC_START();
struct Smain *s;
char **argv;
globalL = L;
s = (struct Smain *)lua_touserdata(L, 1);
argv = s->argv;
init_lua(L, s);
if (s->status != 0) {
TRACE_LUA_FUNC_END();
return 0;
}
if (!strcmp(argv[0], "home-shell")) {
register_lua_procs(L);
TRACE_LOG("Executing %s\n", pv.lua_startup);
load_startup(L);
if (lua_stdin_is_tty()) {
print_version();
dotty(L);
}
} else if (!strcmp(argv[0], "remote-shell")) {
print_version();
do_rshell(L, argv[1]);
} else if (!strcmp(argv[0], "script")) {
register_lua_procs(L);
TRACE_LOG("Executing %s\n", pv.lua_startup);
load_startup(L);
dofile(L, NULL);
} else if (!strcmp(argv[0], "string")) {
process_str_request(L, argv[1]);
}
TRACE_LUA_FUNC_END();
return 0;
}
开发者ID:bro,项目名称:packet-bricks,代码行数:43,代码来源:lua_interpreter.c
示例14: pmain
static int pmain(lua_State *L) {
/* open standard libraries */
luaL_checkversion(L);
lua_newlibs_init(L);
if (handle_luainit(L) != LUA_OK)
return 0; /* error running LUA_INIT */
_set_stdfiles(L, luaL_getprivate(L));
dotty(L);
_reset_stdfiles(L);
lua_pushboolean(L, 1); /* signal no errors */
return 1;
}
开发者ID:hemantagr,项目名称:pktgen-dpdk,代码行数:20,代码来源:lua_shell.c
示例15: main
int main(int argc, char ** argv) {
progname = argv[0];
lua_State * L = luaL_newstate();
luaL_openlibs(L);
terra_Options options;
memset(&options, 0, sizeof(terra_Options));
bool interactive = false;
int scriptidx;
parse_args(L,argc,argv,&options,&interactive,&scriptidx);
if(terra_initwithoptions(L, &options))
doerror(L);
setupsigsegv(L);
if(scriptidx < argc) {
int narg = getargs(L, argv, scriptidx);
lua_setglobal(L, "arg");
const char * filename = argv[scriptidx];
if(!strcmp(filename,"-"))
filename = NULL;
if(terra_loadfile(L,filename))
doerror(L);
lua_insert(L, -(narg + 1));
if(lua_pcall(L, narg, LUA_MULTRET, 0))
doerror(L);
}
if(isatty(0) && (interactive || scriptidx == argc)) {
progname = NULL;
dotty(L);
}
lua_close(L);
terra_llvmshutdown();
return 0;
}
开发者ID:KoreanFoodComics,项目名称:terra,代码行数:41,代码来源:main.cpp
示例16: checkProof
void ProofGraph::handleProof( )
{
#ifndef OPTIMIZE
checkProof();
cleanProofGraph();
checkProof();
#endif
if( produceProof() )
{
//Print original proof
ofstream dotty( "proof.dot" );
printProofAsDotty( dotty );
if( reduceProof() > 0 )
{
//Reduce proof
transfProof();
//Print reduced proof
ofstream dottyred( "proof_reduced.dot" );
printProofAsDotty( dottyred );
}
}
else if ( produceInterpolants() > 0 )
{
//Make sense to transform proof only if there are AB-mixed predicates
if (!lightVars.empty())
{
transfProof();
//Print reordered proof
ofstream dottyre( "proof_reordered.dot" );
printProofAsDotty( dottyre );
}
}
}
开发者ID:4lex4nder,项目名称:dreal3,代码行数:37,代码来源:ProofGraphMain.C
示例17: handle_argv
static int handle_argv (lua_State *L, int argc, char **argv, int *interactive) {
if (argv[1] == NULL) { /* no arguments? */
*interactive = 0;
if (lua_stdin_is_tty())
dotty(L);
else
dofile(L, NULL); /* executes stdin as a file */
}
else { /* other arguments; loop over them */
int i;
for (i = 1; argv[i] != NULL; i++) {
if (argv[i][0] != '-') break; /* not an option? */
switch (argv[i][1]) { /* option */
case '-': { /* `--' */
if (argv[i][2] != '\0') {
print_usage();
return 1;
}
i++; /* skip this argument */
goto endloop; /* stop handling arguments */
}
case '\0': {
clearinteractive(interactive);
dofile(L, NULL); /* executes stdin as a file */
break;
}
case 'i': {
*interactive = 2; /* force interactive mode after arguments */
break;
}
case 'v': {
clearinteractive(interactive);
print_version();
break;
}
case 'e': {
const char *chunk = argv[i] + 2;
clearinteractive(interactive);
if (*chunk == '\0') chunk = argv[++i];
if (chunk == NULL) {
print_usage();
return 1;
}
if (dostring(L, chunk, "=(command line)") != 0)
return 1;
break;
}
case 'l': {
const char *filename = argv[i] + 2;
if (*filename == '\0') filename = argv[++i];
if (filename == NULL) {
print_usage();
return 1;
}
if (dolibrary(L, filename))
return 1; /* stop if file fails */
break;
}
default: {
clearinteractive(interactive);
print_usage();
return 1;
}
}
} endloop:
if (argv[i] != NULL) {
int status;
const char *filename = argv[i];
int narg = getargs(L, argc, argv, i); /* collect arguments */
lua_setglobal(L, "arg");
clearinteractive(interactive);
status = luaL_loadfile(L, filename);
lua_insert(L, -(narg+1));
if (status == 0)
status = docall(L, narg, 0);
else
lua_pop(L, narg);
return report(L, status);
}
}
return 0;
}
开发者ID:LuaDist,项目名称:oil,代码行数:82,代码来源:console.c
示例18: run_interactive_lua_interpreter
void run_interactive_lua_interpreter(lua_State *L)
{
globalL = L; /* for signal handling */
dotty(L);
}
开发者ID:AnnSeidel,项目名称:genometools,代码行数:5,代码来源:interactive.c
示例19: lua_repl
void lua_repl()
{
os::MutexLock lock(m);
dotty(L);
}
开发者ID:phamelin,项目名称:orocos-ocl,代码行数:5,代码来源:LuaComponent.cpp
示例20: pmain
static int pmain(lua_State *L)
{
struct Smain *s = &smain;
char **argv = s->argv;
int argn;
int flags = 0;
globalL = L;
if (argv[0] && argv[0][0]) progname = argv[0];
LUAJIT_VERSION_SYM(); /* Linker-enforced version check. */
argn = collectargs(argv, &flags);
if (argn < 0) { /* Invalid args? */
print_usage();
s->status = 1;
return 0;
}
if ((flags & FLAGS_NOENV)) {
lua_pushboolean(L, 1);
lua_setfield(L, LUA_REGISTRYINDEX, "LUA_NOENV");
}
/* Set MAD env _before_ libraries are open. */
mad_setenv(L, flags & FLAGS_NOENV);
/* Stop collector during library initialization. */
lua_gc(L, LUA_GCSTOP, 0);
luaL_openlibs(L);
mad_openlibs(L);
lua_gc(L, LUA_GCRESTART, -1);
createargtable(L, argv, s->argc, argn);
if (!(flags & FLAGS_NOENV)) {
s->status = handle_luainit(L);
if (s->status != LUA_OK) return 0;
}
/* MAD section. */
mad_setsig();
mad_regfunc();
if ((flags & FLAGS_MADENV))
dolibrary(L, "madl_main");
if (!(flags & FLAGS_NOENV)) {
s->status = handle_madinit(L);
if (s->status != LUA_OK) return 0;
}
if ((flags & FLAGS_VERSION)) print_version();
s->status = runargs(L, argv, argn);
if (s->status != LUA_OK) return 0;
if (s->argc > argn) {
s->status = handle_script(L, argv + argn);
if (s->status != LUA_OK) return 0;
}
if ((flags & FLAGS_INTERACTIVE)) {
(void)print_jit_status;
dotty(L);
} else if (s->argc == argn && !(flags & FLAGS_EXEC)) {
if (lua_stdin_is_tty()) {
(void)print_version;
(void)print_jit_status;
dotty(L);
} else {
dofile(L, NULL); /* Executes stdin as a file. */
}
}
return 0;
}
开发者ID:MethodicalAcceleratorDesign,项目名称:MAD,代码行数:74,代码来源:mad_main.c
注:本文中的dotty函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论