コード例 #1
0
ファイル: shell.c プロジェクト: LastRitter/llconf
int unparse_shell(struct cnfmodule *cm, FILE *fptr, struct cnfnode *cn_root)
{
	struct cnfnode *cn_top;
	int do_quotes = 1;

	if(cm && cm->opt_root){
		parse_shell_options(cm->opt_root, &do_quotes);
	}

	for(cn_top = cn_root->first_child; cn_top; cn_top = cn_top->next){
		if(cn_top->name[0] == '.'){
			fprintf(fptr, "%s", cn_top->value);
		}else{
			unparse_shell_line(fptr, cn_top, do_quotes);
		}
	}

	return 0;
}
コード例 #2
0
void testme(){

	char argv[MAXLEN];
	int arg_start;
	int arg_end;
	int want_pending_command;
	int make_login_shell;
	int read_from_stdin;
	int dump_translatable_strings;
	char arg_string[MAXLEN];

	CAUT_INPUT(argv);
	CAUT_INPUT(arg_start);
	CAUT_INPUT(arg_end);
	CAUT_INPUT(want_pending_command);
	CAUT_INPUT(make_login_shell);
	CAUT_INPUT(read_from_stdin);
	CAUT_INPUT(dump_translatable_strings);
	CAUT_INPUT(arg_string);

	parse_shell_options (argv, arg_start, arg_end,  want_pending_command, make_login_shell,read_from_stdin, dump_translatable_strings, arg_string);

}