Commit | Line | Data |
---|---|---|
805e021f CE |
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 <afsconfig.h> | |
11 | #include <afs/param.h> | |
12 | #include <afs/stds.h> | |
13 | ||
14 | #include <roken.h> | |
15 | ||
16 | #ifdef AFS_NT40_ENV | |
17 | #include <afs/errmap_nt.h> | |
18 | #include <afs/afsutil.h> | |
19 | #include <WINNT/afssw.h> | |
20 | #endif | |
21 | ||
22 | #include <rx/rxkad.h> | |
23 | #include "global.h" | |
24 | ||
25 | ||
26 | int | |
27 | AddToList(struct filestr **ah, char *aname) | |
28 | { | |
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; | |
35 | } | |
36 | ||
37 | int | |
38 | ZapList(struct filestr **ah) | |
39 | { | |
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); | |
45 | } | |
46 | *ah = NULL; | |
47 | return 0; | |
48 | } |