|
From: Andre R. <and...@us...> - 2006-03-10 13:41:32
|
Update of /cvsroot/frontierkernel/Frontier/Common/source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19920/Common/source Modified Files: langregexp.c langvalue.c Log Message: Moved getoptionaladdressparam and getoptionaltableparam from langregexp.c to langvalue.c and made them publicly available via lang.h. Index: langvalue.c =================================================================== RCS file: /cvsroot/frontierkernel/Frontier/Common/source/langvalue.c,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** langvalue.c 15 Dec 2005 21:42:52 -0000 1.8 --- langvalue.c 10 Mar 2006 13:41:29 -0000 1.9 *************** *** 4655,4658 **** --- 4655,4705 ---- + boolean getoptionaladdressparam (hdltreenode hfirst, short *ctconsumed, short *ctpositional, bigstring bsparam, hdlhashtable *ht, bigstring bsname) { + + /* + Get an optional parameter that is expected to be an address value. + If the param is not specified or if it is nil, we don't return anything. + + 2006-03-10 aradke: transplanted from langregexp.c + */ + + tyvaluerecord vparam; + + setaddressvalue (nil, emptystring, &vparam); + + if (!getoptionalparamvalue (hfirst, ctconsumed, ctpositional, bsparam, &vparam)) + return (false); + + return (getaddressvalue (vparam, ht, bsname)); + } /*getoptionaladdressparam*/ + + + boolean getoptionaltableparam (hdltreenode hfirst, short *ctconsumed, short *ctpositional, bigstring bsparam, hdlhashtable *htable) { + + /* + Get an optional parameter that is expected to be the address of a table. + If the param is not specified or if it is nil, we don't return anything. + If the param is a valid address, we make sure a table exists at the + indicated location and return a handle to it. + + 2006-03-10 aradke: transplanted from langregexp.c + */ + + hdlhashtable ht; + bigstring bsname; + + if (!getoptionaladdressparam (hfirst, ctconsumed, ctpositional, bsparam, &ht, bsname)) + return (false); + + if (ht == nil && isemptystring (bsname)) + return (true); + + if (!langassignnewtablevalue (ht, bsname, htable)) + return (false); + + return (true); + } /*getoptionaltableparam*/ + + boolean getaddressparam (hdltreenode hfirst, short pnum, tyvaluerecord *val) { Index: langregexp.c =================================================================== RCS file: /cvsroot/frontierkernel/Frontier/Common/source/langregexp.c,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** langregexp.c 18 Feb 2006 19:40:59 -0000 1.11 --- langregexp.c 10 Mar 2006 13:41:29 -0000 1.12 *************** *** 847,893 **** - static boolean getoptionaladdressparam (hdltreenode hfirst, short *ctconsumed, short *ctpositional, bigstring bsparam, hdlhashtable *ht, bigstring bsname) { - - /* - Get an optional parameter that is expected to be an address value. - If the param is not specified or if it is nil, we don't return anything. - */ - - tyvaluerecord vparam; - - setaddressvalue (nil, emptystring, &vparam); - - if (!getoptionalparamvalue (hfirst, ctconsumed, ctpositional, bsparam, &vparam)) - return (false); - - return (getaddressvalue (vparam, ht, bsname)); - } /*getoptionaladdressparam*/ - - - static boolean getoptionaltableparam (hdltreenode hfirst, short *ctconsumed, short *ctpositional, bigstring bsparam, hdlhashtable *htable) { - - /* - Get an optional parameter that is expected to be the address of a table. - If the param is not specified or if it is nil, we don't return anything. - If the param is a valid address, we make sure a table exists at the - indicated location and return a handle to it. - */ - - hdlhashtable ht; - bigstring bsname; - - if (!getoptionaladdressparam (hfirst, ctconsumed, ctpositional, bsparam, &ht, bsname)) - return (false); - - if (ht == nil && isemptystring (bsname)) - return (true); - - if (!langassignnewtablevalue (ht, bsname, htable)) - return (false); - - return (true); - } /*getoptionaltableparam*/ - - static boolean getoptionallistparam (hdltreenode hfirst, short *ctconsumed, short *ctpositional, bigstring bsparam, hdllistrecord *hlist) { --- 847,850 ---- |