home *** CD-ROM | disk | FTP | other *** search
- Papa Bear #1 @11579
- Wed Jun 07 23:46:41 1995
- 0R 34 06/09 07:13 WWIVNET 4051->8421
- 0R 34 06/08 18:18 WWIVNet 4001->4051
- 0R 34 06/08 14:07 WWIVnet 4000->4001
- 0R 34 06/08 05:34 WWIVnet ->4000
- 0R 34 06/08 01:36 WWIVnet 4001->4000
- 0R 34 06/08 09:17 WWIVnet 11579->4001
- 0R 34 06/07 23:46 WWIVnet ->11579
- 4Msg. Status:3▄ 16Please reply!00
- 3 ▀▀▀▀▀▀▀▀▀▀▀▀0
-
- ┌────────────────────────────A CEREBRUM release!─────────────────────────────┐
- │ Mod Name: SPV063I.MOD Mod Authors: Pâpâ ßêâr (11579.wwivnet) │
- │ Difficulty: ▓░░░░░░░░░ First ----- [02/25/94] Captain EJ │
- │ WWIV Version: 4.24 Last ------ [06/07/95] │
- │ Files Affected: DIREDIT.C FCNS.H │
- │ Description: Mass create CD-ROM directories. Mass-delete a range of dirs! │
- ╞═────────────────────────────────────═╤═───────────────────────────────────═╡
- │ StarPort Valhalla [ ] - ASV 28.8kbps Home of the SPV mod series! │
- └─────────────────────────────────────═╧═────────────────────────────────────┘
-
- >>> OFFICIAL WWIV SUPPORT SITE! <<<
-
- Word of Warning: You installed it, you're responsible! Make back-ups BEFORE
- attempting to install this modification! Read all text before beginning.
- ─────────────────────────────────────────────────────────────────────────────
- LEGEND:
- == Original Code [use this to search on]
- ++ Add this Line [mods ALWAYS add stuff, don't they?]
- -+ Chagne this line [take CARE when editing these lines].
- ─────────────────────────────────────────────────────────────────────────────
- LONG DESCRIPTION: This mod adds to really handy things to the //DIREDIT
- section of the BBS. But first, a word from our sponsor!
- This mod was originally written by Cpatain EJ. Since he's off-net, and
- currently in Japan (for 2 1/2 more years), I've taken over the project. I've
- always respected his work and ideas, and this is one of the best.
- What this does, exactly, is allow you to mass-insert, and mass-delete
- directories into your file transfer section. Originally written with
- CD-ROM's in mind, it will work for any type of dirs.
- I've added a few things, improved a couple of weak places, and generally
- made it 4.24 ready.
- ─────────────────────────────────────────────────────────────────────────────
- STEP 1: Load up DIREDIT.C In void dlboardedit(void) add these variable
- declarations:
-
- == int i,i1,i2,done,f, confchg=0;
- == char s[81],s1[81],ch;
- == SUBCONF_TYPE iconv;
- ++ int dir_num,ok1,ok2,conf_sel,i3,dsl,age,done1; // SPV063I
- ++ unsigned short dar; // SPV063I
- ++ char stemp[81],inbuf[250],dn[180],pn[50],cd_num[3],ch2; // SPV063I
- ++ FILE *fr; // SPV063I
- ==
- == if (!checkpw())
- == return;
- ─────────────────────────────────────────────────────────────────────────────
- STEP 2: Same function:
-
- == nl();
- == prt(2,get_string(160));
- -+ ch=onek("QSDIM?C"); // SPV063I added C
- == switch(ch) {
- == case '?':
- ─────────────────────────────────────────────────────────────────────────────
- STEP 3: Same function -- replace case 'D': with this one, and add a new
- case 'C':
-
- // SPV063I *REPLACEMENT* case 'D': and *NEW* case 'C': START
- case 'D':
- nl();
- prt(2,get_string(163));
- input(s,4);
- i3=atoi(s);
- if (s[0]==0)
- break;
- if (i3!=(num_dirs-1)) {
- nl();
- npr("2Last directory to delete 3(9Default=1%d3)2? 0",i3);
- input(s,3);
- i2=atoi(s);
- if (i2>=num_dirs)
- i2=(num_dirs-1);
- if (i2<i3)
- i2=i3;
- } else
- i2=(num_dirs-1);
- nl();
- if (i2==i3)
- npr("6Are you sure you want to delete dir #2%d6? 0",i3);
- else
- npr("6Are you sure you want to delete dir #2%d 6thru 2%d6? 0",
- i3,i2);
- if (yn()) {
- tmp_disable_pause(1);
- nl();
- prt(5,get_string(1380));
- if (yn())
- done1=1;
- else
- done1=0;
- nl();
- for (i=i3; i<=i2; i++) {
- strcpy(s,directories[i3].filename);
- npr("6Deleting #2%d9: 1%s0",i,directories[i3].name);
- nl();
- delete_dir(i3);
- confchg=1;
- if (done1) {
- sprintf(s1,"%s%s.DIR",syscfg.datadir, s);
- unlink(s1);
- sprintf(s1,"%s%s.EXT",syscfg.datadir,s);
- unlink(s1);
- }
- }
- tmp_disable_pause(0);
- }
- break;
- case 'C':
- dir_num=1;
- conf_sel=done1=stemp[0]=cd_num[0]=dar=age=0;
- dsl=10;
- if (num_dirs<max_dirs) {
- sprintf(s,"%sDIRLIST.TXT",syscfg.datadir);
- fr=fsh_open(s,"rt");
- if (fr==NULL) {
- pl("6No DIRLIST.TXT file exists in the DATA directory!0");
- fsh_close(fr);
- break;
- }
- nl();
- npr("5Insert before which dir? 3(1$9 to enter at end3) 0");
- input(s,3);
- i=atoi(s);
- if (((s[0]!=0) && (i>=0) && (i<=num_dirs)) || (s[0]=='$')) {
- if (s[0]=='$')
- i=num_dirs;
- do {
- outchr(12);
- npr("9Inserting new directories at position2: 1%d0",i);
- nln(2);
- npr("1A9. 3Minimum DSL 2: 5%d0",dsl); nl();
- npr("1B9. 3Minimum Age 2: 5%d0",age); nl();
- npr("1C9. 3CD-ROM # 2: 5%s0",cd_num); nl();
- if (dar!=0) {
- for (i2=0; i2<16; i2++)
- if ((1 << i2) & dar)
- stemp[0]='A'+i2;
- stemp[1]=0;
- }
- npr("1D9. 3DAR 2: 5%s0",stemp); nl();
- confchg=1;
- if (dirconfnum>1) {
- npr("1E9. 3Conference 2: 5%c0",
- dirconfs[conf_sel].designator); nl();
- }
- npr("1F9. 3Directory # 2: 5%d0",dir_num); nl();
- nl();
- npr("5Which 3(1A3-1F3,(1S3)ave [and create],(6Q3)uit)5? 0");
- if (dirconfnum>1)
- ch=onek("QSABCDEF");
- else
- ch=onek("QSABCDF");
- switch(ch) {
- case 'Q':done1=1; cd_num[0]=0; break;
- case 'S':
- if (!cd_num[0]) {
- nl();
- pl("6CD-ROM # not set -- aborting!0");
- nl();
- }
- done1=1;
- break;
- case 'A':
- nl();
- prt(2,get_string(153));
- input(s,3);
- i2=atoi(s);
- if ((i2>=0) && (i2<256) && (s[0]))
- dsl=i2;
- break;
- case 'B':
- nl();
- prt(2,get_string(77));
- input(s,3);
- i2=atoi(s);
- if ((i2>=0) && (i2<128) && (s[0]))
- age=i2;
- break;
- case 'C':
- nl();
- npr("9CD Rom Number (1HEX and must not be duplicate9)? 0");
- mpl(2);
- input(cd_num,2);
- if (cd_num[0]) {
- if (strlen(cd_num)<=1) {
- strcpy(s,cd_num);
- sprintf(cd_num,"0%1.1s",s);
- }
- }
- break;
- case 'D':
- nl();
- prt(2,get_string(154));
- ch2=onek("ABCDEFGHIJKLMNOP ");
- if (ch2==32)
- dar=0;
- else
- dar=1 << (ch2-'A');
- break;
- case 'E':
- confchg=1;
- if (dirconfnum>1) {
- nl();
- pl("5Pick which conference ALL dirs will belong2:0");
- nl();
- list_confs(CONF_DIRS,0);
- conf_sel=select_conf(get_string(1160),CONF_DIRS, 0);
- }
- break;
- case 'F':
- nl();
- pl("2Enter directory number to start the file names from.0");
- pl("2This number will help generate the file names for your *.DIR files.0");
- nl();
- pl("1 example: CD Rom number - A3 Dir Number - 250");
- pl("1 Will generate file names like this:0");
- nl();
- pl("1 !A3_0025.DIR, !A3_0026.DIR, etc...0");
- nl();
- pl("2If you hit C/R it will assume 1. This function is here0");
- pl("2so you can add directories to an existing CD Conference.0");
- nl();
- npr("5Directory number2: 0");
- mpl(4);
- input(s,4);
- if (s[0])
- dir_num=atoi(s);
- else
- dir_num=1;
- break;
- }
- } while ((!done1) && (!hangup));
- if (cd_num[0]==0) {
- fsh_close(fr);
- break;
- }
- }
- ok2=0;
- if (cd_num[0]) {
- nl();
- npr("9Inserting directories before 1%d9.0",i);
- nl();
- tmp_disable_pause(1);
- for (i1=i; !ok2; i1++) {
- fgets(inbuf,250,fr);
- inbuf[strlen(inbuf)-1]=0;
- if (!feof(fr)) {
- insert_dir(i1);
- ok1=i3=0;
- for (i2=0; i2<=strlen(inbuf); i2++) {
- if ((inbuf[i2]==32) && (!ok1))
- ok1=1;
- if (!ok1) {
- pn[i2]=inbuf[i2];
- pn[i2+1]=0;
- }
- if ((inbuf[i2]>=33) && (inbuf[i2]<=125) && (ok1==1))
- ok1=2;
- if (ok1==2) {
- dn[i3]=inbuf[i2];
- i3++;
- dn[i3]=0;
- }
- }
- if (strlen(dn)>=40)
- dn[40]=0;
- strcat(pn,"\\");
- sprintf(s,"!%2.2s_%-3.3d",cd_num,dir_num);
- dir_num++;
- npr("9Adding 5#1%d2: 9'1%s9'0",i1,dn);
- nl();
- mod_dir(i1,dn,s,pn,dsl,age,dar);
- if (dirconfnum>1) {
- if (conf_sel>=0)
- if (in_conference(i1,&dirconfs[conf_sel])<0)
- addsubconf(CONF_DIRS,
- &dirconfs[conf_sel],&(SUBCONF_TYPE)i1);
- } else {
- if (in_conference(i1,&dirconfs[0])<0)
- addsubconf(CONF_DIRS, &dirconfs[0], &(SUBCONF_TYPE)i1);
- }
- } else
- ok2=1;
- }
- tmp_disable_pause(0);
- }
- fsh_close(fr);
- }
- break;
- // SPV063I *REPLACEMENT* case 'D': and *NEW* case 'C': END
- ─────────────────────────────────────────────────────────────────────────────
- STEP 4: Add these functions to the end of DIREDIT.C
- void mod_dir(int n, char *dir_name, char *file_name, char *path_name,
- int mdsl, int mage, unsigned short mdar)
- {
- directoryrec r;
-
- r=directories[n];
- strcpy(r.name,dir_name);
- strcpy(r.filename,file_name);
- strcpy(r.path,path_name);
- if (mdsl)
- r.dsl=mdsl;
- if (mage)
- r.age=mage;
- r.maxfiles=499;
- if (mdar)
- r.dar=mdar;
- if(r.mask & mask_cdrom) {
- r.mask ^= mask_cdrom;
- } else {
- r.mask |= mask_cdrom;
- r.mask |= mask_no_uploads;
- }
- directories[n]=r;
- }
- ─────────────────────────────────────────────────────────────────────────────
- STEP 5: Add the function prototype to FCNS.H
-
- == void insert_dir(int n);
- == void delete_dir(int n);
- == void dlboardedit(void);
- ++ void mod_dir(int n, char *dir_name, char *file_name, char *path_name,
- ++ int mdsl, int mage, unsigned short mdar);
- ==
- == /* File: extrn1.c */
- ─────────────────────────────────────────────────────────────────────────────
- STEP 6: Recompile
- ─────────────────────────────────────────────────────────────────────────────
- STEP 7: Change string entry 160 in BBS.STR from:
-
- Dirs: D:elete, I:nsert, M:odify, S:wapDirs, Q:uit, ? :
-
- to:
-
- Dirs: C:D-ROM, D:elete, I:nsert, M:odify, S:wapDirs, Q:uit, ? :
- ─────────────────────────────────────────────────────────────────────────────
- STEP 8: How to use the DIRLIST.TXT in the DATA dir:
-
- The file you need to make this work must be located in the data directory,
- and must be named DIRLIST.TXT and MUST be in the following format:
-
- <drive letter><full path> <directory description>
-
- Like this:
-
- F:\1_X\COMM OS/2 1.x communications
- F:\1_x\drivers 1.x device drivers
- F:\1_x\editors 1.x Editors
- F:\1_x\graphics 1.x graphics and sound
- F:\1_x\info 1.x related text/information
-
- NOTICE there is NO trailing backslash on the path name. The number of spaces
- between the path and the directory description are not important, but there
- must be at least one space separating the two.
- ─────────────────────────────────────────────────────────────────────────────
- This mod is copyright 1995 by Tracy Baker, aka Papa Bear, and is
- distributed as freeware. Permission is granted to distribute and post this
- mod on BBS systems and online services, provided no alterations are made
- (removal of message headers/taglines allowed). This mod may contain some
- parts of WWIV source code, which is copyright 1988-1994 by Wayne Bell and
- licensed only to registered users of WWIV. Use of WWIV source without
- registration constitutes a license violation and could lead to legal
- prosecution and certain doom.
- Shareware distributors and CD-ROM publishers may not distribute this mod
- without express written permission of the Author or WWIV Software Services.
-
- 7-9=1*6>2Pâpâ ßêâr6<1*9=7-0