Annotation of coherent/a/usr/bob/uusrc/modemcap/initmodem.c, revision 1.1

1.1     ! root        1: #include "modemcap.h"
        !             2: 
        !             3: static char    f_names[] = "asditthc";
        !             4: static char    *f_caps[] = {
        !             5:        &AS, &DI, &TT, &HC
        !             6: };
        !             7: 
        !             8: static char    i_names[] = "bdblidad";
        !             9: static int     *i_caps[] = {
        !            10:        &BD, &BL, &ID, &AD
        !            11: };
        !            12: 
        !            13: static char    c_names[] = "cscedsdeiscoclathu";
        !            14: static char    **c_caps[] = {
        !            15:        &CS, &CE, &DS, &DE, &IS, &CO, &CL, &AT, &HU
        !            16: };
        !            17: 
        !            18: initmodem (modem, fd)
        !            19: char   *modem;                                 /* name of modem        */
        !            20: int    fd;                                     /* channel to modem     */
        !            21: {
        !            22:        static  char    mcapbuf[1024];
        !            23:        static  char    area[1024];
        !            24:        char    *ap = area;
        !            25:        register char   *cp;
        !            26:        register int    i, j;
        !            27:        char    *mgetstr ();
        !            28: 
        !            29:        if (mgetent (mcapbuf, modem) != 1)
        !            30:                return (0);
        !            31: 
        !            32:        for (i = 0, cp = f_names;*cp;i++, cp += 2)
        !            33:                *(f_caps[i]) = mgetflag (cp);
        !            34: 
        !            35:        for (i = 0, cp = i_names;*cp;i++, cp += 2)
        !            36:                *(i_caps[i]) = ((j=mgetnum(cp)) >= 0) ? j: 0;
        !            37: 
        !            38:        for (i = 0, cp = c_names;*cp;i++, cp += 2)
        !            39:                *(c_caps[i]) = mgetstr (cp, &ap);
        !            40: 
        !            41:        if (IS != (char *) 0) {
        !            42:                write (fd, IS, strlen (IS));
        !            43:                if (ID)
        !            44:                        sleep (ID);
        !            45:        }
        !            46:        return (1);
        !            47: }

unix.superglobalmegacorp.com

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