2 * Copyright 2000, International Business Machines Corporation and others.
5 * This software has been released under the terms of the IBM Public
6 * License. For details, see the LICENSE file in the top-level source
7 * directory or online at http://www.openafs.org/dl/license10.html
10 /* Copyright (C) 1994 Cazamar Systems, Inc. */
13 #include <afs/param.h>
20 /* table of dynamic lock types. First entry isn't used, since those are
21 * wired in for performance reasons.
23 osi_lockOps_t *osi_lockOps[OSI_NLOCKTYPES];
24 char *osi_lockOpNames[OSI_NLOCKTYPES];
26 /* first free slot in lock operations; slot 0 is not used */
27 int osi_lockTypeIndex = 1;
29 /* type to create generically */
30 int osi_lockTypeDefault = 0;
32 int osi_LockTypeFind(char *namep)
36 for(i=1; i<osi_lockTypeIndex; i++) {
37 if (!strcmp(osi_lockOpNames[i], namep)) return i;
42 void osi_LockTypeAdd(osi_lockOps_t *statOps, char *namep, int *indexp)
45 if ((i = osi_lockTypeIndex) >= OSI_NLOCKTYPES) return;
46 osi_lockOps[i] = statOps;
47 osi_lockOpNames[i] = namep;
49 osi_lockTypeIndex = i+1;
52 osi_LockTypeSetDefault(char *namep)
56 if (namep == (char *) 0)
57 osi_lockTypeDefault = 0;
59 index = osi_LockTypeFind(namep);
60 if (index > 0) osi_lockTypeDefault = index;