📄 arj_proc.c
字号:
swptr++; #if SFX_LEVEL>=ARJ hswitch=jswitch=os2switch=0; if(toupper(*swptr)=='H'&&*(swptr+1)=='2') swptr++; if(*swptr=='2') { os2switch=1; swptr++; } #endif #if SFX_LEVEL>=ARJSFXV done=0; #endif while((c=(unsigned int)*(swptr++))!='\0') { c=toupper(c); #if SFX_LEVEL>=ARJ if(jswitch) { table=M_JSW_TABLE; params=M_JSW_PARAMS; index=jsw_index; } else if(hswitch) { table=M_HSW_TABLE; params=M_HSW_PARAMS; index=hsw_index; } else if(os2switch) { table=M_OS2SW_TABLE; params=M_OS2SW_PARAMS; index=os2sw_index; } else { table=M_SW_TABLE; params=M_SW_PARAMS; index=sw_index; } #elif SFX_LEVEL>=ARJSFXV table=M_SW_TABLE; params=M_SW_PARAMS; index=sw_index; #endif #if SFX_LEVEL>=ARJSFXV entry=msg_strchr(table, (char)c); #else entry=msg_strchr(M_SW_TABLE, (char)c); #endif if(entry==NULL) { #if SFX_LEVEL>=ARJSFXV error(M_INVALID_SWITCH, sw); #else msg_cprintf(0, M_ARJSFX_BANNER, exe_name); msg_cprintf(0, M_INVALID_SWITCH, (char)c); check_fmsg(CHKMSG_NOSKIP); exit(ARJSFX_ERL_ERROR); #endif } #if SFX_LEVEL>=ARJSFXV num=entry-table; #else num=entry-M_SW_TABLE; #endif #if SFX_LEVEL>=ARJSFXV lim=params[num]; sw_tail=get_switch_state(swptr); #endif /* ARJ parameters */ #if SFX_LEVEL>=ARJ if(!jswitch&&!hswitch&&!os2switch&&c=='G'&&sw_tail) { done=1; garble_enabled=1; garble_password=swptr; } else if(!jswitch&&!hswitch&&!os2switch&&c=='E'&&sw_tail) { done=1; left_trim=(unsigned int)strtoul(swptr, &swptr, 10); exclude_paths=(left_trim==0)?EP_PATH:EP_BASEDIR; } else if(!jswitch&&!hswitch&&!os2switch&&c=='L'&&sw_tail) { done=1; create_list_file=1; list_file=swptr; } else if(!jswitch&&!hswitch&&!os2switch&&c=='O'&&sw_tail) { done=1; if(toupper(*swptr)=='B') { if(*++swptr=='-') filter_older=TCHECK_NOTHING; else { filter_older=TCHECK_FTIME; timestr_older=swptr; } } else if(toupper(*swptr)=='D') { swptr++; if(*swptr=='-') filter_same_or_newer=TCHECK_NOTHING; else if(toupper(*swptr)=='B') { filter_older=TCHECK_NDAYS; swptr++; timestr_older=swptr; } else { filter_same_or_newer=TCHECK_NDAYS; timestr_newer=swptr; } } else if(toupper(*swptr)=='C') { swptr++; if(toupper(*swptr)=='B') { filter_older=TCHECK_CTIME; swptr++; timestr_older=swptr; } else { filter_same_or_newer=TCHECK_CTIME; timestr_newer=swptr; } } else if(toupper(*swptr)=='A') { swptr++; if(toupper(*swptr)=='B') { filter_older=TCHECK_ATIME; swptr++; timestr_older=swptr; } else { filter_same_or_newer=TCHECK_ATIME; timestr_newer=swptr; } } else { filter_same_or_newer=TCHECK_FTIME; timestr_newer=swptr; } } else if(!jswitch&&!hswitch&&!os2switch&&c=='T'&&sw_tail) { done=1; type_override=FT_BINARY; type=(int)(*swptr-'0'); if(type!=ARJT_BINARY&&type!=ARJT_TEXT) error(M_INVALID_SWITCH, sw); swptr++; /* ASR fix 25/01/2004: the "-t1gf" combination was the only way to enforce "text with graphics" which was not trivial. Now "-t1g" should do it as well. */ if(type==ARJT_TEXT) type_override=FT_TEXT; while((c=toupper(*swptr))=='G'||c=='F') { if(c=='G') type_override=FT_TEXT_GRAPHICS; else if(c=='F'&&type_override<FT_TEXT_FORCED) type_override=FT_TEXT_FORCED; swptr++; } if(*swptr=='.') { swptr_t=swptr; secondary_file_type=type; } else primary_file_type=type; } else if(!jswitch&&!hswitch&&!os2switch&&c=='V'&&sw_tail) { done=1; multivolume_option=MV_STD; while(*swptr!='\0') { vol_sw=(char)toupper(*swptr); if(vol_sw=='V') { swptr++; beep_between_volumes=1; } else if(vol_sw=='W') { swptr++; whole_files_in_mv=1; } else if(vol_sw=='A') { swptr++; multivolume_option=MV_AVAIL; volume_limit=MIN_VOLUME_SIZE; } else if(vol_sw=='E') { swptr++; use_sfxstub=1; } else if(vol_sw=='I') { swptr++; inhibit_change_test=1; } else if(vol_sw=='P') { swptr++; pause_between_volumes=1; if((change_vol_delay=(int)strtoul(swptr, &swptr, 10))==0) change_vol_delay=STD_CHANGE_VOL_DELAY; } else if(vol_sw=='R') { swptr++; mv_reserve_space=strtoul(swptr, &swptr, 10); if(toupper(*swptr)=='K') mv_reserve_space*=1000L; else if(toupper(*swptr)=='M') mv_reserve_space*=1000000L; } else if(vol_sw=='S'||vol_sw=='Z'||vol_sw=='D') { swptr++; mv_cmd_state=MVC_RUN_CMD; if(vol_sw=='Z') mv_cmd_state=MVC_RUN_CMD_NOECHO; else if(vol_sw=='D') { mv_cmd_state=MVC_DELETION; if(*swptr=='\0') error(M_INVALID_SWITCH, sw); } if(*swptr!='\0') { mv_cmd=swptr; while(*swptr!='\0') swptr++; } } else if(isdigit(vol_sw)) { volume_limit=strtoul(swptr, &swptr, 10); if(toupper(*swptr)=='K') volume_limit*=1000L; else if(toupper(*swptr)=='M') volume_limit*=1000000L; break; } else error(M_INVALID_SWITCH, sw); } volume_limit=select_preset_size(volume_limit); mv_reserve_space=select_preset_size(mv_reserve_space); } else if(!jswitch&&!hswitch&&!os2switch&&c=='W'&&sw_tail) { done=1; assign_work_directory=1; work_directory=swptr; } else if(!jswitch&&!hswitch&&!os2switch&&c=='X'&&sw_tail) { if(!exclude_files) { flist_cleanup(&flist_exclusion); flist_init(&flist_exclusion, FCLIM_EXCLUSION, FL_STANDARD); } done=1; exclude_files=1; create_excl_list(swptr); } else if(!jswitch&&!hswitch&&!os2switch&&c=='Z'&&sw_tail) { done=1; use_comment=1; archive_cmt_name=swptr; } else if(!jswitch&&!hswitch&&!os2switch&&c=='!'&&sw_tail) { done=1; listchars_allowed=1; listchar=toupper(*swptr); } else if(!jswitch&&!hswitch&&!os2switch&&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(!jswitch&&!hswitch&&!os2switch&&c=='+'&&sw_tail) done=1; else if(hswitch&&c=='B') { done=1; filter_attrs=1; parse_attrs(swptr); } else if(hswitch&&c=='C'&&sw_tail) { done=1; run_cmd_at_start=1; start_cmd=swptr; } else if(hswitch&&c=='D') { if(*swptr=='\0') error(M_INVALID_SWITCH, sw); done=1; debug_enabled=1; debug_opt=swptr; } else if(hswitch&&c=='G') { done=1; gost_cipher=GOST256; if(*swptr=='!'&&swptr[1]=='\0') gost_cipher=GOST40; else arjcrypt_name=swptr; } else if(hswitch&&c=='M') { done=1; filelist_storage=BST_DISK; max_filenames=(FILE_COUNT)strtoul(swptr, &swptr, 10); if(max_filenames==0) max_filenames=EXT_FILELIST_CAPACITY; if(*swptr=='!'&&swptr[1]!='\0') swptr_hm=++swptr; #if TARGET==DOS else if(*swptr=='!'&&swptr[1]=='\0') filelist_storage=BST_XMS; #endif } else if(hswitch&&c=='N') { done=1; nonexist_filespec=1; nonexist_name=swptr; } else if(hswitch&&c=='P') { done=1; arjdisp_enabled=1; arjdisp_ptr=swptr; } else if(hswitch&&c=='T') { done=1; set_target_directory=1; p_len=strlen(swptr); p_ptr=&swptr[p_len-1]; while(*p_ptr==' ') p_ptr--; if(strchr(path_separators, *p_ptr)!=NULL) target_dir=swptr; else { strcpy(target_dir=malloc_msg(p_len+2), swptr); target_dir[p_len]=PATHSEP_DEFAULT; target_dir[p_len+1]='\0'; } } else if(hswitch&&c=='V') { done=1; chk_arj_version=1; swptr_hv=swptr; } else if(hswitch&&c=='X') { done=1; override_archive_exts=1; archive_ext_list=swptr; if(swptr[0]!='.'||swptr[1]=='\0') error(M_INVALID_SWITCH, sw); } else if(hswitch&&c=='Z') { done=1; sign_with_arjsec=1; arjsec_env_name=swptr; } else if(hswitch&&c=='#'&&*swptr!='\0'&&!isdigit(*swptr)) { done=1; append_curtime=1; time_str=swptr; } else if(jswitch&&c=='C'&&sw_tail) { done=1; exit_after_count=1; exit_count=(FILE_COUNT)strtoul(swptr, &swptr, 10); } else if(jswitch&&c=='D'&&sw_tail) { done=1; chk_free_space=1; minfree=strtoul(swptr, &swptr, 10); if(toupper(*swptr)=='K') minfree*=1000L; else if(toupper(*swptr)=='M') minfree*=1000000L; } else if(jswitch&&c=='B'&&sw_tail) { done=1; chapter_mode=CHAP_USE; if(*swptr=='*') { swptr++; current_chapter=1; chapter_to_process=RESERVED_CHAPTER; } else { cnv_num=strtoul(swptr, &swptr, 10); chapter_to_process=current_chapter=(int)cnv_num; if(*swptr++=='-') { if(*swptr=='\0') chapter_to_process=RESERVED_CHAPTER; else { cnv_num=strtoul(swptr, &swptr, 10); chapter_to_process=(int)cnv_num; if(chapter_to_process>CHAPTERS_MAX) error(M_INVALID_SWITCH, sw); } } if(current_chapter==0&&chapter_to_process==0) chapter_mode=CHAP_REMOVE; } } else if(jswitch&&c=='H'&&sw_tail) { done=1; jh_enabled=1; cnv_num=strtoul(swptr, &swptr, 10); if(cnv_num<(unsigned long)MIN_BUFSIZ||cnv_num>(unsigned long)MAX_USER_BUFSIZ) error(M_INVALID_SWITCH, sw); #if MAX_BUFSIZ<MAX_USER_BUFSIZ if(cnv_num>(unsigned long)MAX_BUFSIZ) cnv_num=MAX_BUFSIZ; #endif user_bufsiz=(unsigned int)cnv_num; } else if(jswitch&&c=='I'&&sw_tail) { done=1; create_index=1; index_name=swptr; } else if(jswitch&&c=='N'&&sw_tail) { done=1; restart_at_filename=1; filename_to_restart=swptr; } else if(jswitch&&c=='Q'&&sw_tail) { done=1; set_string_parameter=1; string_parameter=swptr; } else if(jswitch&&c=='P'&&sw_tail) { done=1; prompt_for_more=1; cnv_num=strtoul(swptr, &swptr, 10); if(cnv_num>0L) lines_per_page=(int)cnv_num; } else if(jswitch&&c=='S'&&sw_tail) { done=1; store_by_suffix=1; free(archive_suffixes); archive_suffixes=swptr; } else if(jswitch&&c=='W'&&sw_tail) { done=1; extract_to_file=1; extraction_filename=swptr; } else if(jswitch&&c=='X'&&sw_tail) { done=1; start_at_ext_pos=1; ext_pos=strtoul(swptr, &swptr, 10); /* For long ext_pos, we need to put check for ext_pos<0L here, but we omit it since in our implementation, ext_pos is unsigned. */ if(toupper(*swptr)=='K') ext_pos*=1000L; } else if(jswitch&&c=='Y'&&sw_tail) { done=1; assume_yes=1; yes_query_list=swptr; parse_yes_queries(yes_query_list); } else if(jswitch&&c=='Z'&&sw_tail) { done=1; supply_comment_file=1; comment_file=swptr; }#if TARGET==UNIX else if(os2switch&&c=='B') { done=1; add_blkdev_spec(swptr); }#endif else if(os2switch&&c=='E') { done=1; if(!sw_tail) ea_supported=0; else { include_eas=1; #if defined(HAVE_EAS) flist_add_files(&flist_ea, NULL, swptr, 0, 0, 0, NULL); #endif } } else if(os2switch&&c=='P') { if(!sw_tail) error(M_INVALID_SWITCH, sw); priority.class=strtoul(swptr, &swptr, 10); if(priority.class<1||priority.class>PRIORITY_CLASSES) error(M_INVALID_SWITCH, sw); #if TARGET==OS2||TARGET==WIN32 if((p_ptr=strchr(swptr, ':'))==NULL) priority.delta=0; else { swptr=p_ptr+1; priority.delta=strtoul(swptr, &swptr, 10); #if TARGET==OS2 if(priority.delta<-31||priority.delta>31) #elif TARGET==WIN32 if(priority.delta<-2||priority.delta>2) #else #error No priority delta limits! #endif error(M_INVALID_SWITCH, sw); } #else priority.delta=0; #endif }#ifdef COLOR_OUTPUT
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -