X-Git-Url: http://andersk.mit.edu/gitweb/splint.git/blobdiff_plain/b46462e0f425a997aca96d09c7eba11d4cdda1c4..28bf4b0bfd405a2057d865910f8589c54a40f17b:/src/ctypeList.c diff --git a/src/ctypeList.c b/src/ctypeList.c index c5fab28..47ea1e8 100644 --- a/src/ctypeList.c +++ b/src/ctypeList.c @@ -1,6 +1,6 @@ /* ** LCLint - annotation-assisted static program checker -** Copyright (C) 1994-2000 University of Virginia, +** Copyright (C) 1994-2001 University of Virginia, ** Massachusetts Institute of Technology ** ** This program is free software; you can redistribute it and/or modify it @@ -79,6 +79,31 @@ void ctypeList_addh (ctypeList s, ctype el) s->nelements++; } +ctypeList ctypeList_add (ctypeList s, ctype el) +{ + llassert (ctypeListBASESIZE > 0); + + if (ctypeList_isUndefined (s)) + { + s = ctypeList_new (); + } + + ctypeList_addh (s, el); + return s; +} + +ctypeList ctypeList_append (ctypeList s1, ctypeList s2) +{ + ctypeList res = s1; + + ctypeList_elements (s2, el) + { + res = ctypeList_add (res, el); + } end_ctypeList_elements; + + return res; +} + /*@only@*/ cstring ctypeList_unparse (ctypeList ct) {