/***********************************************************************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#include "rshdr.h"2122/* Change method for a context23**24** Written by Kiem-Phong Vo (07/29/96).25*/2627#if __STD_C28Rsmethod_t* rsmethod(Rs_t* rs, Rsmethod_t* meth)29#else30Rsmethod_t* rsmethod(rs, meth)31Rs_t* rs;32Rsmethod_t* meth;33#endif34{35reg Rsmethod_t* old = rs->meth;36reg Void_t* methdata;3738if(!meth)39return old;4041if (RSNOTIFY(rs,RS_METHOD,meth,0,rs->disc) < 0)42return NIL(Rsmethod_t*);4344if(meth->size <= 0)45methdata = NIL(Void_t*);46else if(!(methdata = vmresize(Vmheap,NIL(Void_t*),meth->size,VM_RSZERO)) )47return NIL(Rsmethod_t*);4849if(rs->methdata)50vmfree(Vmheap,rs->methdata);5152rs->meth = meth;53rs->methdata = methdata;5455return old;56}575859