323
324 sm_outfd = stdout;
325 sql_outfd = stdout;
326 caller_info_fd = stdout;
327
328 progname = argv[0];
329
330 parse_args(&argc, &argv);
331
332 if (argc < 2)
333 help();
334
335 /* this gets set back to zero when we parse the first function */
336 final_pass = 1;
337
338 bin_dir = get_bin_dir(argv[0]);
339 data_dir = get_data_dir(argv[0]);
340
341 allocate_hook_memory();
342 allocate_dynamic_states_array(num_checks);
343 create_function_hook_hash();
344 open_smatch_db(option_db_file);
345 sparse_initialize(argc, argv, &filelist);
346 alloc_valid_ptr_rl();
347
348 for (i = 1; i < ARRAY_SIZE(reg_funcs); i++) {
349 func = reg_funcs[i].func;
350 /* The script IDs start at 1.
351 0 is used for internal stuff. */
352 if (!option_enable || reg_funcs[i].enabled == 1 ||
353 (option_disable && reg_funcs[i].enabled != -1) ||
354 strncmp(reg_funcs[i].name, "register_", 9) == 0)
355 func(i);
356 }
357
358 smatch(filelist);
359 free_string(data_dir);
360
361 if (option_succeed)
362 return 0;
|
323
324 sm_outfd = stdout;
325 sql_outfd = stdout;
326 caller_info_fd = stdout;
327
328 progname = argv[0];
329
330 parse_args(&argc, &argv);
331
332 if (argc < 2)
333 help();
334
335 /* this gets set back to zero when we parse the first function */
336 final_pass = 1;
337
338 bin_dir = get_bin_dir(argv[0]);
339 data_dir = get_data_dir(argv[0]);
340
341 allocate_hook_memory();
342 allocate_dynamic_states_array(num_checks);
343 allocate_tracker_array(num_checks);
344 create_function_hook_hash();
345 open_smatch_db(option_db_file);
346 sparse_initialize(argc, argv, &filelist);
347 alloc_valid_ptr_rl();
348
349 for (i = 1; i < ARRAY_SIZE(reg_funcs); i++) {
350 func = reg_funcs[i].func;
351 /* The script IDs start at 1.
352 0 is used for internal stuff. */
353 if (!option_enable || reg_funcs[i].enabled == 1 ||
354 (option_disable && reg_funcs[i].enabled != -1) ||
355 strncmp(reg_funcs[i].name, "register_", 9) == 0)
356 func(i);
357 }
358
359 smatch(filelist);
360 free_string(data_dir);
361
362 if (option_succeed)
363 return 0;
|