本文整理汇总了C++中process_file函数的典型用法代码示例。如果您正苦于以下问题:C++ process_file函数的具体用法?C++ process_file怎么用?C++ process_file使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了process_file函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: try_main
int try_main(int argc, char* argv[])
{
bool error_flag = false;
statistics z;
for(int j = 1; j < argc; ++j)
{
try
{
z += process_file(argv[j]);
}
catch(...)
{
error_flag = true;
std::cerr << "Exception--file '" << argv[j] << "': " << std::flush;
report_exception();
}
}
z.print_summary();
return error_flag ? EXIT_FAILURE : EXIT_SUCCESS;
}
开发者ID:vadz,项目名称:lmi,代码行数:20,代码来源:test_coding_rules.cpp
示例2: main
int
main(int argc, char *argv[])
{
int i = 1;
int retval = 0;
program_name = argv[0];
parse_int_env("EJ_MAX_LINE_LENGTH", &max_line_length);
parse_int_env("EJ_DISABLE_TABS", &disable_tabs);
parse_int_env("EJ_BASE_INDENT", &base_indent);
if (i >= argc) die("no files to check");
for (; i < argc; ++i) {
if (process_file(argv[i]) < 0) retval = 1;
}
return retval;
}
开发者ID:stden,项目名称:ejudge,代码行数:20,代码来源:style_c.c
示例3: check_for_file
//^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
void check_for_file(TString &prev_line, TString txt = "../../data/daqcapture.dq0")
{
char txtline[256];
ifstream captured_file(txt);
captured_file.getline(txtline,sizeof(txtline));
if(strlen(txtline)==0)
{
cout<<"Error reading "<<txt<<endl;
return;
}
//cout<<txtline<<"\n";
if( !prev_line.CompareTo(txtline) ) return;
cout<<"File changed from "<<prev_line<<" to "<<txtline<<endl;
prev_line = txtline;
txt = "../../data/";
txt += txtline;
cout<<"File to process: "<<txt<<endl;
process_file(txt,-1);
}
开发者ID:bnl-phenix,项目名称:SiTraker,代码行数:21,代码来源:check_for_file.C
示例4: main
int main(int argc, char **argv)
{
int i;
int result = 1;
if(argc == 1) {
version_info();
usage_info();
return EXIT_SUCCESS;
}
for(i=1; i<argc; i++)
if(result)
result = process_file(argv[i]);
if(result)
return EXIT_SUCCESS;
else
return EXIT_FAILURE;
}
开发者ID:bluesmoon,项目名称:pngtocss,代码行数:20,代码来源:pngtocss.c
示例5: process_path
static void
process_path(const char *path)
{
struct stat st;
int walkflags = FTW_CHDIR;
char *buf = NULL;
if (rflag) {
if (stat(path, &st) != -1 &&
(st.st_mode & S_IFMT) == S_IFDIR) {
outfn = 1; /* Print filename */
/*
* Add trailing slash if arg
* is directory, to resolve symlinks.
*/
if (path[strlen(path) - 1] != '/') {
(void) asprintf(&buf, "%s/", path);
if (buf != NULL)
path = buf;
}
/*
* Search through subdirs if path is directory.
* Don't follow symlinks if Rflag is not set.
*/
if (!Rflag)
walkflags |= FTW_PHYS;
if (nftw(path, recursive, MAX_DEPTH, walkflags) != 0) {
if (!sflag)
(void) fprintf(stderr,
gettext("%s: can't open \"%s\"\n"),
cmdname, path);
errors = 1;
}
return;
}
}
process_file(path, 0);
}
开发者ID:proliantss,项目名称:illumos-nexenta,代码行数:41,代码来源:grep.c
示例6: main
int main(int argc, char **argv)
{
char *in_filename;
char *out_filename;
int ch;
while ((ch = getopt_long(argc, argv, "b:c:", longopts, NULL)) != -1) {
switch (ch) {
case 'b':
parse_block_size(optarg);
break;
case 'c':
codec = optarg;
break;
default:
usage();
exit(1);
}
}
argc -= optind;
argv += optind;
if (argc == 2) {
in_filename = argv[0];
out_filename = argv[1];
} else if (argc == 1) {
in_filename = NULL;
out_filename = argv[0];
} else {
fprintf(stderr, "Can't read from multiple input files.\n");
usage();
exit(1);
}
/* Process the data file */
process_file(in_filename, out_filename);
return 0;
}
开发者ID:Hitwise,项目名称:avro,代码行数:41,代码来源:avromod.c
示例7: translate_file
static int
translate_file(const char *cpath, size_t offset, char *toString)
{
size_t base = 0;
LIST_MEMBER *pentry = NULL;
int res = 0;
char *path, *dpath;
dpath = path = convert_path(cpath);
if (!path)
return 1;
// The path could be absolute:
if (get_ImageBase(path, &base))
{
pentry = entry_lookup(&cache, path);
if (pentry)
{
path = pentry->path;
base = pentry->ImageBase;
if (base == INVALID_BASE)
{
l2l_dbg(1, "No, or invalid base address: %s\n", path);
res = 2;
}
}
else
{
l2l_dbg(1, "Not found in cache: %s\n", path);
res = 3;
}
}
if (!res)
{
res = process_file(path, offset, toString);
}
free(dpath);
return res;
}
开发者ID:mutoso-mirrors,项目名称:reactos,代码行数:41,代码来源:log2lines.c
示例8: process_path
static int process_path(const char *path)
{
int len;
struct stat st;
len = strlen(path);
if (has_symlink_leading_path(len, path))
return error("'%s' is beyond a symbolic link", path);
/*
* First things first: get the stat information, to decide
* what to do about the pathname!
*/
if (lstat(path, &st) < 0)
return process_lstat_error(path, errno);
if (S_ISDIR(st.st_mode))
return process_directory(path, len, &st);
return process_file(path, len, &st);
}
开发者ID:jep56,项目名称:gidit,代码行数:21,代码来源:builtin-update-index.c
示例9: process_file_list
void process_file_list(
const char *const *file_name_index,
jmp_buf *jmp_if_error)
{
while(*file_name_index)
{
/* Check if the current file name is "-" */
if(strcmp(*file_name_index, STDIN_FILE_NAME) == 0)
{
/* The user specified standard input as a file to replace.
Filter standard input to standard output. */
process_file(STDIN_FILE_NAME, STDOUT_FILE_NAME, jmp_if_error);
}
else
{
/* Process current file in-place */
process_file_in_place(*file_name_index, jmp_if_error);
}
file_name_index++;
}
}
开发者ID:rodgersb,项目名称:cleantxt,代码行数:21,代码来源:procfile.c
示例10: while
static char *process_token(char *p, object list)
{
char word[128], *w;
int inquote, noexpand;
while (*p && space(*p))
p++;
if (noexpand = inquote = *p == '"')
p++;
for (w=word ; *p && (!space(*p) || inquote) ; p++)
if (inquote && *p == '"')
inquote = 0;
else
*w++ = *p;
*w = '\0';
if (*word == '@')
process_file(list, word+1);
else if (*word)
process_word(word, list, noexpand);
return p;
}
开发者ID:blakemcbride,项目名称:Dynace,代码行数:21,代码来源:ArgumentList.c
示例11: main
int main(int argc, char **argv)
{
int i;
/* Process command line arguments and open input/output files. */
if (argc < 2) {
#ifdef VMS
printf("Usage: uaf_to_passwd [sysuaf-brief-list|$|~user]\n");
printf("($ spawns authorize to make SYSUAF.LIS file)\n");
#else
printf("Usage: uaf_to_passwd uaf_file\n");
#endif
return 0;
}
for (i = 1; i < argc; i++) {
process_file(argv[i]);
}
return 0;
}
开发者ID:Allen-smith,项目名称:ctf-tools,代码行数:21,代码来源:uaf2john.c
示例12: process_rc_file
static void process_rc_file(const char *config)
{
char text[256];
if (!config) {
if (!access(".mspdebug", F_OK)) {
config = ".mspdebug";
} else {
const char *home = getenv("HOME");
if (home) {
snprintf(text, sizeof(text), "%s/.mspdebug",
home);
if (!access(text, F_OK))
config = text;
}
}
}
if (config)
process_file(config, 0);
}
开发者ID:zcsahok,项目名称:mspdebug,代码行数:22,代码来源:main.c
示例13: process_files
//Given files just for this thread and global num found
void process_files(queue_t * loc_file_queue, unsigned int * num_found, char * to_find)
{
unsigned int local_num_found = 0;
//We have a list of files
//Loop through each of them
while(1)
{
queue_element_t * item = remove_from_queue(loc_file_queue);
if(item == NULL)
{
//Done increment global with local
(*num_found) +=local_num_found;
return;
}
//Get the str from this item
char * str = item->path_name;
//Process this dir
process_file(str, to_find, &local_num_found);
}
}
开发者ID:JulianKemmerer,项目名称:Drexel-ECEC622-Assignment1,代码行数:23,代码来源:omp_crew.c
示例14: ReadFiles
void ReadFiles(POETCode* _files, LexState _lexStateStart, std::list<POETProgram*>& resultFiles)
{
POETCode* files = eval_AST(_files);
POETCode* p_files=files;
while (p_files != 0) {
POETList* fileList = dynamic_cast<POETList*>(p_files);
POETCode* fileCur = p_files;
if (fileList != 0) {
fileCur = fileList->get_first();
p_files=fileList->get_rest();
}
else p_files = 0;
std::string fname= fileCur->toString(OUTPUT_NO_DEBUG);
if (fname == "") {
std::cerr << "Empty file name: " << fileCur->toString() << " from list " << files->toString() << "\n";
}
lexState = _lexStateStart;
POETProgram* programFile = process_file(fname.c_str());
resultFiles.push_back(programFile);
lexState=LEX_DEFAULT;
}
}
开发者ID:mshahriarinia,项目名称:POET-C-Compiler,代码行数:23,代码来源:evalAST.cpp
示例15: process_fat
void process_fat(t_file_info *file_info)
{
struct fat_header *fat;
struct fat_arch *arch;
uint32_t n;
uint32_t offset;
t_file_info sub_file_info;
fat = file_info->data;
n = fat->nfat_arch;
n = swapuint32_t(n);
arch = file_info->data + sizeof(fat);
while (n)
{
if (swapuint32_t(arch->cputype) == CPU_TYPE_X86_64)
offset = arch->offset;
arch += sizeof(arch) / sizeof(void*);
n--;
}
ft_memcpy(&sub_file_info, file_info, sizeof(t_file_info));
sub_file_info.data = file_info->data + swapuint32_t(offset);
process_file(&sub_file_info, FALSE);
}
开发者ID:vistalite68,项目名称:nm-otool,代码行数:23,代码来源:process_fat.c
示例16: main
/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
int main(int argc, char **argv) /* @7c */
{
int i;
int rc; /* @7a */
rc = parse_cmd_line(argc, argv, cmds, &num_subcmds); /* @7a */
if (rc != BAIL_OUT) /* @7c */
if (open_files(cmds, argc, argv) != BAIL_OUT)
if (num_files)
{
for (i = firstfile; i < argc; i++)
if (process_file_spec(argv[i], cmds) == BAIL_OUT)
{ /* @7a */
rc = BAIL_OUT; /* @7a */
break;
} /* @7a */
}
else
rc = process_file(NULL, cmds); /* @7c */
else /* @7a */
rc = BAIL_OUT; /* @7a */
return(rc); /* @7a */
}
开发者ID:OS2World,项目名称:UTIL-FILE-AIXLIKE,代码行数:24,代码来源:SED.C
示例17: main
int main(int argc, char *argv[])
{
struct saved_data data;
const char *path;
char stack_path[PATH_MAX + 1];
int rc;
if (argc != 2) {
fprintf(stderr, "usage: %s input_file\n", argv[0]);
exit(EXIT_FAILURE);
}
memset(&data, 0, sizeof(data));
path = argv[1];
rc = process_file(&data, path);
if (rc < 0)
return rc;
rc = sort_specs(&data);
if (rc)
return rc;
rc = snprintf(stack_path, sizeof(stack_path), "%s.bin", path);
if (rc < 0 || rc >= sizeof(stack_path))
return rc;
rc = write_binary_file(&data, stack_path);
if (rc < 0)
return rc;
rc = free_specs(&data);
if (rc < 0)
return rc;
return 0;
}
开发者ID:GaloisInc,项目名称:sk-dev-platform,代码行数:37,代码来源:sefcontext_compile.c
示例18: process_directory
int process_directory( t_string8 x_sIn, t_string8 x_sOut, t_string8 x_sRel, t_cmdline8 &cl, t_strlist8 &lstCmp, t_string8 &sRoot, long &lI )
{
if ( !x_sIn.length() || !x_sOut.length() )
return 0;
// Process directory contents
disk::SFindData fd;
disk::HFIND hFind = disk::FindFirst( x_sIn.c_str(), "*", &fd );
if ( disk::c_invalid_hfind == hFind )
return 0;
do
{
// Ignore relative
if ( '.' != *fd.szName )
{
// Recurse if directory
if ( disk::eFileAttribDirectory & fd.uFileAttributes )
process_directory( disk::FilePath< char, t_string8 >( x_sIn, fd.szName ),
disk::FilePath< char, t_string8 >( x_sOut, fd.szName ),
disk::FilePath< char, t_string8 >( x_sRel, fd.szName ),
cl, lstCmp, sRoot, lI );
// Go process the file
else
process_file( x_sIn, x_sOut, x_sRel, fd.szName, cl, lstCmp, sRoot, lI );
} // end if
// While we can find more files
} while ( disk::FindNext( hFind, &fd ) );
// Close the find handle
disk::FindClose( hFind );
return 1;
}
开发者ID:MangoCats,项目名称:winglib,代码行数:37,代码来源:cii.cpp
示例19: main
int main(int ac,char *av[]){
FILE *input_file = stdin;
FILE *output_file = stdout;
mode_of_operation = MODE_INTERACTIVE;
if (ac > 1) {
input_file = fopen(av[1], "r");
if (input_file == NULL)
input_file = stdin;
else
mode_of_operation = MODE_FILE;
}
initialize(input_file, output_file);
while(!quit && !feof(input_file)) {
if (mode_of_operation == MODE_INTERACTIVE) {
fprintf(output_file, "\n> ");
fflush(output_file);
}
// Parse expression
yyparse(yyscanner);
if (use == 1) {
use = 0;
process_file(input_file, filename);
}
if (help == 1) {
help = 0;
if (mode_of_operation == MODE_INTERACTIVE)
printHelp(output_file);
} else {
printResult(output_file, result);
}
}
yylex_destroy(yyscanner);
return(0);
}
开发者ID:vbmacher,项目名称:lecalc,代码行数:37,代码来源:kcalc.c
示例20: main
int main(int argc, char **argv)
{
if (argc < 2) {
usage();
}
int ii = 1;
while (strncmp(argv[ii], "-", 1) == 0) {
if (strcmp(argv[ii], "--byid") == 0) {
mode = DumpByID;
} else if (strcmp(argv[ii], "--byseq") == 0) {
mode = DumpBySequence;
} else if (strcmp(argv[ii], "--tree") == 0) {
dumpTree = true;
} else {
usage();
}
++ii;
}
if (ii >= argc) {
usage();
}
int error = 0;
int count = 0;
for (; ii < argc; ++ii) {
error += process_file(argv[ii], &count);
}
printf("\nTotal docs: %d\n", count);
if (error) {
exit(EXIT_FAILURE);
} else {
exit(EXIT_SUCCESS);
}
}
开发者ID:acm7,项目名称:couchstore,代码行数:37,代码来源:dbdump.c
注:本文中的process_file函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论