File: binding.c

package info (click to toggle)
notion 4.0.3%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 4,656 kB
  • sloc: ansic: 47,365; sh: 2,093; makefile: 594; perl: 270
file content (795 lines) | stat: -rw-r--r-- 18,586 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
/*
 * ion/ioncore/binding.c
 *
 * Copyright (c) Tuomo Valkonen 1999-2007.
 *
 * See the included file LICENSE for details.
 */

#include <string.h>
#include "common.h"
#include "event.h"
#include "binding.h"
#include "global.h"
#include <libtu/objp.h>
#include "regbind.h"
#include <libextl/extl.h>


#ifndef CF_NO_LOCK_HACK
#define CF_HACK_IGNORE_EVIL_LOCKS
#endif

#ifdef CF_HACK_IGNORE_EVIL_LOCKS
#define XK_MISCELLANY
#include <X11/keysymdef.h>
#endif


/* */


#define N_MODS 8

static const uint modmasks[N_MODS]={
    ShiftMask, LockMask, ControlMask, Mod1Mask, Mod2Mask, Mod3Mask,
    Mod4Mask, Mod5Mask
};

static XModifierKeymap *modmap=NULL;

#define KNOWN_MODIFIERS_MASK (ShiftMask|LockMask|ControlMask|Mod1Mask|\
                              Mod2Mask|Mod3Mask|Mod4Mask|Mod5Mask)

#ifdef CF_HACK_IGNORE_EVIL_LOCKS

#define N_EVILLOCKS 3
#define N_LOOKUPEVIL 2

static uint evillockmasks[N_EVILLOCKS]={
     0, 0, LockMask
};

static const KeySym evillocks[N_LOOKUPEVIL]={
    XK_Num_Lock, XK_Scroll_Lock
};

static uint evilignoremask=LockMask;

#define N_GRAB_CALL_HISTORY 400

static uint grabCallHistoryIndex = 0;

struct GrabCall {
    unsigned long serial;
    uint ksb; /* keysym or button */
    uint modifiers;
};

struct GrabCall* grabCalls[N_GRAB_CALL_HISTORY] = { NULL };

static void lookup_evil_locks();

static void evil_grab_key(Display *display,
                          uint keycode, uint ksb, uint modifiers,
                          Window grab_window);

static void evil_grab_button(Display *display, uint button, uint modifiers,
                             Window grab_window, bool owner_events,
                             uint event_mask, int pointer_mode,
                             int keyboard_mode, Window confine_to,
                             Cursor cursor);

static void evil_ungrab_key(Display *display, uint keycode, uint modifiers,
                            Window grab_window);

static void evil_ungrab_button(Display *display, uint button, uint modifiers,
                               Window grab_window);

#endif


#define CVAL(A, B, V) ( A->V < B->V ? -1 : (A->V > B->V ? 1 : 0))

static int compare_bindings(const WBinding *a, const WBinding *b)
{
    int r=CVAL(a, b, act);
    if(r==0){
        r=CVAL(a, b, kcb);
        if(r==0){
            r=CVAL(a, b, state);
            if(r==0){
                r=CVAL(a, b, area);
            }
        }
    }
    return r;
}

/* This is only used for searching AnyKey etc. */
static int compare_bindings_ksb(const WBinding *a, const WBinding *b)
{
    int r=CVAL(a, b, act);
    if(r==0){
        r=CVAL(a, b, ksb);
        if(r==0){
            r=CVAL(a, b, state);
            if(r==0){
                r=CVAL(a, b, area);
            }
        }
    }
    return r;
}

#undef CVAL


bool init_bindmap(WBindmap *bindmap)
{
    bindmap->rbind_list=NULL;
    bindmap->areamap=NULL;
    bindmap->nbindings=0;
    bindmap->bindings=make_rb();
    if(bindmap->bindings==NULL){
        warn_err();
        return FALSE;
    }
    return TRUE;
}


WBindmap *create_bindmap()
{
    WBindmap *bindmap=ALLOC(WBindmap);

    if(bindmap==NULL){
        warn_err();
        return NULL;
    }

    if(!init_bindmap(bindmap)){
        free(bindmap);
        return NULL;
    }

    return bindmap;
}


void binding_deinit(WBinding *binding)
{
    if(binding->submap!=NULL){
        bindmap_destroy(binding->submap);
        binding->submap=NULL;
    }
    if(binding->doc){
        free(binding->doc);
        binding->doc=NULL;
    }
    if(binding->label){
        free(binding->label);
        binding->label=NULL;
    }

    binding->func=extl_unref_fn(binding->func);
}


static void do_destroy_binding(WBinding *binding)
{
    assert(binding!=NULL);

    binding_deinit(binding);

    free(binding);
}


static void bindmap_deinit(WBindmap *bindmap)
{
    WBinding *b=NULL;
    Rb_node node=NULL;

    while(bindmap->rbind_list!=NULL){
        region_remove_bindmap(bindmap->rbind_list->reg,
                              bindmap);
    }

    if(bindmap->bindings==NULL)
        return;

    FOR_ALL_BINDINGS(b, node, bindmap->bindings){
        do_destroy_binding((WBinding*)rb_val(node));
        bindmap->nbindings--;
    }

    assert(bindmap->nbindings==0);

    rb_free_tree(bindmap->bindings);
    bindmap->bindings=NULL;
}


void bindmap_destroy(WBindmap *bindmap)
{
    bindmap_deinit(bindmap);
    free(bindmap);
}


static void free_map(Rb_node map)
{
    Rb_node node;
    WBinding *b;

    FOR_ALL_BINDINGS(b, node, map)
        free(b);

    rb_free_tree(map);
}


void bindmap_refresh(WBindmap *bindmap)
{
    WRegBindingInfo *rbind;
    Rb_node newtree, node;
    WBinding *b, *b2;

    if(bindmap->bindings==NULL)
        return;

    newtree=make_rb();

    if(newtree==NULL){
        warn_err();
        return;
    }

    FOR_ALL_BINDINGS(b, node, bindmap->bindings){
        b2=ALLOC(WBinding);
        if(b2==NULL){
            warn_err();
            free_map(newtree);
            return;
        }

        *b2=*b;

        if(b->act==BINDING_KEYPRESS){
            for(rbind=bindmap->rbind_list; rbind!=NULL; rbind=rbind->bm_next)
                rbind_binding_removed(rbind, b, bindmap);
            b2->kcb=XKeysymToKeycode(ioncore_g.dpy, b->ksb);
        }

        if(!rb_insertg(newtree, b2, b2, (Rb_compfn*)compare_bindings)){
            warn_err();
            free(b2);
            free_map(newtree);
            return;
        }
    }

    free_map(bindmap->bindings);
    bindmap->bindings=newtree;

    FOR_ALL_BINDINGS(b, node, bindmap->bindings){
        if(b->act!=BINDING_KEYPRESS)
            continue;
        for(rbind=bindmap->rbind_list; rbind!=NULL; rbind=rbind->bm_next)
            rbind_binding_added(rbind, b, bindmap);
        if(b->submap!=NULL)
            bindmap_refresh(b->submap);
    }
}


bool bindmap_add_binding(WBindmap *bindmap, const WBinding *b)
{
    WRegBindingInfo *rbind=NULL;
    WBinding *binding=NULL;
    Rb_node node=NULL;
    int found=0;

    /* Handle adding the binding */
    binding=ALLOC(WBinding);

    if(binding==NULL){
        warn_err();
        return FALSE;
    }

    memcpy(binding, b, sizeof(*b));

    node=rb_find_gkey_n(bindmap->bindings, binding,
                        (Rb_compfn*)compare_bindings, &found);

    if(found){
        if(!rb_insert_a(node, binding, binding)){
            free(binding);
            return FALSE;
        }
        do_destroy_binding((WBinding*)rb_val(node));
        rb_delete_node(node);
        bindmap->nbindings--;
    }else{
        if(!rb_insertg(bindmap->bindings, binding, binding,
                       (Rb_compfn*)compare_bindings)){
            free(binding);
            return FALSE;
        }
    }

    bindmap->nbindings++;

    for(rbind=bindmap->rbind_list; rbind!=NULL; rbind=rbind->bm_next)
        rbind_binding_added(rbind, binding, bindmap);

    return TRUE;
}


bool bindmap_remove_binding(WBindmap *bindmap, const WBinding *b)
{
    WRegBindingInfo *rbind=NULL;
    WBinding *binding=NULL;
    Rb_node node=NULL;
    int found=0;

    if(bindmap->bindings==NULL)
        return FALSE;

    node=rb_find_gkey_n(bindmap->bindings, b, (Rb_compfn*)compare_bindings,
                        &found);

    if(!found)
        return FALSE;

    binding=(WBinding*)rb_val(node);

    for(rbind=bindmap->rbind_list; rbind!=NULL; rbind=rbind->bm_next)
        rbind_binding_removed(rbind, binding, bindmap);

    do_destroy_binding(binding);
    rb_delete_node(node);

    bindmap->nbindings--;

    return TRUE;
}


void ioncore_init_bindings()
{
    modmap=XGetModifierMapping(ioncore_g.dpy);

    assert(modmap!=NULL);

#ifdef CF_HACK_IGNORE_EVIL_LOCKS
    lookup_evil_locks();
#endif
}


void ioncore_update_modmap()
{
    XModifierKeymap *nm=XGetModifierMapping(ioncore_g.dpy);

    if(nm!=NULL){
        XFreeModifiermap(modmap);
        modmap=nm;
    }
}


/* */

static void grab_key(Display *display, uint keycode, uint ksb,
                     uint modifiers, const Window grab_window)
{
    unsigned long request_serial = NextRequest(display);
    if (grabCalls[grabCallHistoryIndex] == NULL)
        grabCalls[grabCallHistoryIndex] = malloc(sizeof(struct GrabCall));
    XGrabKey(display, keycode, modifiers, grab_window, True, GrabModeAsync,
             GrabModeAsync);
    grabCalls[grabCallHistoryIndex]->serial = request_serial;
    grabCalls[grabCallHistoryIndex]->ksb = ksb;
    grabCalls[grabCallHistoryIndex]->modifiers = modifiers;
    grabCallHistoryIndex = (grabCallHistoryIndex + 1) % N_GRAB_CALL_HISTORY;
}

void binding_grab_on(const WBinding *binding, Window win)
{
    if((binding->act==BINDING_KEYPRESS || binding->act==BINDING_SUBMAP) && binding->kcb!=0){
#ifndef CF_HACK_IGNORE_EVIL_LOCKS
        grab_key(ioncore_g.dpy, binding->kcb, binding->ksb, binding->state,
                 win, True, GrabModeAsync, GrabModeAsync);
#else
        evil_grab_key(ioncore_g.dpy,
                      binding->kcb, binding->ksb, binding->state,
                      win);
#endif
    }

    if(binding->act!=BINDING_BUTTONPRESS &&
       binding->act!=BINDING_BUTTONCLICK &&
       binding->act!=BINDING_BUTTONDBLCLICK &&
       binding->act!=BINDING_BUTTONMOTION)
        return;

    if(binding->state==0)
        return;

#ifndef CF_HACK_IGNORE_EVIL_LOCKS
    XGrabButton(ioncore_g.dpy, binding->kcb, binding->state, win,
                True, IONCORE_EVENTMASK_PTRGRAB, GrabModeAsync, GrabModeAsync,
                None, None);
#else
    evil_grab_button(ioncore_g.dpy, binding->kcb, binding->state, win,
                     True, IONCORE_EVENTMASK_PTRGRAB, GrabModeAsync, GrabModeAsync,
                     None, None);
#endif
}


void binding_ungrab_on(const WBinding *binding, Window win)
{
    if(binding->act==BINDING_KEYPRESS || binding->act==BINDING_SUBMAP){
#ifndef CF_HACK_IGNORE_EVIL_LOCKS
        XUngrabKey(ioncore_g.dpy, binding->kcb, binding->state, win);
#else
        evil_ungrab_key(ioncore_g.dpy, binding->kcb, binding->state, win);
#endif
    }

    if(binding->act!=BINDING_BUTTONPRESS &&
       binding->act!=BINDING_BUTTONCLICK &&
       binding->act!=BINDING_BUTTONDBLCLICK &&
       binding->act!=BINDING_BUTTONMOTION)
        return;

    if(binding->state==0)
        return;

#ifndef CF_HACK_IGNORE_EVIL_LOCKS
    XUngrabButton(ioncore_g.dpy, binding->kcb, binding->state, win);
#else
    evil_ungrab_button(ioncore_g.dpy, binding->kcb, binding->state, win);
#endif
}


/* */


static WBinding *search_binding(WBindmap *bindmap, WBinding *binding)
{
    Rb_node node;
    int found=0;

    if(bindmap->bindings==NULL)
        return NULL;

    node=rb_find_gkey_n(bindmap->bindings, binding,
                        (Rb_compfn*)compare_bindings, &found);

    if(found==0)
        return NULL;

    return (WBinding*)rb_val(node);
}


static WBinding *search_binding_ksb(WBindmap *bindmap, WBinding *binding)
{
    Rb_node node;
    int found=0;

    if(bindmap->bindings==NULL)
        return NULL;

    node=rb_find_gkey_n(bindmap->bindings, binding,
                        (Rb_compfn*)compare_bindings_ksb, &found);

    if(found==0)
        return NULL;

    return (WBinding*)rb_val(node);
}


static WBinding *do_bindmap_lookup_binding(WBindmap *bindmap,
                                           int act, uint state,
                                           uint kcb, int area)
{
    WBinding *binding, tmp;

    if(bindmap->nbindings==0)
        return NULL;

#ifdef CF_HACK_IGNORE_EVIL_LOCKS
    state&=~evilignoremask;
#endif
    state&=KNOWN_MODIFIERS_MASK;

    tmp.act=act;
    tmp.kcb=kcb;
    tmp.state=state;
    tmp.area=area;

    binding=search_binding(bindmap, &tmp);

    if(binding==NULL){
        tmp.state=AnyModifier;
        binding=search_binding(bindmap, &tmp);

        if(binding==NULL){
            tmp.state=state;
            tmp.ksb=((act==BINDING_KEYPRESS || act==BINDING_SUBMAP) ? AnyKey : AnyButton);

            binding=search_binding_ksb(bindmap, &tmp);

            if(binding==NULL){
                tmp.state=AnyModifier;
                binding=search_binding_ksb(bindmap, &tmp);
            }
        }
    }

    return binding;
}


WBinding *bindmap_lookup_binding(WBindmap *bindmap,
                                 int act, uint state, uint kcb)
{
    return do_bindmap_lookup_binding(bindmap, act, state, kcb, 0);
}


WBinding *bindmap_lookup_binding_area(WBindmap *bindmap,
                                      int act, uint state, uint kcb, int area)
{
    WBinding *binding;

    binding=do_bindmap_lookup_binding(bindmap, act, state, kcb, area);

    if(binding==NULL)
        binding=do_bindmap_lookup_binding(bindmap, act, state, kcb, 0);

    return binding;
}


/*
 * A dirty hack to deal with (==ignore) evil locking modifier keys.
 */


int ioncore_unmod(int state, int keycode)
{
    int j;

#ifdef CF_HACK_IGNORE_EVIL_LOCKS
    state&=~evilignoremask;
#endif

    for(j=0; j<N_MODS*modmap->max_keypermod; j++){
        if(modmap->modifiermap[j]==keycode)
            return state&~modmasks[j/modmap->max_keypermod];
    }

    return state;
}


int ioncore_modstate()
{
    char keys[32];
    int state=0;
    int j;

    XQueryKeymap(ioncore_g.dpy, keys);

    for(j=0; j<N_MODS*modmap->max_keypermod; j++){
        int a=(modmap->modifiermap[j]&7);
        int b=(modmap->modifiermap[j]>>3);
        if(b<32){
            if(keys[b]&(1<<a))
                state|=modmasks[j/modmap->max_keypermod];
        }
    }

#ifdef CF_HACK_IGNORE_EVIL_LOCKS
    state&=~evilignoremask;
#endif
    return state;
}

int ioncore_ksb(unsigned long serial)
{
    int i;
    for(i = 0; i < N_GRAB_CALL_HISTORY; i++) {
        if (grabCalls[i] != NULL && serial == grabCalls[i]->serial)
            return grabCalls[i]->ksb;
    }
    return -1;
}

extern uint ioncore_modifiers(unsigned long serial)
{
    int i;
    for(i = 0; i < N_GRAB_CALL_HISTORY; i++) {
        if (grabCalls[i] != NULL && serial == grabCalls[i]->serial)
            return grabCalls[i]->modifiers;
    }
    return -1;
}

bool ioncore_ismod(int keycode)
{
    int j;

    for(j=0; j<N_MODS*modmap->max_keypermod; j++){
        if(modmap->modifiermap[j]==keycode)
            return TRUE;
    }

    return FALSE;
}


#ifdef CF_HACK_IGNORE_EVIL_LOCKS

static void lookup_evil_locks()
{
    uint keycodes[N_LOOKUPEVIL];
    int i, j;

    for(i=0; i<N_LOOKUPEVIL; i++)
        keycodes[i]=XKeysymToKeycode(ioncore_g.dpy, evillocks[i]);

    for(j=0; j<N_MODS*modmap->max_keypermod; j++){
        for(i=0; i<N_LOOKUPEVIL; i++){
            if(keycodes[i]==None)
                continue;
            if(modmap->modifiermap[j]==keycodes[i]){
                evillockmasks[i]=modmasks[j/modmap->max_keypermod];
                evilignoremask|=evillockmasks[i];
            }
        }
    }
}


static void evil_grab_key(Display *display, uint keycode, uint ksb, uint modifiers,
                          const Window grab_window)
{
    uint mods;
    int i, j;

    grab_key(display, keycode, ksb, modifiers, grab_window);

    if(modifiers==AnyModifier)
        return;

    for(i=0; i<N_EVILLOCKS; i++){
        if(evillockmasks[i]==0)
            continue;
        mods=modifiers;
        for(j=i; j<N_EVILLOCKS; j++){
            if(evillockmasks[j]==0)
                continue;
            mods|=evillockmasks[j];
            grab_key(display, keycode, ksb, mods,
                     grab_window);
            if(i==j)
                continue;
            grab_key(display, keycode, ksb,
                     modifiers|evillockmasks[i]|evillockmasks[j],
                     grab_window);
        }
    }
}


static void evil_grab_button(Display *display, uint button, uint modifiers,
                             Window grab_window, bool owner_events,
                             uint event_mask, int pointer_mode,
                             int keyboard_mode, Window confine_to,
                             Cursor cursor)
{
    uint mods;
    int i, j;

    XGrabButton(display, button, modifiers,
                grab_window, owner_events, event_mask, pointer_mode,
                keyboard_mode, confine_to, cursor);

    if(modifiers==AnyModifier)
        return;

    for(i=0; i<N_EVILLOCKS; i++){
        if(evillockmasks[i]==0)
            continue;
        mods=modifiers;
        for(j=i; j<N_EVILLOCKS; j++){
            if(evillockmasks[j]==0)
                continue;
            mods|=evillockmasks[j];
            XGrabButton(display, button, mods,
                        grab_window, owner_events, event_mask, pointer_mode,
                        keyboard_mode, confine_to, cursor);
            if(i==j)
                continue;
            XGrabButton(display, button,
                        modifiers|evillockmasks[i]|evillockmasks[j],
                        grab_window, owner_events, event_mask, pointer_mode,
                        keyboard_mode, confine_to, cursor);
        }
    }
}


static void evil_ungrab_key(Display *display, uint keycode, uint modifiers,
                            Window grab_window)
{
    uint mods;
    int i, j;

    XUngrabKey(display, keycode, modifiers, grab_window);

    if(modifiers==AnyModifier)
        return;

    for(i=0; i<N_EVILLOCKS; i++){
        if(evillockmasks[i]==0)
            continue;
        mods=modifiers;
        for(j=i; j<N_EVILLOCKS; j++){
            if(evillockmasks[j]==0)
                continue;
            mods|=evillockmasks[j];
            XUngrabKey(display, keycode, mods, grab_window);
            if(i==j)
                continue;
            XUngrabKey(display, keycode,
                       modifiers|evillockmasks[i]|evillockmasks[j],
                       grab_window);
        }
    }
}


static void evil_ungrab_button(Display *display, uint button, uint modifiers,
                               Window grab_window)
{
    uint mods;
    int i, j;

    XUngrabButton(display, button, modifiers, grab_window);

    if(modifiers==AnyModifier)
        return;

    for(i=0; i<N_EVILLOCKS; i++){
        if(evillockmasks[i]==0)
            continue;
        mods=modifiers;
        for(j=i; j<N_EVILLOCKS; j++){
            if(evillockmasks[j]==0)
                continue;
            mods|=evillockmasks[j];
            XUngrabButton(display, button, mods, grab_window);
            if(i==j)
                continue;
            XUngrabButton(display, button,
                          modifiers|evillockmasks[i]|evillockmasks[j],
                          grab_window);
        }
    }

}

#endif /* CF_HACK_IGNORE_EVIL_LOCKS */