2
** Written by David Gerdes US Army Construction Engineering Research Lab
4
** Copyright 1992 USA-CERL All rights reserved.
9
** takes 1st command line argument and stuffs each letter of it into
10
** a linked list. then prints it back out to stdout.
11
** If a second argument is specified, the first argument is put in the
15
#include <grass/linkm.h>
23
int main(int argc, char *argv[])
27
struct link List, *tmp, *p;
31
fprintf(stderr, "Usage: %s str [rev]\n", argv[0]), exit(1);
41
head = (VOID_T *) link_init(sizeof(struct link));
43
for (i = 0; argv[1][i]; i++) {
44
tmp = (struct link *)link_new(head);
45
tmp->let = argv[1][i];
47
add_link_rev(&List, tmp);
55
while (p->next != NULL) {
57
link_dispose(head, p);
66
int add_link_rev(struct link *List, struct link *link)
75
int add_link(struct link *List, struct link *link)
80
while (p->next != NULL)
86
int dumplist(struct link *List)