Update NEWS for 1.6.22
[pkg-k5-afs_openafs.git] / src / update / utils.c
blob315e04e645cceda485f6ab896946f0fdef8b17dc
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>
14 #include <afs/stds.h>
15 #include <rx/rxkad.h>
16 #include "global.h"
17 #ifdef AFS_NT40_ENV
18 #include <afs/errmap_nt.h>
19 #include <afs/afsutil.h>
20 #include <WINNT/afssw.h>
21 #endif
22 #include <stdio.h>
23 #include <string.h>
24 #ifdef HAVE_UNISTD_H
25 #include <unistd.h>
26 #endif
27 #include <stdlib.h>
29 int
30 AddToList(struct filestr **ah, char *aname)
32 struct filestr *tf;
33 tf = (struct filestr *)malloc(sizeof(struct filestr));
34 tf->next = *ah;
35 *ah = tf;
36 tf->name = (char *)malloc(strlen(aname) + 1);
37 strcpy(tf->name, aname);
38 return 0;
41 int
42 ZapList(struct filestr **ah)
44 struct filestr *tf, *nf;
45 for (tf = *ah; tf; tf = nf) {
46 nf = tf->next; /* save before freeing */
47 free(tf->name);
48 free(tf);
50 *ah = NULL;
51 return 0;