Merge 1.8.0~pre4 packaging into master
[pkg-k5-afs_openafs.git] / src / update / utils.c
blob1d5dc6a0727ad9a95625c98e8bcc862c1f0e0828
1 /*
2 * Copyright 2000, International Business Machines Corporation and others.
3 * All Rights Reserved.
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 */
10 #include <afsconfig.h>
11 #include <afs/param.h>
12 #include <afs/stds.h>
14 #include <roken.h>
16 #ifdef AFS_NT40_ENV
17 #include <afs/errmap_nt.h>
18 #include <afs/afsutil.h>
19 #include <WINNT/afssw.h>
20 #endif
22 #include <rx/rxkad.h>
23 #include "global.h"
26 int
27 AddToList(struct filestr **ah, char *aname)
29 struct filestr *tf;
30 tf = malloc(sizeof(struct filestr));
31 tf->next = *ah;
32 *ah = tf;
33 tf->name = strdup(aname);
34 return 0;
37 int
38 ZapList(struct filestr **ah)
40 struct filestr *tf, *nf;
41 for (tf = *ah; tf; tf = nf) {
42 nf = tf->next; /* save before freeing */
43 free(tf->name);
44 free(tf);
46 *ah = NULL;
47 return 0;