Annotation of researchv9/X11/src/X.V11R1/lib/X/XChKeyCon.c, revision 1.1

1.1     ! root        1: #include "copyright.h"
        !             2: 
        !             3: /* $Header: XChKeyCon.c,v 11.7 87/09/11 08:01:34 toddb Exp $ */
        !             4: /* Copyright    Massachusetts Institute of Technology    1986  */
        !             5: 
        !             6: #include "Xlibint.h"
        !             7: 
        !             8: XChangeKeyboardControl(dpy, mask, value_list)
        !             9:     register Display *dpy;
        !            10:     unsigned long mask;
        !            11:     XKeyboardControl *value_list;
        !            12: {
        !            13:     unsigned long values[7];
        !            14:     register unsigned long *value = values;
        !            15:     long nvalues;
        !            16:     register xChangeKeyboardControlReq *req;
        !            17: 
        !            18:     LockDisplay(dpy);
        !            19:     GetReq(ChangeKeyboardControl, req);
        !            20:     req->mask = mask;
        !            21: 
        !            22:     /* Warning!  This code assumes that "unsigned long" is 32-bits wide */
        !            23: 
        !            24:     if (mask & KBKeyClickPercent)
        !            25:        *value++ = value_list->key_click_percent;
        !            26:        
        !            27:     if (mask & KBBellPercent)
        !            28:        *value++ = value_list->bell_percent;
        !            29: 
        !            30:     if (mask & KBBellPitch)
        !            31:        *value++ = value_list->bell_pitch;
        !            32: 
        !            33:     if (mask & KBBellDuration)
        !            34:        *value++ = value_list->bell_duration;
        !            35: 
        !            36:     if (mask & KBLed)
        !            37:        *value++ = value_list->led;
        !            38: 
        !            39:     if (mask & KBLedMode)
        !            40:        *value++ = value_list->led_mode;
        !            41: 
        !            42:     if (mask & KBKey)
        !            43:         *value++ = value_list->key;
        !            44: 
        !            45:     if (mask & KBAutoRepeatMode)
        !            46:         *value++ = value_list->auto_repeat_mode;
        !            47: 
        !            48: 
        !            49:     req->length += (nvalues = value - values);
        !            50: 
        !            51:     /* note: Data is a macro that uses its arguments multiple
        !            52:        times, so "nvalues" is changed in a separate assignment
        !            53:        statement */
        !            54: 
        !            55:     nvalues <<= 2;
        !            56:     Data (dpy, (char *) values, nvalues);
        !            57:     UnlockDisplay(dpy);
        !            58:     SyncHandle();
        !            59: 
        !            60:     }

unix.superglobalmegacorp.com

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