/********************************************************************** * * evrdb.c * ======= * * This file is part of the VARKON Program Module Library. * URL: http://www.varkon.com * * This file includes the following routines: * * evdbop(); Evaluerar DB_OPEN * evdbbg(); Evaluerar DB_BEGIN * evdbsl(); Evaluerar DB_SELECT * evdbup(); Evaluerar DB_UPDATE * evdbin(); Evaluerar DB_INSERT * evdbdl(); Evaluerar DB_DELETE * evdben(); Evaluerar DB_END * evdbrl(); Evaluerar DB_ROLLBACK * evdbcl(); Evaluerar DB_CLOSE * evdbfi(); Evaluerar DB_FETCHI * evdbff(); Evaluerar DB_FETCHF * evdbfs(); Evaluerar DB_FETCHS * evdbnx(); Evaluerar DB_NEXT * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * (C)Microform AB 1984-1999, Johan Kjellander, johan@microform.se * ***********************************************************************/ #include "../../DB/include/DB.h" #include "../../IG/include/IG.h" #include "../../EX/include/EX.h" extern PMPARVA *func_pv; /* Access structure for MBS routines */ extern short func_pc; /* Number of actual parameters */ extern PMLITVA *func_vp; /* Pekare till resultat. */ /*!******************************************************/ short evdbop() /* Evaluerar funktionen DB_OPEN. * * In: Global func_pv => Parameter value array * Global *func_vp => Pointer to result value. * * Ut: Global *func_vp = Pointer to result value. * * FV: FV: Returnerar anropade rutiners status. * * (C)microform ab 16/5/87 J. Kjellander * * 2001-03-06 In-Param changed to Global variables, R Svedin * ******************************************************!*/ { return(EXdbop(func_pv[1].par_va.lit.str_va,&func_vp->lit.int_va)); } /********************************************************/ /*!******************************************************/ short evdbbg() /* Evaluerar funktionen DB_BEGIN. * * In: Global func_pv => Parameter value array * Global *func_vp => Pointer to result value. * * Ut: Global *func_vp = Pointer to result value. * * FV: FV: Returnerar anropade rutiners status. * * (C)microform ab 16/5/87 J. Kjellander * * 2001-03-06 In-Param changed to Global variables, R Svedin * ******************************************************!*/ { return(EXdbbg(func_pv[1].par_va.lit.str_va,&func_vp->lit.int_va)); } /********************************************************/ /*!******************************************************/ short evdbsl() /* Evaluerar funktionen DB_SELECT. * * In: Global func_pv => Parameter value array * Global *func_vp => Pointer to result value. * Global *func_pc => Number of actual parameters. * * Ut: Global *func_vp = Pointer to result value. * * FV: FV: Returnerar anropade rutiners status. * * (C)microform ab 16/5/87 J. Kjellander * * 2001-03-06 In-Param changed to Global variables, R Svedin * ******************************************************!*/ { return(EXdbsl(func_pv[1].par_va.lit.str_va, func_pv[2].par_va.lit.str_va, &func_pv[3].par_va, func_pv[4].par_va.lit.str_va, &func_pv[5].par_va, &func_pv[6], (short)(func_pc-5)/2, &func_vp->lit.int_va)); } /********************************************************/ /*!******************************************************/ short evdbup() /* Evaluerar funktionen DB_UPDATE. * * In: Global func_pv => Parameter value array * Global *func_vp => Pointer to result value. * Global *func_pc => Number of actual parameters. * * Ut: Global *func_vp = Pointer to result value. * * FV: FV: Returnerar anropade rutiners status. * * (C)microform ab 16/5/87 J. Kjellander * * 2001-03-06 In-Param changed to Global variables, R Svedin * ******************************************************!*/ { return(EXdbup(func_pv[1].par_va.lit.str_va, func_pv[2].par_va.lit.str_va, &func_pv[3].par_va, func_pv[4].par_va.lit.str_va, &func_pv[5].par_va, &func_pv[6], (short)(func_pc-5)/2, &func_vp->lit.int_va)); } /********************************************************/ /*!******************************************************/ short evdbin() /* Evaluerar funktionen DB_INSERT. * * In: Global func_pv => Parameter value array * Global *func_vp => Pointer to result value. * Global *func_pc => Number of actual parameters. * * Ut: Global *func_vp = Pointer to result value. * * FV: FV: Returnerar anropade rutiners status. * * (C)microform ab 16/5/87 J. Kjellander * * 2001-03-06 In-Param changed to Global variables, R Svedin * ******************************************************!*/ { return(EXdbin(func_pv[1].par_va.lit.str_va, &func_pv[2], (short)(func_pc-1)/2, &func_vp->lit.int_va)); } /********************************************************/ /*!******************************************************/ short evdbdl() /* Evaluerar funktionen DB_DELETE. * * In: Global func_pv => Parameter value array * Global *func_vp => Pointer to result value. * * Ut: Global *func_vp = Pointer to result value. * * FV: FV: Returnerar anropade rutiners status. * * (C)microform ab 16/5/87 J. Kjellander * * 2001-03-06 In-Param changed to Global variables, R Svedin * ******************************************************!*/ { return(EXdbdl(func_pv[1].par_va.lit.str_va, func_pv[2].par_va.lit.str_va, &func_pv[3].par_va, func_pv[4].par_va.lit.str_va, &func_pv[5].par_va, &func_vp->lit.int_va)); } /********************************************************/ /*!******************************************************/ short evdben() /* Evaluerar funktionen DB_END. * * In: * * Ut: Global *func_vp = Pointer to result value. * * FV: FV: Returnerar anropade rutiners status. * * (C)microform ab 16/5/87 J. Kjellander * * 2001-03-06 Param changed to Global variables, R Svedin * ******************************************************!*/ { return(EXdben(&func_vp->lit.int_va)); } /********************************************************/ /*!******************************************************/ short evdbrl() /* Evaluerar funktionen DB_ROLLBACK. * * In: * * Ut: Global *func_vp = Pointer to result value. * * FV: FV: Returnerar anropade rutiners status. * * (C)microform ab 16/5/87 J. Kjellander * * 2001-03-06 In-Param changed to Global variables, R Svedin * ******************************************************!*/ { return(EXdbrl(&func_vp->lit.int_va)); } /********************************************************/ /*!******************************************************/ short evdbcl() /* Evaluerar funktionen DB_CLOSE. * * In: * * Ut: Global *func_vp = Pointer to result value. * * FV: FV: Returnerar anropade rutiners status. * * (C)microform ab 16/5/87 J. Kjellander * * 2001-03-06 In-Param changed to Global variables, R Svedin * ******************************************************!*/ { return(EXdbcl(&func_vp->lit.int_va)); } /********************************************************/ /*!******************************************************/ short evdbfi() /* Evaluerar funktionen DB_FETCHI. * * In: Global func_pv => Parameter value array * Global *func_vp => Pointer to result value. * * Ut: Global *func_vp = Pointer to result value. * * FV: FV: Returnerar anropade rutiners status. * * (C)microform ab 16/5/87 J. Kjellander * * 2001-03-06 In-Param changed to Global variables, R Svedin * ******************************************************!*/ { short status; PMLITVA ival; if ( (status=EXdbfi((short)func_pv[1].par_va.lit.int_va, &ival.lit.int_va,&func_vp->lit.int_va)) < 0 ) return(status); else return(evwval(&ival, 1, func_pv)); } /********************************************************/ /*!******************************************************/ short evdbff() /* Evaluerar funktionen DB_FETCHF. * * In: Global func_pv => Parameter value array * Global *func_vp => Pointer to result value. * * Ut: Global *func_vp = Pointer to result value. * * FV: FV: Returnerar anropade rutiners status. * * (C)microform ab 16/5/87 J. Kjellander * * 2001-03-06 In-Param changed to Global variables, R Svedin * ******************************************************!*/ { short status; PMLITVA fval; if ( (status=EXdbff((short)func_pv[1].par_va.lit.int_va, &fval.lit.float_va,&func_vp->lit.int_va)) < 0 ) return(status); else return(evwval(&fval, 1, func_pv)); } /********************************************************/ /*!******************************************************/ short evdbfs() /* Evaluerar funktionen DB_FETCHS. * * In: Global func_pv => Parameter value array * Global *func_vp => Pointer to result value. * * Ut: Global *func_vp = Pointer to result value. * * FV: FV: Returnerar anropade rutiners status. * * (C)microform ab 16/5/87 J. Kjellander * * 2001-03-06 In-Param changed to Global variables, R Svedin * ******************************************************!*/ { short status; PMLITVA sval; if ( (status=EXdbfs((short)func_pv[1].par_va.lit.int_va, sval.lit.str_va,&func_vp->lit.int_va)) < 0 ) return(status); else return(evwval(&sval, 1, func_pv)); } /********************************************************/ /*!******************************************************/ short evdbnx() /* Evaluerar funktionen DB_NEXT. * * In: * * Ut: Global *func_vp = Pointer to result value. * * FV: FV: Returnerar anropade rutiners status. * * (C)microform ab 16/5/87 J. Kjellander * * 2001-03-06 In-Param changed to Global variables, R Svedin * ******************************************************!*/ { return(EXdbnx(&func_vp->lit.int_va)); } /********************************************************/