/***********************************************************************1* *2* This software is part of the ast package *3* Copyright (c) 1996-2011 AT&T Intellectual Property *4* and is licensed under the *5* Eclipse Public License, Version 1.0 *6* by AT&T Intellectual Property *7* *8* A copy of the License is available at *9* http://www.eclipse.org/org/documents/epl-v10.html *10* (with md5 checksum b35adb5213ca9657e911e9befb180842) *11* *12* Information and Software Systems Research *13* AT&T Research *14* Florham Park NJ *15* *16* Phong Vo <[email protected]> *17* Glenn Fowler <[email protected]> *18* *19***********************************************************************/20/*21* copy input records in original order22* presumably for the benefit of discipline23* function alterations24*/2526#include "rshdr.h"2728typedef struct Copy_s29{30Rsobj_t* head;31Rsobj_t* tail;32} Copy_t;3334#if __STD_C35static int copyinsert(Rs_t* rs, reg Rsobj_t* obj)36#else37static int copyinsert(rs, obj)38Rs_t* rs;39reg Rsobj_t* obj;40#endif41{42reg Copy_t* copy = (Copy_t*)rs->methdata;4344if (copy->tail)45copy->tail->right = obj;46else47copy->head = obj;48copy->tail = obj;49return 0;50}5152#if __STD_C53static Rsobj_t* copylist(Rs_t* rs)54#else55static Rsobj_t* copylist(rs)56Rs_t* rs;57#endif58{59reg Copy_t* copy = (Copy_t*)rs->methdata;6061if (copy->tail)62{63copy->tail->right = 0;64copy->tail = 0;65}66return copy->head;67}6869static Rsmethod_t _Rscopy =70{71copyinsert,72copylist,73sizeof(Copy_t),74RS_MTCOPY,75"copy",76"Copy (no sort)."77};7879__DEFINE__(Rsmethod_t*, Rscopy, &_Rscopy);8081#ifdef NoF82NoF(rscopy)83#endif848586