URI:
       tconvTR2M.c - plan9port - [fork] Plan 9 from user space
  HTML git clone git://src.adamsgaard.dk/plan9port
   DIR Log
   DIR Files
   DIR Refs
   DIR README
   DIR LICENSE
       ---
       tconvTR2M.c (561B)
       ---
            1 #include <u.h>
            2 #include <libc.h>
            3 #include <authsrv.h>
            4 
            5 #define        CHAR(x)                *p++ = f->x
            6 #define        SHORT(x)        p[0] = f->x; p[1] = f->x>>8; p += 2
            7 #define        VLONG(q)        p[0] = (q); p[1] = (q)>>8; p[2] = (q)>>16; p[3] = (q)>>24; p += 4
            8 #define        LONG(x)                VLONG(f->x)
            9 #define        STRING(x,n)        memmove(p, f->x, n); p += n
           10 
           11 int
           12 convTR2M(Ticketreq *f, char *ap)
           13 {
           14         int n;
           15         uchar *p;
           16 
           17         p = (uchar*)ap;
           18         CHAR(type);
           19         STRING(authid, 28);        /* BUG */
           20         STRING(authdom, DOMLEN);
           21         STRING(chal, CHALLEN);
           22         STRING(hostid, 28);        /* BUG */
           23         STRING(uid, 28);        /* BUG */
           24         n = p - (uchar*)ap;
           25         return n;
           26 }