windows-multi-fix-20061003
[openafs.git] / src / WINNT / afsd / cm_dir.c
1 /*
2  * Copyright 2000, International Business Machines Corporation and others.
3  * All Rights Reserved.
4  * 
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
8  */
9
10 #include <afs/param.h>
11 #include <afs/stds.h>
12
13 #include <windows.h>
14 #include <string.h>
15 #include <malloc.h>
16 #include <osi.h>
17 #include "afsd.h"
18 #include <rx/rx.h>
19
20
21 /* compute how many 32 byte entries an AFS 3 dir requires for storing
22  * the specified name.
23  */
24 long cm_NameEntries(char *namep, long *lenp)
25 {
26     long i;
27         
28     i = (long)strlen(namep);
29     if (lenp) *lenp = i;
30     return 1+((i+16)>>5);
31 }