home *** CD-ROM | disk | FTP | other *** search
- /*--------------------------------------------------------------------------*/
- /* */
- /* XBBS SOURCE CODE copyright (c) 1990 by M. Kimes */
- /* All Rights Reserved */
- /* */
- /* For complete details of the licensing restrictions, please refer */
- /* to the License agreement, which is published in its entirety in */
- /* the in the file LICENSE.XBS. */
- /* */
- /* USE OF THIS FILE IS SUBJECT TO THE RESTRICTIONS CONTAINED IN THE */
- /* XBBS LICENSING AGREEMENT. IF YOU DO NOT FIND THE TEXT OF */
- /* THIS AGREEMENT IN ANY OF THE AFOREMENTIONED FILES, OR IF YOU DO */
- /* NOT HAVE THESE FILES, YOU SHOULD IMMEDIATELY CONTACT M. KIMES */
- /* AT THE ADDRESS LISTED BELOW. IN NO EVENT SHOULD YOU PROCEED TO USE */
- /* THIS FILE WITHOUT HAVING ACCEPTED THE TERMS OF THE XBBS LICENSING */
- /* AGREEMENT, OR SUCH OTHER AGREEMENT AS YOU ARE ABLE TO REACH WITH */
- /* M. KIMES */
- /* */
- /* */
- /* You can contact M. Kimes at the following address: */
- /* */
- /* M. Kimes 1:380/16.0@FidoNet */
- /* 542 Merrick (318)222-3455 data */
- /* Shreveport, LA 71104 */
- /* */
- /* */
- /* Please feel free to contact me at any time to share your comments about */
- /* my software and/or licensing policies. */
- /* */
- /*--------------------------------------------------------------------------*/
- /*======================================================================*/
- /* XBBS Bulletin Board System.....Miscellaneous */
- /*======================================================================*/
-
- #include "msg.h"
- #include "xext.h"
-
- extern void pascal CLEAROVERLAY (void);
-
-
-
- void pascal hitreturn (void) {
-
- char tempause;
-
- tempause=pauser;
- pauser=0;
- say_prompt(194);
- fossil(FLUSHOUT,0);
- fossil(PURGEIN,0);
- start=getxbbstime();
- while ((getxbbstime()-start)<(conf.idleseconds+1)) {
- if (inkey()==13 || chatted) goto hedid;
- }
- say_prompt(195);
- logoff();
- userno=0;
- leaving++;
- exit (254);
- hedid:
- chatted=0;
- say_prompt(273);
- pauser=tempause;
- }
-
-
-
-
-
- char * pascal say_prompt (word x) {
-
- static char s[257];
- long pos;
- char *filenamep;
- char *filenamei;
- char *p;
-
- if (conf.promptsay) {
- gprintf(LOCALONLY,"\n\x4 Prompt #%u\n",x);
- }
-
- if (prompthandle==-1) {
- ReOpen:
- if (user.graphics) filenamep="XBBS.GXT";
- else filenamep="XBBS.TXT";
- if (searchpath(filenamep)==NULL) filenamep="XBBS.TXT";
- if ((prompthandle=_open(searchpath(filenamep),O_RDONLY | O_TEXT | O_DENYNONE))==-1) {
- lprint("\n\x4 Can't open XBBS.?XT\n");
- exit(1);
- }
- }
- if (indexhandle==-1) {
- ReOpen2:
- if (!strcmp(filenamep,"XBBS.GXT")) filenamei="XBBS.GDX";
- if (searchpath(filenamei)==NULL) filenamei="XBBS.IDX";
- if ((indexhandle=_open(searchpath(filenamei),O_RDONLY | O_BINARY | O_DENYNONE))==-1) {
- lprint("\n\x4 Can't open XBBS.?DX\n");
- exit(1);
- }
- }
-
- if (lseek(indexhandle,(long)(x*(word)sizeof(long)),SEEK_SET)==-1) {
- goto ReOpen2;
- }
- if (_read(indexhandle,&pos,sizeof(long))<1) {
- lprint("\n\x4 Read error\n");
- }
- if (lseek(prompthandle,pos,SEEK_SET)==-1) {
- goto ReOpen;
- }
- getline(s);
- pos=tell(prompthandle);
- lastprompt=x;
- while (1) {
- ReLoopIt:
- switch ((int)*s) {
- case 1:
- case 255:
- return NULL;
- case 28: printm(center(convertstring(&s[1]),user.length));
- break;
- case 25: printm(r_just(convertstring(&s[1]),user.length));
- break;
- case 24: p=&s[1];
- xmenu(p);
- break;
- case 23: p=strtok(&s[1],", ");
- find_help(p,strtok(0,"\n"),0);
- break;
- case 22: if(!user.commodore) break;
- memmove(s,&s[1],strlen(&s[1])+1);
- goto ReLoopIt;
- case 21: if(!user.twit) break;
- memmove(s,&s[1],strlen(&s[1])+1);
- goto ReLoopIt;
- case 20: if(user.expert) break;
- memmove(s,&s[1],strlen(&s[1])+1);
- goto ReLoopIt;
- case 19: cls();
- break;
- case 18: stripcr(&s[1]);
- pos=tell(prompthandle);
- p=convertstring(&s[1]);
- strtok(p," ");
- if(!load_topics(&s[1])) break;
- p=strtok(0,"\n");
- if(p)set_topic(p);
- display_topic(user.stat[0],&p);
- if(lseek(prompthandle,pos,SEEK_SET)==-1) return NULL;
- break;
- case 17: hitreturn();
- break;
- case 16: return convertstring(&s[1]);
- case 15: stripcr(&s[1]);
- system(convertstring(&s[1]));
- break;
- case 14: stripcr(&s[1]);
- pos=tell(prompthandle);
- readtext(convertstring(&s[1]));
- if(lseek(prompthandle,pos,SEEK_SET)==-1) return NULL;
- break;
- case 11: stripcr(&s[1]);
- pos=tell(prompthandle);
- readfile(convertstring(&s[1]),0,0,1);
- if(lseek(prompthandle,pos,SEEK_SET)==-1) return NULL;
- break;
- case 6: if (user.graphics) break;
- memmove(s,&s[1],strlen(&s[1])+1);
- goto ReLoopIt;
- case 5: if (!user.graphics) break;
- memmove(s,&s[1],strlen(&s[1])+1);
- goto ReLoopIt;
- case 4: lprint(convertstring(s));
- break;
- case 3: addtolog(convertstring(&s[1]));
- break;
- case 2: return &s[1];
- default: printm(convertstring(s));
- }
- lseek(prompthandle,pos,SEEK_SET);
- getline(s);
- pos=tell(prompthandle);
- }
- return NULL;
- }
-
-
- void pascal getline (char *s) {
-
- if (fgetsx(s,256,prompthandle)==NULL) {
- *s=255;
- s[1]=0;
- return;
- }
- if (*s=='\x1' || *s==0) return;
- s[strlen(s)-1]=0;
- if (s[strlen(s)-1]==';') s[strlen(s)-1]=0;
- else s[strlen(s)]='\n';
- }
-
-
-
- char * pascal convertstring (char *a) {
-
- word temp;
- char arg=0;
- char *ppp;
- char *pp;
- char *p;
- char strr[256];
- char middle[82];
-
- strset(strr,0);
- strset(cvstr,0);
- strcpy(strr,a);
- p=strr;
- pp=cvstr;
- while(*p) {
- if (*p=='*' && p[1]) {
- arg=p[1];
- p+=2;
- switch ((int)arg) {
- case 'Q': sprintf(middle,"%08lu.%03hu",user.id,user.node);
- strcat(pp,middle);
- break;
- case 'D': /* DOWNLOAD PATH */
- case 'd': strcat(pp,fboard.dpath);
- while(*pp) pp++;
- if (arg=='d') if (*cvstr) *(--pp)=0;
- break;
- case 'U': /* UPLOAD PATH */
- case 'u': strcat(pp,fboard.upath);
- while(*pp) pp++;
- if (arg=='u') if (*cvstr) *(--pp)=0;
- break;
- case 'N': /* REAL NAME */
- strcat(pp,user.name);
- break;
- case 'F': /* FIRST NAME */
- strcat(pp,user.handle);
- if (strchr(user.handle,' ')) {
- while(*pp!=' ') pp++;
- *pp=0;
- }
- break;
- case 'L': /* LAST NAME */
- if (strchr(user.handle,' ')) {
- ppp=user.handle;
- while(*ppp!=' ') ppp++;
- ppp++;
- strcat(pp,ppp);
- }
- break;
- case 'T': /* TIME REMAINING */
- sprintf(middle,"%u",(timelimit-(getxbbstime()/60)));
- strcat(pp,middle);
- break;
- case 't': /* TIME REMAINING -2 */
- temp=(word)((timelimit-(getxbbstime()/60))-2);
- if (temp<=0) strcpy(middle,"1");
- else sprintf(middle,"%u",temp);
- strcat(pp,middle);
- break;
- case 'B': /* BAUD RATE */
- sprintf(middle,"%u",baud);
- strcat(pp,middle);
- break;
- case 'R':
- sprintf(middle,"%u",userno);
- strcat(pp,middle);
- break;
- case 'G':
- sprintf(middle,"%hu",(user.graphics));
- strcat(pp,middle);
- break;
- case 'P':
- sprintf(middle,"%u",conf.commport);
- strcat(pp,middle);
- break;
- case 'p':
- sprintf(middle,"%u",conf.commport+1);
- strcat(pp,middle);
- break;
- case 'C':
- sprintf(middle,"%d",user.credit);
- strcat(pp,middle);
- break;
- case 'l':
- sprintf(middle,"%u",user.length);
- strcat(pp,middle);
- break;
- case 'w':
- sprintf(middle,"%u",user.width);
- strcat(pp,middle);
- break;
- case 'A':
- sprintf(middle,"%hu",user.arq);
- strcat(pp,middle);
- break;
- case 'S':
- sprintf(middle,"%hu",user.commodore);
- strcat(pp,middle);
- break;
- case 'a':
- sprintf(middle,"%hu",age);
- strcat(pp,middle);
- break;
- case 's':
- sprintf(middle,"%u",user.stat[*p -'0']);
- p++;
- strcat(pp,middle);
- break;
- case 'n':
- sprintf(middle,"%hu",nodenumber);
- strcat(pp,middle);
- break;
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9':
- strcat(pp,variable[arg-'0']);
- break;
- case 'm':
- sprintf(middle,"%u",mboard.number);
- strcat(pp,middle);
- break;
- case 'f':
- sprintf(middle,"%u",user.attr2);
- strcat(pp,middle);
- break;
- case '#':
- if (*p=='2') strcat(pp,user.phone2);
- else strcat(pp,user.phone1);
- p++;
- break;
- case 'c':
- strcat(pp,assocfile);
- break;
- case 'k':
- sprintf(middle,"%u",keymess);
- strcat(pp,middle);
- break;
- case 'M':
- arg=*p;
- p++;
- if (arg=='0') strcpy(middle,msg.from);
- else if (arg=='1') strcpy(middle,msg.to);
- else if (arg=='2') strcpy(middle,msg.subj);
- else if (arg=='3') strcpy(middle,msg.date);
- else if (arg=='4') sprintf(middle,"%u:%u/%u.%01u",msg.o_zone,msg.orig_net,msg.orig,msg.o_point);
- else if (arg=='5') sprintf(middle,"%u:%u/%u.%01u",msg.d_zone,msg.dest_net,msg.dest,msg.d_point);
- else if (arg=='6') sprintf(middle,"%u",msg.times);
- else if (arg=='7') sprintf(middle,"%d",msg.cost);
- else if (arg=='8') sprintf(middle,"%u",msg.attr);
- else if (arg=='9') sprintf(middle,"%u",msg.m_attr);
- else break;
- strcat(pp,middle);
- break;
- case '!': strcat(pp,user.city);
- break;
- case '@': strcat(pp,user.state);
- break;
- case 'H': sprintf(middle,"%X",level);
- strcat(pp,middle);
- break;
- case 'e': sprintf(middle,"%u",level);
- strcat(pp,middle);
- break;
- case ':': strcat(pp,messpath);
- break;
- case 'Z': sprintf(middle,"%u:%u/%u.0@%s",conf.zone,conf.net,conf.node,conf.domain);
- strcat(pp,middle);
- break;
- case 'z': sprintf(middle,"%u:%u/%u.0@%s",conf.alt_zone,conf.alt_net,conf.alt_node,conf.alt_domain);
- strcat(pp,middle);
- break;
- case 'r': strcat(pp,conf.lastcaller);
- break;
- case 'O': strncpy(middle,sysval(p),82); /* Must be last; terminates */
- middle[81]=0;
- strcat(pp,middle);
- *p=0;
- break;
- case 'o': sprintf(middle,"%lx",conf.callcount);
- strcat(pp,middle);
- break;
- case '*': strcat(pp,mboard.name);
- break;
- case '&': sprintf(middle,"%u",mboard.attr);
- strcat(pp,middle);
- break;
- case '$': strcat(pp,fboard.name);
- break;
- case '^': strcat(pp,fidodate());
- break;
- case '%': strcat(pp,getdttm());
- while(*pp)pp++;
- pp--;
- *pp=0;
- break;
- case '(': strcat(pp,saydate(&user.lastdate));
- break;
- case ')': strcat(pp,saytime(&user.lasttime));
- break;
- case 'V': strcat(pp,user.variable[*p-'0']);
- p++;
- break;
- case 'v': sprintf(middle,"%u",user.numvars[*p-'0']);
- p++;
- strcat(pp,middle);
- break;
- case 'g': strcat(pp,dlstr);
- break;
- case 'I': strcat(pp,msginfo);
- break;
- case 'h': strcat(pp,conf.homepath);
- break;
- case 'E': strcat(pp,conf.menupath);
- break;
- case '|': strcat(pp,"\r\n");
- break;
- case '~': strcat(pp,"\r");
- break;
- case '{': ppp=middle;
- *ppp=0;
- while((isdigit(*p) || isalpha(*p)) && ppp<(middle+81)) {
- *ppp=*p;
- ppp++;
- p++;
- *ppp=0;
- }
- if(*p && *p==' ')p++; /* Go past trailing blank */
- ppp=middle;
- ppp=lookup_var(ppp);
- strncat(cvstr,ppp,511-strlen(cvstr));
- cvstr[511]=0;
- break;
- default: strcat(pp,"*");
- p--;
- break;
- }
- }
- else {
- *pp=*p;
- pp[1]=0;
- p++;
- }
- while(*pp)pp++;
- }
- return (cvstr);
- }
-
-
- word pascal tellabout (char type) {
-
- char filename[127];
- word nomess;
- static char ninetyfour[48]="";
- static char ninetyfive[64]="";
- static char ninetysix[48]="";
- static char ninetyseven[48]="";
- static char threetwoeight[48]="";
-
- if (!strlen(ninetyfive)) {
- strncpy(ninetyfour,say_prompt(94),48);
- ninetyfour[47]=0;
- strncpy(ninetyfive,say_prompt(95),64);
- ninetyfive[63]=0;
- strncpy(ninetysix,say_prompt(96),48);
- ninetysix[47]=0;
- strncpy(ninetyseven,say_prompt(97),48);
- ninetyseven[47]=0;
- strncpy(threetwoeight,say_prompt(328),48);
- threetwoeight[47]=0;
- }
-
- sprintf(filename,"%sXDATA.%03x",messpath,mboard.number);
-
- if (type<2) {
- gprintf(0,"\n%s%-04u: %s * ",ninetyfive,mboard.number,mboard.name);
- }
-
- if (findfirst(filename,&filestat,0)) {
- if (type<2) {
- printm(ninetyfour);
- if (!type) printm("\n");
- }
- return 0;
- }
- nomess=(word)((filestat.ff_fsize/(long)sizeof(struct _xmsg)));
- if (mboard.number<(conf.nolmrs+1)) if (lastread[mboard.number-1]>nomess) lastread[mboard.number-1]=nomess;
- if (mboard.number<(conf.nolmrs+1)) if (lastread[mboard.number-1]<0) lastread[mboard.number-1]=0;
-
- if (type<2) {
- gprintf(0,"%u%s",nomess,ninetysix);
- }
- if (mboard.number<(conf.nolmrs+1)) {
- if ((nomess) && (lastread[mboard.number-1]<nomess)) {
- if (type<2) {
- gprintf(0,"%s%u",ninetyseven,lastread[mboard.number-1]+1);
- if (!type) printm("\n");
- }
- }
- else {
- if (type<2) {
- printm(threetwoeight);
- if (!type) printm("\n");
- }
- return 0;
- }
- }
- return 1;
- }
-
-
- void cdecl deinitialize (void) { /* DEINITIALIZES FOSSIL ON EXIT */
-
- conf.trace=0;
- fossil(FLUSHOUT,0);
- fossil(DEINIT,0);
- fputs("\x1b[0;2;37m",stdout);
- r.x.ax=0x4400; /* Set console in (std) cooked mode */
- r.x.bx=1;
- int86(33,&r,&r);
- r.h.dh=0;
- r.h.dl=r.h.dl&(~0x20);
- r.x.ax=0x4401;
- int86(33,&r,&r);
- ccloseall();
- ffreeall();
- CLEAROVERLAY();
- }
-
-
-
- char * pascal fgetsx (char *str,int num,int handle) {
-
- char *p;
- long pos;
- int x;
-
- if (eof(handle)) {
- *str=0;
- return NULL;
- }
- pos=tell(handle);
- x=_read(handle,str,num-1);
- if (x<1) {
- *str=0;
- return NULL;
- }
- str[x]=0;
- p=str;
- while(*p && *p!='\r' && *p!='\n') p++;
- if(!*p) return str;
- if(*p=='\r') {
- *p='\n';
- if (p[1]=='\n') {
- p++;
- *p=0;
- }
- }
- p++;
- *p=0;
- lseek(handle,pos+((long)((word)p-(word)str)),SEEK_SET);
- return str;
- }
-
-
- long pascal findlabel (char *label,int handle) {
-
- long pos;
- long len;
- int x;
- char *p;
- char labelmaker[90];
-
- sprintf(labelmaker,"\x1%s\r\n",label);
- while (1) {
- pos=tell(handle);
- if ((x=_read(handle,buffer,1024))<1) return -1L;
- buffer[x]=0;
- if ((p=strstr(buffer,labelmaker))!=NULL) break;
- if(x<1024) return -1L;
- pos=tell(handle);
- lseek(handle,pos-(long)(strlen(labelmaker)+3),SEEK_SET);
- }
- len=(long)(((int)p-(int)buffer)+strlen(labelmaker));
- return (len+pos);
- }
-
-
- char cdecl gprintf (char flag,char *string,...) {
-
- char p=0;
-
- va_list ap;
- va_start(ap,string);
- vsprintf(buffer,string,ap);
- va_end(ap);
- if (!flag) return printm(buffer);
- if (flag & MODEMONLY) mprint(buffer);
- if (flag & LOGONLY) addtolog(buffer);
- if (flag & LOCALONLY) p+=lprint(buffer);
- if (flag & ANSIONLY) if (user.graphics) p+=printm(buffer);
- if (flag & ASCIIONLY) if (!user.graphics) p+=printm(buffer);
- if (flag & BOFEM) p+=printm(buffer);
- return p;
- }
-
-
-
- int cdecl ffprintf (int handle,char *string,...) {
-
- va_list ap;
- va_start(ap,string);
- vsprintf(buffer,string,ap);
- va_end(ap);
- _write(handle,buffer,strlen(buffer));
- return strlen(buffer);
- }
-
-
- void pascal saveconfig (void) {
-
- int fp;
- char s[14];
-
- if (nodenumber!=1) sprintf(s,"config%hu.bbs",nodenumber);
- else strcpy(s,"config.bbs");
-
- cclose(ccreat(s,S_IWRITE));
- if ((fp=oopen(s,O_RDWR | O_BINARY | O_DENYNONE))==-1) {
- if ((fp=ccreat(s,S_IWRITE))==-1) {
- lprint("\n\04Can't create CONFIG.BBS\n");
- }
- }
- else {
- _write(fp,&conf,sizeof(struct _config));
- cclose(fp);
- }
- }
-
-
-
- void pascal spit (odds,qfile) /* Spit out a random quote from */
- /* Quote file (index one in config */
- char odds;
- char *qfile;
-
- {
-
- int handle;
- char isitindex=0;
- long index;
- struct ffblk f;
- char quote[81]="";
-
- if (odds) if (random(10)<odds) return;
- if (findfirst(qfile,&f,0)) return;
- if(!strcmp(conf.quote_file,qfile)) {
- isitindex=1;
- if ((handle=oopen(qfile,O_RDONLY | O_TEXT | O_DENYNONE))==-1) return;
- if(conf.quote_pos>=f.ff_fsize) conf.quote_pos=0;
- lseek(handle,conf.quote_pos,SEEK_SET);
- }
- else {
- if (f.ff_fsize<160L) return;
- if ((handle=oopen(qfile,O_RDONLY | O_TEXT | O_DENYNONE))==-1) return;
- if (f.ff_fsize<32768L) {
- index=(long)random((int)f.ff_fsize-160L);
- }
- else {
- index=(long)random((int)((f.ff_fsize/32767L)*32767L));
- index+=(long)random((int)(f.ff_fsize-((f.ff_fsize/32767L)*32767L)-160L));
- }
- if (index>f.ff_fsize) index=0;
- lseek(handle,index,SEEK_SET);
- while ((*quote!='\n' && strcmp(quote,"\x1\n")) && !eof(handle)) {
- index=tell(handle);
- if (fgetsx(quote,81,handle)==NULL) break;
- }
- }
- while (!eof(handle)) {
- if (fgetsx(quote,81,handle)==NULL) {
- if(isitindex)conf.quote_pos=0;
- break;
- }
- if(isitindex)conf.quote_pos=tell(handle);
- if (*quote=='\n' || !strcmp(quote,"\x1\n")) break;
- printm(quote);
- }
- Outtahere:
- cclose(handle);
- }
-
-
- void pascal left (char *a,char *b,int x) {
-
- int i=0;
-
- x = (x <= strlen(b)) ? x : strlen(b);
-
- while (i++ < x) *a++ = *b++;
-
- *a = '\0';
-
- }
-
-
- void pascal right (char *a, char *b, int x) {
-
- int i,l;
-
- l = strlen(b);
- x=(x>l) ? l : x;
- i = l - x;
-
- while (*a++ = *(b + i++));
-
- }
-
-
- void pascal mid (char *a,char *b,int x,int y) {
-
- int l;
-
- --x;
- y+=x;
- l = strlen(b);
-
- while (x<y && x<=l) *a++ = *(b + x++);
-
- *a = '\0';
-
- }
-
-
- void pascal mids (char *a,int x,int y,char *b) {
-
- int l;
-
- l = strlen(a) - 1;
- y += x;
- --x;
-
- while (x <= y && x <= l && *b != '\0') *(a + x++) = *b++;
-
- }
-
-
-
- char * pascal rstrip (char *a) {
-
- register int x;
-
- x=strlen(a);
- while (x && a && a[x-1]==' ') a[--x]=0;
- return a;
- }
-
-
-
- char * pascal lstrip (char *a) {
-
- register int x;
-
- x=strlen(a);
- while (x && *a==' ') memmove (a,(a+1),x--);
- return (a);
- }
-
-
-
- char * pascal stristr (char *t, char *s) {
-
- char *t1;
- char *s1;
-
- while(*t) {
- t1=t;
- s1=s;
- while(*s1) {
- if (toupper(*s1)!=toupper(*t)) break;
- else {
- s1++;
- t++;
- }
- }
- if (!*s1) return t1;
- t=t1+1;
- }
- return NULL;
- }
-
-
-
- word pascal chk_scroll_lock (void) {
-
- if ((peekb(0,1047) & 0x10)==0) return(0);
- else return(1);
- }
-
-
-
- char * pascal r_just (char *str, int size) {
-
- char *s, *d;
- register int len, count;
-
- if(size>79) size=79;
- lstrip(rstrip(str));
- len = strlen(str); /* get string length */
- if (len > size) str[size] = 0x00; /* truncate, if necessary */
- else if (len < size) {
- d = str + size; /* copy to leave room */
- s = str + len;
- count = len + 1;
- while (count--) *d-- = *s--;
- count = size - len; /* number of blanks to insert */
- s = str;
- while (count--) *s++ = ' '; /* add leading blanks */
- }
- return str;
- }
-
-
- char * pascal center (char *line, int linlen) { /* center string */
-
- register int count, len;
- char *d,*s;
-
- if(linlen>79) linlen=79;
- lstrip(rstrip(line));
- len = strlen(line); /* get non-blank length */
- if(len>linlen) {
- line[linlen-1]=0;
- }
- else {
- /* leading blanks */
- d = line + linlen; /* copy to leave room */
- s = line + len;
- count = (len + 1)/2;
- while (count--) *d-- = *s--;
- count = linlen - len; /* number of blanks to insert */
- s = line;
- while (count--) *s++ = ' '; /* add leading blanks */
- }
- /* non-blank chars */
- return line;
- }
-
-