1ea906c41SOllivier Robert /* -*- buffer-read-only: t -*- vi: set ro: 2ea906c41SOllivier Robert * 3ea906c41SOllivier Robert * Prototypes for autoopts 4*a466cc55SCy Schubert * Generated Sun Aug 26 10:44:39 PDT 2018 5ea906c41SOllivier Robert */ 6ea906c41SOllivier Robert #ifndef AUTOOPTS_PROTO_H_GUARD 7ea906c41SOllivier Robert #define AUTOOPTS_PROTO_H_GUARD 1 82b15cb3dSCy Schubert 9*a466cc55SCy Schubert 102b15cb3dSCy Schubert /* 11*a466cc55SCy Schubert * Static declarations from alias.c 122b15cb3dSCy Schubert */ 132b15cb3dSCy Schubert static tSuccess 142b15cb3dSCy Schubert too_many_occurrences(tOptions * opts, tOptDesc * od); 152b15cb3dSCy Schubert 162b15cb3dSCy Schubert /* 17*a466cc55SCy Schubert * Static declarations from autoopts.c 182b15cb3dSCy Schubert */ 192b15cb3dSCy Schubert static void * 20ea906c41SOllivier Robert ao_malloc(size_t sz); 21ea906c41SOllivier Robert 222b15cb3dSCy Schubert static void * 23ea906c41SOllivier Robert ao_realloc(void *p, size_t sz); 24ea906c41SOllivier Robert 252b15cb3dSCy Schubert static char * 26ea906c41SOllivier Robert ao_strdup(char const *str); 27ea906c41SOllivier Robert 282b15cb3dSCy Schubert static tSuccess 292b15cb3dSCy Schubert handle_opt(tOptions * opts, tOptState * o_st); 30ea906c41SOllivier Robert 312b15cb3dSCy Schubert static tSuccess 322b15cb3dSCy Schubert next_opt(tOptions * opts, tOptState * o_st); 33ea906c41SOllivier Robert 342b15cb3dSCy Schubert static tSuccess 352b15cb3dSCy Schubert regular_opts(tOptions * opts); 36ea906c41SOllivier Robert 372b15cb3dSCy Schubert /* 38*a466cc55SCy Schubert * Static declarations from check.c 392b15cb3dSCy Schubert */ 402b15cb3dSCy Schubert static bool 41*a466cc55SCy Schubert has_conflict(tOptions * pOpts, tOptDesc * od); 42*a466cc55SCy Schubert 43*a466cc55SCy Schubert static bool 44*a466cc55SCy Schubert occurs_enough(tOptions * pOpts, tOptDesc * pOD); 45*a466cc55SCy Schubert 46*a466cc55SCy Schubert static bool 472b15cb3dSCy Schubert is_consistent(tOptions * pOpts); 48ea906c41SOllivier Robert 492b15cb3dSCy Schubert /* 50*a466cc55SCy Schubert * Static declarations from configfile.c 512b15cb3dSCy Schubert */ 522b15cb3dSCy Schubert static void 53*a466cc55SCy Schubert file_preset(tOptions * opts, char const * fname, int dir); 54*a466cc55SCy Schubert 55*a466cc55SCy Schubert static char * 56*a466cc55SCy Schubert handle_comment(char * txt); 57*a466cc55SCy Schubert 58*a466cc55SCy Schubert static char * 59*a466cc55SCy Schubert handle_cfg(tOptions * opts, tOptState * ost, char * txt, int dir); 60*a466cc55SCy Schubert 61*a466cc55SCy Schubert static char * 62*a466cc55SCy Schubert handle_directive(tOptions * opts, char * txt); 63*a466cc55SCy Schubert 64*a466cc55SCy Schubert static char * 65*a466cc55SCy Schubert aoflags_directive(tOptions * opts, char * txt); 66*a466cc55SCy Schubert 67*a466cc55SCy Schubert static char * 68*a466cc55SCy Schubert program_directive(tOptions * opts, char * txt); 69*a466cc55SCy Schubert 70*a466cc55SCy Schubert static char * 71*a466cc55SCy Schubert handle_section(tOptions * opts, char * txt); 72*a466cc55SCy Schubert 73*a466cc55SCy Schubert static int 74*a466cc55SCy Schubert parse_xml_encoding(char ** ppz); 75*a466cc55SCy Schubert 76*a466cc55SCy Schubert static char * 77*a466cc55SCy Schubert trim_xml_text(char * intxt, char const * pznm, tOptionLoadMode mode); 78*a466cc55SCy Schubert 79*a466cc55SCy Schubert static void 80*a466cc55SCy Schubert cook_xml_text(char * pzData); 81*a466cc55SCy Schubert 82*a466cc55SCy Schubert static char * 83*a466cc55SCy Schubert handle_struct(tOptions * opts, tOptState * ost, char * txt, int dir); 84*a466cc55SCy Schubert 85*a466cc55SCy Schubert static void 862b15cb3dSCy Schubert intern_file_load(tOptions * opts); 87ea906c41SOllivier Robert 882b15cb3dSCy Schubert static char const * 892b15cb3dSCy Schubert parse_attrs(tOptions * opts, char const * txt, tOptionLoadMode * pMode, 90ea906c41SOllivier Robert tOptionValue * pType); 91ea906c41SOllivier Robert 92*a466cc55SCy Schubert static char const * 93*a466cc55SCy Schubert parse_keyword(tOptions * opts, char const * txt, tOptionValue * typ); 94*a466cc55SCy Schubert 95*a466cc55SCy Schubert static char const * 96*a466cc55SCy Schubert parse_set_mem(tOptions * opts, char const * txt, tOptionValue * typ); 97*a466cc55SCy Schubert 98*a466cc55SCy Schubert static char const * 99*a466cc55SCy Schubert parse_value(char const * txt, tOptionValue * typ); 100*a466cc55SCy Schubert 1012b15cb3dSCy Schubert /* 102*a466cc55SCy Schubert * Static declarations from cook.c 103*a466cc55SCy Schubert */ 104*a466cc55SCy Schubert static char * 105*a466cc55SCy Schubert nl_count(char * start, char * end, int * lnct_p); 106*a466cc55SCy Schubert 107*a466cc55SCy Schubert static bool 108*a466cc55SCy Schubert contiguous_quote(char ** pps, char * pq, int * lnct_p); 109*a466cc55SCy Schubert 110*a466cc55SCy Schubert /* 111*a466cc55SCy Schubert * Static declarations from enum.c 112*a466cc55SCy Schubert */ 113*a466cc55SCy Schubert static void 114*a466cc55SCy Schubert enum_err(tOptions * pOpts, tOptDesc * pOD, 115*a466cc55SCy Schubert char const * const * paz_names, int name_ct); 116*a466cc55SCy Schubert 117*a466cc55SCy Schubert static uintptr_t 118*a466cc55SCy Schubert find_name(char const * name, tOptions * pOpts, tOptDesc * pOD, 119*a466cc55SCy Schubert char const * const * paz_names, unsigned int name_ct); 120*a466cc55SCy Schubert 121*a466cc55SCy Schubert static void 122*a466cc55SCy Schubert set_memb_shell(tOptions * pOpts, tOptDesc * pOD, char const * const * paz_names, 123*a466cc55SCy Schubert unsigned int name_ct); 124*a466cc55SCy Schubert 125*a466cc55SCy Schubert static void 126*a466cc55SCy Schubert set_memb_names(tOptions * opts, tOptDesc * od, char const * const * nm_list, 127*a466cc55SCy Schubert unsigned int nm_ct); 128*a466cc55SCy Schubert 129*a466cc55SCy Schubert static uintptr_t 130*a466cc55SCy Schubert check_membership_start(tOptDesc * od, char const ** argp, bool * invert); 131*a466cc55SCy Schubert 132*a466cc55SCy Schubert static uintptr_t 133*a466cc55SCy Schubert find_member_bit(tOptions * opts, tOptDesc * od, char const * pz, int len, 134*a466cc55SCy Schubert char const * const * nm_list, unsigned int nm_ct); 135*a466cc55SCy Schubert 136*a466cc55SCy Schubert /* 137*a466cc55SCy Schubert * Static declarations from env.c 1382b15cb3dSCy Schubert */ 1392b15cb3dSCy Schubert static void 140ea906c41SOllivier Robert doPrognameEnv(tOptions * pOpts, teEnvPresetType type); 141ea906c41SOllivier Robert 1422b15cb3dSCy Schubert static void 143*a466cc55SCy Schubert do_env_opt(tOptState * os, char * env_name, 144*a466cc55SCy Schubert tOptions * pOpts, teEnvPresetType type); 145*a466cc55SCy Schubert 146*a466cc55SCy Schubert static void 1472b15cb3dSCy Schubert env_presets(tOptions * pOpts, teEnvPresetType type); 148ea906c41SOllivier Robert 1492b15cb3dSCy Schubert /* 150*a466cc55SCy Schubert * Static declarations from file.c 1512b15cb3dSCy Schubert */ 152*a466cc55SCy Schubert static void 153*a466cc55SCy Schubert check_existence(teOptFileType ftype, tOptions * pOpts, tOptDesc * pOD); 154*a466cc55SCy Schubert 155*a466cc55SCy Schubert static void 156*a466cc55SCy Schubert open_file_fd(tOptions * pOpts, tOptDesc * pOD, tuFileMode mode); 157*a466cc55SCy Schubert 158*a466cc55SCy Schubert static void 159*a466cc55SCy Schubert fopen_file_fp(tOptions * pOpts, tOptDesc * pOD, tuFileMode mode); 160*a466cc55SCy Schubert 161*a466cc55SCy Schubert /* 162*a466cc55SCy Schubert * Static declarations from find.c 163*a466cc55SCy Schubert */ 164*a466cc55SCy Schubert static int 165*a466cc55SCy Schubert parse_opt(char const ** nm_pp, char ** arg_pp, char * buf, size_t bufsz); 166*a466cc55SCy Schubert 167*a466cc55SCy Schubert static void 168*a466cc55SCy Schubert opt_ambiguities(tOptions * opts, char const * name, int nm_len); 169*a466cc55SCy Schubert 170*a466cc55SCy Schubert static int 171*a466cc55SCy Schubert opt_match_ct(tOptions * opts, char const * name, int nm_len, 172*a466cc55SCy Schubert int * ixp, bool * disable); 173*a466cc55SCy Schubert 174*a466cc55SCy Schubert static tSuccess 175*a466cc55SCy Schubert opt_set(tOptions * opts, char * arg, int idx, bool disable, tOptState * st); 176*a466cc55SCy Schubert 177*a466cc55SCy Schubert static tSuccess 178*a466cc55SCy Schubert opt_unknown(tOptions * opts, char const * name, char * arg, tOptState * st); 179*a466cc55SCy Schubert 180*a466cc55SCy Schubert static tSuccess 181*a466cc55SCy Schubert opt_ambiguous(tOptions * opts, char const * name, int match_ct); 182*a466cc55SCy Schubert 1832b15cb3dSCy Schubert static tSuccess 1842b15cb3dSCy Schubert opt_find_long(tOptions * opts, char const * opt_name, tOptState * state); 185ea906c41SOllivier Robert 1862b15cb3dSCy Schubert static tSuccess 1872b15cb3dSCy Schubert opt_find_short(tOptions * pOpts, uint_t optValue, tOptState * pOptState); 188ea906c41SOllivier Robert 1892b15cb3dSCy Schubert static tSuccess 190*a466cc55SCy Schubert get_opt_arg_must(tOptions * opts, tOptState * o_st); 191*a466cc55SCy Schubert 192*a466cc55SCy Schubert static tSuccess 193*a466cc55SCy Schubert get_opt_arg_may(tOptions * pOpts, tOptState * o_st); 194*a466cc55SCy Schubert 195*a466cc55SCy Schubert static tSuccess 196*a466cc55SCy Schubert get_opt_arg_none(tOptions * pOpts, tOptState * o_st); 197*a466cc55SCy Schubert 198*a466cc55SCy Schubert static tSuccess 1992b15cb3dSCy Schubert get_opt_arg(tOptions * opts, tOptState * o_st); 200ea906c41SOllivier Robert 2012b15cb3dSCy Schubert static tSuccess 2022b15cb3dSCy Schubert find_opt(tOptions * opts, tOptState * o_st); 203ea906c41SOllivier Robert 2042b15cb3dSCy Schubert /* 205*a466cc55SCy Schubert * Static declarations from init.c 2062b15cb3dSCy Schubert */ 2072b15cb3dSCy Schubert static tSuccess 2082b15cb3dSCy Schubert validate_struct(tOptions * opts, char const * pname); 2092b15cb3dSCy Schubert 2102b15cb3dSCy Schubert static tSuccess 2112b15cb3dSCy Schubert immediate_opts(tOptions * opts); 2122b15cb3dSCy Schubert 213*a466cc55SCy Schubert static tSuccess 214*a466cc55SCy Schubert do_presets(tOptions * opts); 215*a466cc55SCy Schubert 2162b15cb3dSCy Schubert static bool 2172b15cb3dSCy Schubert ao_initialize(tOptions * opts, int a_ct, char ** a_v); 2182b15cb3dSCy Schubert 2192b15cb3dSCy Schubert /* 220*a466cc55SCy Schubert * Static declarations from load.c 2212b15cb3dSCy Schubert */ 222*a466cc55SCy Schubert static bool 223*a466cc55SCy Schubert get_realpath(char * buf, size_t b_sz); 224*a466cc55SCy Schubert 225*a466cc55SCy Schubert static bool 226*a466cc55SCy Schubert add_prog_path(char * buf, int b_sz, char const * fname, char const * prg_path); 227*a466cc55SCy Schubert 228*a466cc55SCy Schubert static bool 229*a466cc55SCy Schubert add_env_val(char * buf, int buf_sz, char const * name); 230*a466cc55SCy Schubert 2312b15cb3dSCy Schubert static void 2322b15cb3dSCy Schubert munge_str(char * txt, tOptionLoadMode mode); 2332b15cb3dSCy Schubert 234*a466cc55SCy Schubert static char * 235*a466cc55SCy Schubert assemble_arg_val(char * txt, tOptionLoadMode mode); 236*a466cc55SCy Schubert 237*a466cc55SCy Schubert static char * 238*a466cc55SCy Schubert trim_quotes(char * arg); 239*a466cc55SCy Schubert 240*a466cc55SCy Schubert static bool 241*a466cc55SCy Schubert direction_ok(opt_state_mask_t f, int dir); 242*a466cc55SCy Schubert 2432b15cb3dSCy Schubert static void 2442b15cb3dSCy Schubert load_opt_line(tOptions * opts, tOptState * opt_state, char * line, 2452b15cb3dSCy Schubert tDirection direction, tOptionLoadMode load_mode ); 2462b15cb3dSCy Schubert 2472b15cb3dSCy Schubert /* 248*a466cc55SCy Schubert * Static declarations from makeshell.c 2492b15cb3dSCy Schubert */ 250*a466cc55SCy Schubert lo_noreturn static void 2512b15cb3dSCy Schubert option_exits(int exit_code); 2522b15cb3dSCy Schubert 253*a466cc55SCy Schubert lo_noreturn static void 2542b15cb3dSCy Schubert ao_bug(char const * msg); 2552b15cb3dSCy Schubert 2562b15cb3dSCy Schubert static void 2572b15cb3dSCy Schubert fserr_warn(char const * prog, char const * op, char const * fname); 2582b15cb3dSCy Schubert 259*a466cc55SCy Schubert lo_noreturn static void 2602b15cb3dSCy Schubert fserr_exit(char const * prog, char const * op, char const * fname); 2612b15cb3dSCy Schubert 262*a466cc55SCy Schubert static void 263*a466cc55SCy Schubert emit_var_text(char const * prog, char const * var, int fdin); 264*a466cc55SCy Schubert 265*a466cc55SCy Schubert static void 266*a466cc55SCy Schubert text_to_var(tOptions * opts, teTextTo which, tOptDesc * od); 267*a466cc55SCy Schubert 268*a466cc55SCy Schubert static void 269*a466cc55SCy Schubert emit_usage(tOptions * opts); 270*a466cc55SCy Schubert 271*a466cc55SCy Schubert static void 272*a466cc55SCy Schubert emit_wrapup(tOptions * opts); 273*a466cc55SCy Schubert 274*a466cc55SCy Schubert static void 275*a466cc55SCy Schubert emit_setup(tOptions * opts); 276*a466cc55SCy Schubert 277*a466cc55SCy Schubert static void 278*a466cc55SCy Schubert emit_action(tOptions * opts, tOptDesc * od); 279*a466cc55SCy Schubert 280*a466cc55SCy Schubert static void 281*a466cc55SCy Schubert emit_inaction(tOptions * opts, tOptDesc * od); 282*a466cc55SCy Schubert 283*a466cc55SCy Schubert static void 284*a466cc55SCy Schubert emit_flag(tOptions * opts); 285*a466cc55SCy Schubert 286*a466cc55SCy Schubert static void 287*a466cc55SCy Schubert emit_match_expr(char const * name, tOptDesc * cod, tOptions * opts); 288*a466cc55SCy Schubert 289*a466cc55SCy Schubert static void 290*a466cc55SCy Schubert emit_long(tOptions * opts); 291*a466cc55SCy Schubert 292*a466cc55SCy Schubert static char * 293*a466cc55SCy Schubert load_old_output(char const * fname, char const * pname); 294*a466cc55SCy Schubert 295*a466cc55SCy Schubert static void 296*a466cc55SCy Schubert open_out(char const * fname, char const * pname); 297*a466cc55SCy Schubert 2982b15cb3dSCy Schubert /* 299*a466cc55SCy Schubert * Static declarations from nested.c 3002b15cb3dSCy Schubert */ 3012b15cb3dSCy Schubert static void 302*a466cc55SCy Schubert remove_continuation(char * src); 303*a466cc55SCy Schubert 304*a466cc55SCy Schubert static char const * 305*a466cc55SCy Schubert scan_q_str(char const * pzTxt); 306*a466cc55SCy Schubert 307*a466cc55SCy Schubert static tOptionValue * 308*a466cc55SCy Schubert add_string(void ** pp, char const * name, size_t nm_len, 309*a466cc55SCy Schubert char const * val, size_t d_len); 310*a466cc55SCy Schubert 311*a466cc55SCy Schubert static tOptionValue * 312*a466cc55SCy Schubert add_bool(void ** pp, char const * name, size_t nm_len, 313*a466cc55SCy Schubert char const * val, size_t d_len); 314*a466cc55SCy Schubert 315*a466cc55SCy Schubert static tOptionValue * 316*a466cc55SCy Schubert add_number(void ** pp, char const * name, size_t nm_len, 317*a466cc55SCy Schubert char const * val, size_t d_len); 318*a466cc55SCy Schubert 319*a466cc55SCy Schubert static tOptionValue * 320*a466cc55SCy Schubert add_nested(void ** pp, char const * name, size_t nm_len, 321*a466cc55SCy Schubert char * val, size_t d_len); 322*a466cc55SCy Schubert 323*a466cc55SCy Schubert static char const * 324*a466cc55SCy Schubert scan_name(char const * name, tOptionValue * res); 325*a466cc55SCy Schubert 326*a466cc55SCy Schubert static char const * 327*a466cc55SCy Schubert unnamed_xml(char const * txt); 328*a466cc55SCy Schubert 329*a466cc55SCy Schubert static char const * 330*a466cc55SCy Schubert scan_xml_name(char const * name, size_t * nm_len, tOptionValue * val); 331*a466cc55SCy Schubert 332*a466cc55SCy Schubert static char const * 333*a466cc55SCy Schubert find_end_xml(char const * src, size_t nm_len, char const * val, size_t * len); 334*a466cc55SCy Schubert 335*a466cc55SCy Schubert static char const * 336*a466cc55SCy Schubert scan_xml(char const * xml_name, tOptionValue * res_val); 337*a466cc55SCy Schubert 338*a466cc55SCy Schubert static void 3392b15cb3dSCy Schubert unload_arg_list(tArgList * arg_list); 3402b15cb3dSCy Schubert 341*a466cc55SCy Schubert static void 342*a466cc55SCy Schubert sort_list(tArgList * arg_list); 343*a466cc55SCy Schubert 3442b15cb3dSCy Schubert static tOptionValue * 3452b15cb3dSCy Schubert optionLoadNested(char const * text, char const * name, size_t nm_len); 3462b15cb3dSCy Schubert 3472b15cb3dSCy Schubert static int 3482b15cb3dSCy Schubert get_special_char(char const ** ppz, int * ct); 3492b15cb3dSCy Schubert 3502b15cb3dSCy Schubert static void 3512b15cb3dSCy Schubert emit_special_char(FILE * fp, int ch); 3522b15cb3dSCy Schubert 3532b15cb3dSCy Schubert /* 354*a466cc55SCy Schubert * Static declarations from parse-duration.c 3552b15cb3dSCy Schubert */ 356*a466cc55SCy Schubert static unsigned long 357*a466cc55SCy Schubert str_const_to_ul (cch_t * str, cch_t ** ppz, int base); 358*a466cc55SCy Schubert 359*a466cc55SCy Schubert static long 360*a466cc55SCy Schubert str_const_to_l (cch_t * str, cch_t ** ppz, int base); 361*a466cc55SCy Schubert 362*a466cc55SCy Schubert static time_t 363*a466cc55SCy Schubert scale_n_add (time_t base, time_t val, int scale); 364*a466cc55SCy Schubert 365*a466cc55SCy Schubert static time_t 366*a466cc55SCy Schubert parse_hr_min_sec (time_t start, cch_t * pz); 367*a466cc55SCy Schubert 368*a466cc55SCy Schubert static time_t 369*a466cc55SCy Schubert parse_scaled_value (time_t base, cch_t ** ppz, cch_t * endp, int scale); 370*a466cc55SCy Schubert 371*a466cc55SCy Schubert static time_t 372*a466cc55SCy Schubert parse_year_month_day (cch_t * pz, cch_t * ps); 373*a466cc55SCy Schubert 374*a466cc55SCy Schubert static time_t 375*a466cc55SCy Schubert parse_yearmonthday (cch_t * in_pz); 376*a466cc55SCy Schubert 377*a466cc55SCy Schubert static time_t 378*a466cc55SCy Schubert parse_YMWD (cch_t * pz); 379*a466cc55SCy Schubert 380*a466cc55SCy Schubert static time_t 381*a466cc55SCy Schubert parse_hour_minute_second (cch_t * pz, cch_t * ps); 382*a466cc55SCy Schubert 383*a466cc55SCy Schubert static time_t 384*a466cc55SCy Schubert parse_hourminutesecond (cch_t * in_pz); 385*a466cc55SCy Schubert 386*a466cc55SCy Schubert static time_t 387*a466cc55SCy Schubert parse_HMS (cch_t * pz); 388*a466cc55SCy Schubert 389*a466cc55SCy Schubert static time_t 390*a466cc55SCy Schubert parse_time (cch_t * pz); 391*a466cc55SCy Schubert 392*a466cc55SCy Schubert static char * 393*a466cc55SCy Schubert trim (char * pz); 394*a466cc55SCy Schubert 395*a466cc55SCy Schubert static time_t 396*a466cc55SCy Schubert parse_period (cch_t * in_pz); 397*a466cc55SCy Schubert 398*a466cc55SCy Schubert static time_t 399*a466cc55SCy Schubert parse_non_iso8601 (cch_t * pz); 400*a466cc55SCy Schubert 401*a466cc55SCy Schubert /* 402*a466cc55SCy Schubert * Static declarations from pgusage.c 403*a466cc55SCy Schubert */ 404*a466cc55SCy Schubert static inline FILE * 405*a466cc55SCy Schubert open_tmp_usage(char ** buf); 406*a466cc55SCy Schubert 407*a466cc55SCy Schubert static inline char * 408*a466cc55SCy Schubert mk_pager_cmd(char const * fname); 409*a466cc55SCy Schubert 410*a466cc55SCy Schubert /* 411*a466cc55SCy Schubert * Static declarations from putshell.c 412*a466cc55SCy Schubert */ 413*a466cc55SCy Schubert static size_t 414*a466cc55SCy Schubert string_size(char const * scan, size_t nl_len); 415*a466cc55SCy Schubert 416*a466cc55SCy Schubert static char const * 417*a466cc55SCy Schubert print_quoted_apostrophes(char const * str); 418*a466cc55SCy Schubert 419*a466cc55SCy Schubert static void 420*a466cc55SCy Schubert print_quot_str(char const * str); 421*a466cc55SCy Schubert 422*a466cc55SCy Schubert static void 423*a466cc55SCy Schubert print_enumeration(tOptions * pOpts, tOptDesc * pOD); 424*a466cc55SCy Schubert 425*a466cc55SCy Schubert static void 426*a466cc55SCy Schubert print_membership(tOptions * pOpts, tOptDesc * pOD); 427*a466cc55SCy Schubert 428*a466cc55SCy Schubert static void 429*a466cc55SCy Schubert print_stacked_arg(tOptions * pOpts, tOptDesc * pOD); 430*a466cc55SCy Schubert 431*a466cc55SCy Schubert static void 432*a466cc55SCy Schubert print_reordering(tOptions * opts); 433*a466cc55SCy Schubert 434*a466cc55SCy Schubert /* 435*a466cc55SCy Schubert * Static declarations from reset.c 436*a466cc55SCy Schubert */ 437*a466cc55SCy Schubert static void 438*a466cc55SCy Schubert optionReset(tOptions * pOpts, tOptDesc * pOD); 439*a466cc55SCy Schubert 440*a466cc55SCy Schubert static void 441*a466cc55SCy Schubert optionResetEverything(tOptions * pOpts); 442*a466cc55SCy Schubert 443*a466cc55SCy Schubert /* 444*a466cc55SCy Schubert * Static declarations from restore.c 445*a466cc55SCy Schubert */ 446*a466cc55SCy Schubert static void 447*a466cc55SCy Schubert fixupSavedOptionArgs(tOptions * pOpts); 448*a466cc55SCy Schubert 449*a466cc55SCy Schubert /* 450*a466cc55SCy Schubert * Static declarations from save.c 451*a466cc55SCy Schubert */ 452*a466cc55SCy Schubert static char const * 453*a466cc55SCy Schubert find_dir_name(tOptions * opts, int * p_free); 454*a466cc55SCy Schubert 455*a466cc55SCy Schubert static char const * 456*a466cc55SCy Schubert find_file_name(tOptions * opts, int * p_free_name); 457*a466cc55SCy Schubert 458*a466cc55SCy Schubert static void 459*a466cc55SCy Schubert prt_entry(FILE * fp, tOptDesc * od, char const * l_arg, save_flags_mask_t save_fl); 460*a466cc55SCy Schubert 461*a466cc55SCy Schubert static void 462*a466cc55SCy Schubert prt_value(FILE * fp, int depth, tOptDesc * od, tOptionValue const * ovp); 463*a466cc55SCy Schubert 464*a466cc55SCy Schubert static void 465*a466cc55SCy Schubert prt_string(FILE * fp, char const * name, char const * pz); 466*a466cc55SCy Schubert 467*a466cc55SCy Schubert static void 468*a466cc55SCy Schubert prt_val_list(FILE * fp, char const * name, tArgList * al); 469*a466cc55SCy Schubert 470*a466cc55SCy Schubert static void 471*a466cc55SCy Schubert prt_nested(FILE * fp, tOptDesc * od, save_flags_mask_t save_fl); 472*a466cc55SCy Schubert 473*a466cc55SCy Schubert static void 474*a466cc55SCy Schubert remove_settings(tOptions * opts, char const * fname); 475*a466cc55SCy Schubert 476*a466cc55SCy Schubert static FILE * 477*a466cc55SCy Schubert open_sv_file(tOptions * opts, save_flags_mask_t save_fl); 478*a466cc55SCy Schubert 479*a466cc55SCy Schubert static void 480*a466cc55SCy Schubert prt_no_arg_opt(FILE * fp, tOptDesc * vod, tOptDesc * pod, save_flags_mask_t save_fl); 481*a466cc55SCy Schubert 482*a466cc55SCy Schubert static void 483*a466cc55SCy Schubert prt_str_arg(FILE * fp, tOptDesc * od, save_flags_mask_t save_fl); 484*a466cc55SCy Schubert 485*a466cc55SCy Schubert static void 486*a466cc55SCy Schubert prt_enum_arg(FILE * fp, tOptDesc * od, save_flags_mask_t save_fl); 487*a466cc55SCy Schubert 488*a466cc55SCy Schubert static void 489*a466cc55SCy Schubert prt_set_arg(FILE * fp, tOptDesc * od, save_flags_mask_t save_fl); 490*a466cc55SCy Schubert 491*a466cc55SCy Schubert static void 492*a466cc55SCy Schubert prt_file_arg(FILE * fp, tOptDesc * od, tOptions * opts, save_flags_mask_t save_fl); 493*a466cc55SCy Schubert 494*a466cc55SCy Schubert /* 495*a466cc55SCy Schubert * Static declarations from sort.c 496*a466cc55SCy Schubert */ 497*a466cc55SCy Schubert static tSuccess 498*a466cc55SCy Schubert must_arg(tOptions * opts, char * arg_txt, tOptState * pOS, 499*a466cc55SCy Schubert char ** opt_txt, uint32_t * opt_idx); 500*a466cc55SCy Schubert 501*a466cc55SCy Schubert static tSuccess 502*a466cc55SCy Schubert maybe_arg(tOptions * opts, char * arg_txt, tOptState * pOS, 503*a466cc55SCy Schubert char ** opt_txt, uint32_t * opt_idx); 504*a466cc55SCy Schubert 505*a466cc55SCy Schubert static tSuccess 506*a466cc55SCy Schubert short_opt_ck(tOptions * opts, char * arg_txt, tOptState * pOS, 507*a466cc55SCy Schubert char ** opt_txt, uint32_t * opt_idx); 508*a466cc55SCy Schubert 5092b15cb3dSCy Schubert static void 5102b15cb3dSCy Schubert optionSort(tOptions * opts); 5112b15cb3dSCy Schubert 5122b15cb3dSCy Schubert /* 513*a466cc55SCy Schubert * Static declarations from stack.c 5142b15cb3dSCy Schubert */ 5152b15cb3dSCy Schubert static void 516ea906c41SOllivier Robert addArgListEntry(void ** ppAL, void * entry); 517ea906c41SOllivier Robert 5182b15cb3dSCy Schubert /* 519*a466cc55SCy Schubert * Static declarations from text_mmap.c 5202b15cb3dSCy Schubert */ 5212b15cb3dSCy Schubert static void 522*a466cc55SCy Schubert load_text_file(tmap_info_t * mapinfo, char const * pzFile); 523*a466cc55SCy Schubert 524*a466cc55SCy Schubert static void 525*a466cc55SCy Schubert validate_mmap(char const * fname, int prot, int flags, tmap_info_t * mapinfo); 526*a466cc55SCy Schubert 527*a466cc55SCy Schubert static void 528*a466cc55SCy Schubert close_mmap_files(tmap_info_t * mi); 529*a466cc55SCy Schubert 530*a466cc55SCy Schubert /* 531*a466cc55SCy Schubert * Static declarations from tokenize.c 532*a466cc55SCy Schubert */ 533*a466cc55SCy Schubert static void 534*a466cc55SCy Schubert copy_cooked(ch_t ** ppDest, char const ** ppSrc); 535*a466cc55SCy Schubert 536*a466cc55SCy Schubert static void 537*a466cc55SCy Schubert copy_raw(ch_t ** ppDest, char const ** ppSrc); 538*a466cc55SCy Schubert 539*a466cc55SCy Schubert static token_list_t * 540*a466cc55SCy Schubert alloc_token_list(char const * str); 541*a466cc55SCy Schubert 542*a466cc55SCy Schubert /* 543*a466cc55SCy Schubert * Static declarations from usage.c 544*a466cc55SCy Schubert */ 545*a466cc55SCy Schubert static unsigned int 546*a466cc55SCy Schubert parse_usage_flags(ao_flag_names_t const * fnt, char const * txt); 547*a466cc55SCy Schubert 548*a466cc55SCy Schubert static void 5492b15cb3dSCy Schubert set_usage_flags(tOptions * opts, char const * flg_txt); 5502b15cb3dSCy Schubert 551*a466cc55SCy Schubert static inline bool 552*a466cc55SCy Schubert do_gnu_usage(tOptions * pOpts); 553*a466cc55SCy Schubert 554*a466cc55SCy Schubert static inline bool 555*a466cc55SCy Schubert skip_misuse_usage(tOptions * pOpts); 556*a466cc55SCy Schubert 557*a466cc55SCy Schubert static void 558*a466cc55SCy Schubert print_offer_usage(tOptions * opts); 559*a466cc55SCy Schubert 560*a466cc55SCy Schubert static void 561*a466cc55SCy Schubert print_usage_details(tOptions * opts, int exit_code); 562*a466cc55SCy Schubert 563*a466cc55SCy Schubert static void 564*a466cc55SCy Schubert print_one_paragraph(char const * text, bool plain, FILE * fp); 565*a466cc55SCy Schubert 566*a466cc55SCy Schubert static void 567*a466cc55SCy Schubert prt_conflicts(tOptions * opts, tOptDesc * od); 568*a466cc55SCy Schubert 569*a466cc55SCy Schubert static void 570*a466cc55SCy Schubert prt_one_vendor(tOptions * opts, tOptDesc * od, 571*a466cc55SCy Schubert arg_types_t * argtp, char const * usefmt); 572*a466cc55SCy Schubert 573*a466cc55SCy Schubert static void 574*a466cc55SCy Schubert prt_vendor_opts(tOptions * opts, char const * title); 575*a466cc55SCy Schubert 576*a466cc55SCy Schubert static void 577*a466cc55SCy Schubert prt_extd_usage(tOptions * opts, tOptDesc * od, char const * title); 578*a466cc55SCy Schubert 579*a466cc55SCy Schubert static void 580*a466cc55SCy Schubert prt_ini_list(char const * const * papz, char const * ini_file, 581*a466cc55SCy Schubert char const * path_nm); 582*a466cc55SCy Schubert 583*a466cc55SCy Schubert static void 584*a466cc55SCy Schubert prt_preamble(tOptions * opts, tOptDesc * od, arg_types_t * at); 585*a466cc55SCy Schubert 586*a466cc55SCy Schubert static void 587*a466cc55SCy Schubert prt_one_usage(tOptions * opts, tOptDesc * od, arg_types_t * at); 588*a466cc55SCy Schubert 589*a466cc55SCy Schubert static void 590*a466cc55SCy Schubert prt_opt_usage(tOptions * opts, int ex_code, char const * title); 591*a466cc55SCy Schubert 592*a466cc55SCy Schubert static void 593*a466cc55SCy Schubert prt_prog_detail(tOptions * opts); 594*a466cc55SCy Schubert 595*a466cc55SCy Schubert static int 596*a466cc55SCy Schubert setGnuOptFmts(tOptions * opts, char const ** ptxt); 597*a466cc55SCy Schubert 598*a466cc55SCy Schubert static int 599*a466cc55SCy Schubert setStdOptFmts(tOptions * opts, char const ** ptxt); 600*a466cc55SCy Schubert 601*a466cc55SCy Schubert /* 602*a466cc55SCy Schubert * Static declarations from version.c 603*a466cc55SCy Schubert */ 604*a466cc55SCy Schubert static void 605*a466cc55SCy Schubert emit_first_line( 606*a466cc55SCy Schubert FILE * fp, char const * alt1, char const * alt2, char const * alt3); 607*a466cc55SCy Schubert 608*a466cc55SCy Schubert static void 609*a466cc55SCy Schubert emit_simple_ver(tOptions * o, FILE * fp); 610*a466cc55SCy Schubert 611*a466cc55SCy Schubert static void 612*a466cc55SCy Schubert emit_copy_full(tOptions * o, FILE * fp); 613*a466cc55SCy Schubert 614*a466cc55SCy Schubert static void 615*a466cc55SCy Schubert emit_copy_note(tOptions * opts, FILE * fp); 616*a466cc55SCy Schubert 617*a466cc55SCy Schubert static void 618*a466cc55SCy Schubert print_ver(tOptions * opts, tOptDesc * od, FILE * fp, bool call_exit); 619*a466cc55SCy Schubert 620ea906c41SOllivier Robert #endif /* AUTOOPTS_PROTO_H_GUARD */ 621