]>
cygwin.com Git - cygwin-apps/setup.git/blob - strarry.c
2 * Copyright (c) 2000, Red Hat, Inc.
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
9 * A copy of the GNU General Public License can be found at
12 * Written by Ron Parker <parkerrd@hotmail.com>
16 /* strarry.c: implementation of the strarry struct routines. */
30 sa_add (SA
* array
, const char *str
)
32 array
->array
= array
->count
33 ? xrealloc (array
->array
, sizeof (char *) * (array
->count
+ 1))
34 : xmalloc (sizeof (char *));
35 array
->array
[array
->count
++] = xstrdup (str
);
39 sa_cleanup (SA
* array
)
41 size_t n
= array
->count
;
43 xfree (array
->array
[n
]);
This page took 0.037196 seconds and 5 git commands to generate.