📄 arj_proc.c
字号:
else if(os2switch&&c=='T') { done=!parse_colors(swptr); if(!done) error(M_INVALID_SWITCH, sw); }#endif else if(os2switch&&c=='X') { done=1; if(!sw_tail) error(M_MISSING_FILENAME_ARG, "-2x"); else { exclude_eas=1; #if defined(HAVE_EAS) flist_add_files(&flist_xea, NULL, swptr, 0, 0, 0, NULL); #endif } } else if(*swptr=='+') { *index[num]=1; swptr++; } else if(*swptr=='-') { *index[num]=0; swptr++; } else if(*swptr>='0'&&*swptr<='9') { if(!debug_enabled||strchr(debug_opt, 's')==NULL) { if(*swptr>lim) error(M_INVALID_SWITCH, sw); } *index[num]=(int)(*(swptr++)+1-'0'); } else *index[num]=!*index[num]; /* ARJSFXV parameters */ #elif SFX_LEVEL==ARJSFXV if(c=='G'&&sw_tail) { done=1; garble_enabled=1; garble_password=swptr; } else if(c=='+'&&sw_tail) done=1; else if(c=='&') { if(*swptr=='\0') error(M_INVALID_SWITCH, sw); done=1; debug_enabled=1; debug_opt=swptr; } else if(c=='@') { done=1; arjdisp_enabled=1; arjdisp_ptr=swptr; } else if(c=='!') { done=1; execute_extr_cmd=1; extr_cmd_text=swptr; } else if(c=='$'&&sw_tail) { done=1; handle_labels=1; label_drive=toupper(*swptr); if(!isalpha(*swptr)||strlen(swptr)>2) error(M_INVALID_SWITCH, sw); if(swptr[1]!=':'&&swptr[1]!='\0') error(M_INVALID_SWITCH, sw); } else if(c=='W'&&sw_tail) { done=1; extract_to_file=1; extraction_filename=swptr; } else if(c=='D'&&sw_tail) { done=1; chk_free_space=1; minfree=strtoul(swptr, &swptr, 10); if(toupper(*swptr)=='K') minfree*=1000L; } else if(c=='#'&&sw_tail) { done=1; skip_volumes=1; first_volume_number=strtoul(swptr, &swptr, 10); } else if(c=='O'&&sw_tail) { done=1; gost_cipher=GOST256; arjcrypt_name=swptr; } else if(c=='Z'&&sw_tail) { done=1; assume_yes=1; yes_query_list=swptr; parse_yes_queries(yes_query_list); } else if(*swptr=='+') { *index[num]=1; swptr++; } else if(*swptr=='-') { *index[num]=0; swptr++; } else if(*swptr>='0'&&*swptr<='3') { if(!debug_enabled||strchr(debug_opt, 's')==NULL) { if(*swptr>lim) error(M_INVALID_SWITCH, sw); } *index[num]=(int)(*(swptr++)+1-'0'); } else *index[num]=!*index[num]; /* ARJSFX parameters */ #elif SFX_LEVEL==ARJSFX *sw_index[num]=1; if(c=='G'&&*swptr!='\0') { garble_password=swptr; while(*swptr!='\0') swptr++; } if(c=='!') { extr_cmd_text=swptr; while(*swptr!='\0') swptr++; } #endif #if SFX_LEVEL>=ARJSFXV if(done) { while(*swptr!='\0') swptr++; } #endif } /* This will become obsolete as COLOR_OUTPUT has changed the semantics of quiet_mode - ASR fix 23/01/2003 */#ifndef COLOR_OUTPUT if(quiet_mode&&!arjdisp_enabled) quiet_mode=0;#endif }}#endif#if SFX_LEVEL>=ARJSFXV/* Initializes system variables with default settings prior to setup procedures */void init(){ unsigned int i; #if SFX_LEVEL>=ARJ multivolume_option=0; #else multivolume_option=1; #endif #if SFX_LEVEL>=ARJ for(i=0; i<SEARCH_STR_MAX; i++) search_str[i]=NULL; search_reserve=NULL; reserve_size=0; #endif for(i=0; i<params_max; i++) order[i]=0; #if SFX_LEVEL>=ARJ for(i=0; i<TOTAL_QUERIES; i++) queries_assume_yes[i]=queries_assume_no[i]=0; #endif #if SFX_LEVEL>=ARJ primary_file_type=ARJT_BINARY; #endif listchar=LISTCHAR_DEFAULT; #if SFX_LEVEL>=ARJ lines_per_page=query_screen_height(); #endif listchars_allowed=1; ctrlc_not_busy=1; #if SFX_LEVEL>=ARJ file_args=-1; #else file_args=0; #endif #if SFX_LEVEL<=ARJSFXV extract_expath=0; extract_cmd=0; list_sfx_cmd=0; verbose_list=0; test_sfx_cmd=0; error_occured=0; licensed_sfx=0; logo_shown=0; #endif #if SFX_LEVEL>=ARJ max_filenames=EXT_FILELIST_CAPACITY; ctrlc_processing=0; display_totals=0; lines_scrolled=0; #endif errors=0; #if SFX_LEVEL>=ARJ ts_store(&tested_ftime_newer, OS_SPECIAL, 0); ts_store(&tested_ftime_older, OS_SPECIAL, 0); last_hdr_offset=0L; tmp_archive_used=0; arch_wildcard_allowed=0; file_attr_mask=TAG_FILES; recursion_order=RO_LAST; encryption_id=0; use_ansi_cp=0; filter_fa_arch=0; serialize_exts=0; #else file_garbled=0; #endif allow_any_attrs=0; #if SFX_LEVEL>=ARJ set_target_directory=0; chapter_mode=0; #endif install_errhdl=0; #if SFX_LEVEL<=ARJSFXV prompt_for_directory=0; #endif debug_enabled=0; #if SFX_LEVEL>=ARJ delete_processed=0; run_cmd_at_start=0; arjsec_opt=0; exclude_paths=0; execute_cmd=0; start_at_ext_pos=0; subdir_extraction=0; extm_mode=0; override_archive_exts=0; disable_comment_series=0; skip_century=CENT_DEFAULT; show_filenames_only=0; force_lfn=0; chk_free_space=0; freshen_criteria=FC_NONE; validate_style=0; jh_enabled=0; clear_archive_bit=0; ignore_archive_errors=0; ignore_open_errors=0; detailed_index=0; create_index=0; keep_bak=0; keep_tmp_archive=0; sign_with_arjsec=0; handle_labels=0; listfile_err_opt=0; create_list_file=0; std_list_cmd=0; filelist_storage=0; max_compression=0; custom_method=0; skip_time_attrs=0; indicator_style=0; yes_on_all_queries=0; disable_sharing=0; skip_switch_processing=0; no_file_activity=0; new_files_only=0; filter_same_or_newer=0; rsp_per_line=0; gost_cipher=0; marksym_expansion=0; fnm_matching=0; arcmail_sw=0; dos_host=0; priority.class=priority.delta=0; #endif arjdisp_enabled=0; #if SFX_LEVEL<=ARJSFXV subdir_extraction=0; execute_cmd=0; show_filenames_only=0; chk_free_space=0; freshen_criteria=FC_NONE; validate_style=VALIDATE_ALL; garble_enabled=0; overwrite_ro=0; handle_labels=0; listfile_err_opt=0; std_list_cmd=0; indicator_style=0; yes_on_all_queries=0; disable_sharing=1; skip_switch_processing=0; new_files_only=0; fnm_matching=0; execute_extr_cmd=0; #endif #if SFX_LEVEL>=ARJ protfile_option=0; query_for_each_file=0; set_string_parameter=0; lowercase_names=0; #endif ignore_crc_errors=0; recurse_subdirs=0; quiet_mode=0; #if SFX_LEVEL<=ARJSFXV skip_volumes=0; #endif keep_tmp_file=0; print_with_more=0; #if SFX_LEVEL<=ARJSFXV valid_envelope=0; process_lfn_archive=0; skip_preset_options=0; #endif #if SFX_LEVEL>=ARJ search_mode=0; select_backup_files=0; filter_attrs=0; create_sfx=0; lfn_mode=0; comment_display=0; #endif skip_ts_check=0; #if SFX_LEVEL>=ARJ store_by_suffix=0; test_archive_crc=0; timestamp_override=0; type_override=0; translate_unix_paths=0; #endif update_criteria=UC_NONE; #if SFX_LEVEL>=ARJ verbose_display=0; chk_arj_version=0; beep_between_volumes=0; allow_mv_update=0; mv_cmd_state=0; whole_files_in_mv=0; #endif #if SFX_LEVEL>=ARJSFXV /* To keep v 2.71 order */ use_sfxstub=0; #endif #if SFX_LEVEL>=ARJ assign_work_directory=0; #endif extract_to_file=0; assume_yes=0; kbd_cleanup_on_input=0; skip_append_query=0; prompt_for_mkdir=0; #if SFX_LEVEL>=ARJ query_delete=0; #endif skip_space_query=0; skip_rename_prompt=0; overwrite_existing=0; #if SFX_LEVEL>=ARJ skip_scanned_query=0; #endif skip_next_vol_query=0; #if SFX_LEVEL>=ARJ accept_shortcut_keys=0; #else reg_id=0; first_volume_number=0; #endif #if SFX_LEVEL>=ARJ use_comment=0; supply_comment_file=0; current_chapter=0; chapter_to_process=0; resume_volume_num=0; exit_count=0; left_trim=0; ext_pos=0; #endif label_drive=0; minfree=0L; #if SFX_LEVEL>=ARJ volume_limit=0L; mv_reserve_space=0L; t_volume_offset=0L; #endif av_uncompressed=0L; av_compressed=0L; av_total_files=0; av_total_longnames=0; #if SFX_LEVEL>=ARJ total_size=0L; user_bufsiz=current_bufsiz=BUFSIZ_DEFAULT; ntext=NULL; /* ASR fix for 2.76.06 */ #if TARGET==UNIX sl_entries.list=l_entries.list=NULL; sl_entries.total=sl_entries.alloc=l_entries.total=l_entries.alloc=0; #endif #endif nonexist_name=nonexistent_name; archive_suffixes=malloc_fmsg(M_ARCHIVE_SUFFIXES); #if SFX_LEVEL>=ARJ swptr_t=nullstr; work_directory=nullstr; #endif target_dir=nullstr; #if SFX_LEVEL>=ARJ swptr_hm=nullstr; start_cmd=nullstr; cmd_to_exec=nullstr; archive_ext_list=nullstr; index_name=nullstr; #endif debug_opt=nullstr; #if SFX_LEVEL>=ARJ timestr_newer=nullstr; timestr_older=nullstr; #else extr_cmd_text=nullstr; garble_password=nullstr; #endif arjdisp_ptr=nullstr; #if SFX_LEVEL>=ARJ filename_to_restart=nullstr; mv_cmd=nullstr; arjsec_env_name=nullstr; list_file=nullstr; arjcrypt_name=nullstr; string_parameter=nullstr; swptr_hv=nullstr; time_str=nullstr; #endif extraction_filename=nullstr; yes_query_list=nullstr; #if SFX_LEVEL>=ARJ archive_cmt_name=nullstr; comment_file=nullstr; #endif tmp_tmp_filename[0]='\0'; archive_name[0]='\0'; #if SFX_LEVEL<=ARJSFXV aistream=NULL; atstream=NULL; #endif file_packing=1; #if SFX_LEVEL>=ARJSFXV eh=NULL; valid_ext_hdr=0; #endif #if SFX_LEVEL>=ARJ include_eas=0; exclude_eas=0; crit_eas=0; fix_longnames=0; symlink_accuracy=0; do_chown=0; suppress_hardlinks=0; #endif}/* Returns 1 if the given argument is a command-line switch */int is_switch(char *arg){ int rc; if(!skip_switch_processing&&switch_char!=0&&(int)arg[0]==switch_char) rc=1; else if(!skip_switch_processing&&switch_char==0) rc=(strchr(switch_chars, arg[0])==NULL)?0:1; else rc=0; if(rc&&switch_char==0) switch_char=(int)arg[0]; return(rc);}#endif#if SFX_LEVEL>=ARJ/* Performs general command-line analysis and returns the command being requested. */int preprocess_cmdline(int argc, char *argv[]){ int i; int cmd; char *arg; cmd=0; new_stdout=stdout; disable_arj_sw=0; skip_switch_processing=0; rsp_name=nullstr; /* ASR fix -- 15/10/2000 (ARJ/2-32) */ switch_char=0; install_errhdl=0; quiet_mode=0; use_ansi_cp=0; file_garbled=0; garble_enabled=0; garble_password=nullstr; arj_env_name=malloc_fmsg(M_ARJ_SW); for(i=1; i<argc; i++) { arg=argv[i]; if(is_switch(arg)) { if(arg[1]=='+') { if(arg[2]=='\0') disable_arj_sw=1; else { free_fmsg(arj_env_name); arj_env_name=malloc_str(arg+2); } } else if(arg[1]=='&'&&arg[2]=='\0') install_errhdl=1; else if(arg[1]=='*'&&arg[2]=='\0') quiet_mode=ARJ_QUIET; else if(arg[1]=='*'&&arg[2]=='1'&&arg[3]=='\0') quiet_mode=ARJ_SILENT; else if(arg[1]=='*'&&arg[2]=='2'&&arg[3]=='\0') /* v 2.72 - New function */ quiet_mode=ARJ_QUIET2; else if(toupper(arg[1])=='G') { garble_enabled=1; garble_password=arg+2; } else if(toupper(arg[1])=='H'&&toupper(arg[2])=='Y') { use_ansi_cp=ANSICP_CONVERT; if(arg[3]=='1') use_ansi_cp=ANSICP_SKIP; else if(arg[3]=='2') use_ansi_cp=ANSICP_USE_OEM; else if(arg[3]=='3') use_ansi_cp=ANSICP_USE_ANSI; } else if(arg[0]==arg[1]&&arg[2]=='\0') skip_switch_processing=1; } else { if(i==1&&arg[0]=='@'&&arg[1]!='\0') rsp_name=arg+1; else if(cmd==0&&rsp_name[0]=='\0') { if(!stricmp(arg, cmd_ac)) cmd=ARJ_CMD_ADDC; else if(!stricmp(arg, cmd_cc)) cmd=ARJ_CMD_CNVC;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -