Annotation of researchv9/jerq/sgs/libld/sgetl.c, revision 1.1.1.1

1.1       root        1: static char ID[] = "@(#) sgetl.c: 1.1 1/8/82";
                      2: /*
                      3:  * The intent here is to provide a means to make the value of
                      4:  * bytes in an io-buffer correspond to the value of a long
                      5:  * in the memory while doing the io a `long' at a time.
                      6:  * Files written and read in this way are machine-independent.
                      7:  *
                      8:  */
                      9: #include <values.h>
                     10: 
                     11: long
                     12: sgetl(buffer)
                     13: register char *buffer;
                     14: {
                     15:        register long w = 0;
                     16:        register int i = BITSPERBYTE * sizeof(long);
                     17: 
                     18:        while ((i -= BITSPERBYTE) >= 0)
                     19:                w |= (long) ((unsigned char) *buffer++) << i;
                     20:        return (w);
                     21: }

unix.superglobalmegacorp.com

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