From bb9deea40803dfc6c348ff99cd7c245da63a9c0d Mon Sep 17 00:00:00 2001 From: Cedric Bastoul Date: Tue, 17 Jan 2012 02:18:36 +0100 Subject: [PATCH] Add osl_scop_add function --- include/osl/scop.h.in | 1 + source/scop.c | 15 +++++++++++++++ 2 files changed, 16 insertions(+) diff --git a/include/osl/scop.h.in b/include/osl/scop.h.in index c8904ce..002592d 100644 --- a/include/osl/scop.h.in +++ b/include/osl/scop.h.in @@ -135,6 +135,7 @@ void osl_scop_free(osl_scop_p); /*+*************************************************************************** * Processing functions * *****************************************************************************/ +void osl_scop_add(osl_scop_p *, osl_scop_p); osl_scop_p osl_scop_clone(osl_scop_p); int osl_scop_equal(osl_scop_p, osl_scop_p); int osl_scop_integrity_check(osl_scop_p); diff --git a/source/scop.c b/source/scop.c index 73cbd9f..eac506f 100644 --- a/source/scop.c +++ b/source/scop.c @@ -493,6 +493,21 @@ void osl_scop_free(osl_scop_p scop) { /** + * osl_scop_add function: + * this function adds a scop "scop" at the end of the scop list pointed + * by "location". + * \param[in,out] location Address of the first element of the scop list. + * \param[in] scop The scop to add to the list. + */ +void osl_scop_add(osl_scop_p * location, osl_scop_p scop) { + while (*location != NULL) + location = &((*location)->next); + + *location = scop; +} + + +/** * osl_scop_clone function: * This functions builds and returns a "hard copy" (not a pointer copy) * of a osl_statement_t data structure provided as parameter. -- 2.11.4.GIT