Annotation of 41BSD/lib/libI77/util.c, revision 1.1.1.1

1.1       root        1: #include <sys/types.h>
                      2: #include <sys/stat.h>
                      3: #include <sys/dir.h>
                      4: #include "fio.h"
                      5: #define DIRSIZE        14
                      6: g_char(a,alen,b) char *a,*b; ftnlen alen;
                      7: {      char *x=a+alen-1,*y=b+alen-1;
                      8:        *(y+1)=0;
                      9:        for(;x>=a && *x==' ';x--) *y--=0;
                     10:        for(;x>=a;*y--= *x--);
                     11: }
                     12: b_char(a,b,blen) char *a,*b; ftnlen blen;
                     13: {      int i;
                     14:        for(i=0;i<blen && *a!=0;i++) *b++= *a++;
                     15:        for(;i<blen;i++) *b++=' ';
                     16: }
                     17: inode(a) char *a;
                     18: {      struct stat x;
                     19:        if(stat(a,&x)<0) return(-1);
                     20:        return(x.st_ino);
                     21: }
                     22: #define DONE {*bufpos++=0; (void) close(file); return;}
                     23: #define INTBOUND sizeof(int)-1
                     24: #define register 
                     25: mvgbt(n,len,a,b) char *a,*b;
                     26: {      register int num=n*len;
                     27:        if( ((int)a&INTBOUND)==0 && ((int)b&INTBOUND)==0 && (num&INTBOUND)==0 )
                     28:        {       register int *x=(int *)a,*y=(int *)b;
                     29:                num /= sizeof(int);
                     30:                if(x>y) for(;num>0;num--) *y++= *x++;
                     31:                else for(num--;num>=0;num--) *(y+num)= *(x+num);
                     32:        }
                     33:        else
                     34:        {       register char *x=a,*y=b;
                     35:                if(x>y) for(;num>0;num--) *y++= *x++;
                     36:                else for(num--;num>=0;num--) *(y+num)= *(x+num);
                     37:        }
                     38: }

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.