• Main Page
  • Related Pages
  • Modules
  • Namespaces
  • Data Structures
  • Files
  • File List
  • Globals

contrib/maloc/src/vsys/vnmfb.c

00001 /*
00002  * ***************************************************************************
00003  * MALOC = < Minimal Abstraction Layer for Object-oriented C >
00004  * Copyright (C) 1994--2008 Michael Holst
00005  *
00006  * This library is free software; you can redistribute it and/or
00007  * modify it under the terms of the GNU Lesser General Public
00008  * License as published by the Free Software Foundation; either
00009  * version 2.1 of the License, or (at your option) any later version.
00010  *
00011  * This library is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
00014  * Lesser General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU Lesser General Public
00017  * License along with this library; if not, write to the Free Software
00018  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
00019  *
00020  * rcsid="$Id: vnmfb.c,v 1.8 2008/03/12 05:13:59 fetk Exp $"
00021  * ***************************************************************************
00022  */
00023 
00024 /*
00025  * ***************************************************************************
00026  * File:     vnmfb.c
00027  *
00028  * Purpose:  FORTRAN bindings for the Vnm class methods.
00029  *
00030  * Notes:    We provide FORTRAN stubs for the following manglings:
00031  *
00032  *               vrnd   --> no underscore,     lowercase (default)
00033  *               VRND   --> no underscore,     uppercase
00034  *               vrnd_  --> single underscore, lowercase
00035  *               VRND_  --> single underscore, uppercase
00036  *               vrnd__ --> double underscore, lowercase
00037  *               VRND__ --> double underscore, uppercase
00038  *
00039  * Author:   Michael Holst
00040  * ***************************************************************************
00041  */
00042 
00043 #include "vnm_p.h"
00044 
00045 VEMBED(rcsid="$Id: vnmfb.c,v 1.8 2008/03/12 05:13:59 fetk Exp $")
00046 
00047 /*
00048  * ***************************************************************************
00049  * Class Vnm FORTRAN binding prototypes (default: no underscore, lowercase)
00050  * ***************************************************************************
00051  */
00052 
00053 VEXTERNC int vrnd(void);
00054 VEXTERNC int vrndmx(void);
00055 VEXTERNC double vepsma(void);
00056 VEXTERNC void vtstrt(int *timer, char *name, int *len);
00057 VEXTERNC void vtstop(int *timer, char *name, int *len);
00058 VEXTERNC int vsystm(char *cmd, int *len);
00059 VEXTERNC void vnmprt(int *unit, char *strng, int *len);
00060 VEXTERNC void vnmpri(int *unit, char *strng, int *len, int *val);
00061 VEXTERNC void vnmprd(int *unit, char *strng, int *len, double *val);
00062 
00063 /*
00064  * ***************************************************************************
00065  * Class Vnm FORTRAN bindings
00066  * ***************************************************************************
00067  */
00068 
00069 /*
00070  * ***************************************************************************
00071  * Routine:  vrnd
00072  *
00073  * Purpose:  Returns a pseudo-random integer between 0 and VRANDMAX.
00074  *
00075  * Author:   Michael Holst
00076  * ***************************************************************************
00077  */
00078 VPUBLIC int vrnd(void)
00079 {
00080     return VRAND;
00081 }
00082 
00083 /*
00084  * ***************************************************************************
00085  * Routine:  vrndmx
00086  *
00087  * Purpose:  Returns VRANDMAX.
00088  *
00089  * Author:   Michael Holst
00090  * ***************************************************************************
00091  */
00092 VPUBLIC int vrndmx(void)
00093 {
00094     return VRANDMAX; 
00095 }
00096 
00097 /*
00098  * ***************************************************************************
00099  * Routine:  vepsma
00100  *
00101  * Purpose:  Computes the unit roundoff of the machine in single precision.
00102  *
00103  * Author:   Michael Holst
00104  * ***************************************************************************
00105  */
00106 VPUBLIC double vepsma(void)
00107 {
00108     return Vnm_epsmac();
00109 }
00110 
00111 /*
00112  * ***************************************************************************
00113  * Routine:  vtstrt
00114  *
00115  * Purpose:  Starts the timer on the particular machine.
00116  *
00117  * Author:   Michael Holst
00118  * ***************************************************************************
00119  */
00120 VPUBLIC void vtstrt(int *timer, char *name, int *len)
00121 {
00122     int i;
00123     char buf[VMAX_ARGLEN];
00124 
00125     VASSERT( VMAX_ARGLEN > *len );
00126     for (i=0; i<*len; i++) {
00127         buf[i] = name[i];
00128     }
00129     buf[*len] = '\0';
00130 
00131     Vnm_tstart(*timer, buf);
00132 }
00133 
00134 /*
00135  * ***************************************************************************
00136  * Routine:  vtstop
00137  *
00138  * Purpose:  Stops the timer on the particular machine.
00139  *
00140  * Author:   Michael Holst
00141  * ***************************************************************************
00142  */
00143 VPUBLIC void vtstop(int *timer, char *name, int *len)
00144 {
00145     int i;
00146     char buf[VMAX_ARGLEN];
00147 
00148     VASSERT( VMAX_ARGLEN > *len );
00149     for (i=0; i<*len; i++) {
00150         buf[i] = name[i];
00151     }
00152     buf[*len] = '\0';
00153 
00154     Vnm_tstop(*timer, buf);
00155 }
00156 
00157 /*
00158  * ***************************************************************************
00159  * Routine:  vsystm
00160  *
00161  * Purpose:  An improved ANSI-C "system" call.
00162  *
00163  * Author:   Michael Holst
00164  * ***************************************************************************
00165  */
00166 VPUBLIC int vsystm(char *cmd, int *len)
00167 {
00168     int i;
00169     char buf[VMAX_ARGLEN];
00170 
00171     VASSERT( VMAX_ARGLEN > *len );
00172     for (i=0; i<*len; i++) {
00173         buf[i] = cmd[i];
00174     }
00175     buf[*len] = '\0';
00176 
00177     return Vnm_system(buf);
00178 }   
00179 
00180 /*
00181  * ***************************************************************************
00182  * Routine:  vnmprt
00183  *
00184  * Purpose:  External interface to the console i/o routine.
00185  *
00186  * Author:   Michael Holst
00187  * ***************************************************************************
00188  */
00189 VPUBLIC void vnmprt(int *unit, char *strng, int *len)
00190 {
00191     int i;
00192     char buf[VMAX_ARGLEN];
00193 
00194     VASSERT( VMAX_ARGLEN > *len );
00195     for (i=0; i<*len; i++) {
00196         buf[i] = strng[i];
00197     }
00198     buf[*len] = '\0';
00199 
00200     Vnm_print(*unit, "%s\n", buf);
00201 }
00202 
00203 /*
00204  * ***************************************************************************
00205  * Routine:  vnmpri
00206  *
00207  * Purpose:  External interface to the console i/o routine.
00208  *
00209  * Author:   Michael Holst
00210  * ***************************************************************************
00211  */
00212 VPUBLIC void vnmpri(int *unit, char *strng, int *len, int *val)
00213 {
00214     int i;
00215     char buf[VMAX_ARGLEN];
00216 
00217     VASSERT( VMAX_ARGLEN > *len );
00218     for (i=0; i<*len; i++) {
00219         buf[i] = strng[i];
00220     }
00221     buf[*len] = '\0';
00222 
00223     Vnm_print(*unit, "%s %d\n", buf, *val);
00224 }
00225 
00226 /*
00227  * ***************************************************************************
00228  * Routine:  vnmprd
00229  *
00230  * Purpose:  External interface to the console i/o routine.
00231  *
00232  * Author:   Michael Holst
00233  * ***************************************************************************
00234  */
00235 VPUBLIC void vnmprd(int *unit, char *strng, int *len, double *val)
00236 {
00237     int i;
00238     char buf[VMAX_ARGLEN];
00239 
00240     VASSERT( VMAX_ARGLEN > *len );
00241     for (i=0; i<*len; i++) {
00242         buf[i] = strng[i];
00243     }
00244     buf[*len] = '\0';
00245 
00246     Vnm_print(*unit, "%s %e\n", buf, *val);
00247 }
00248 
00249 /*
00250  * ***************************************************************************
00251  * Class Vnm FORTRAN binding STUBS (no underscore, uppercase)
00252  * ***************************************************************************
00253  */
00254 
00255 VPUBLIC int VRND(void)
00256 {
00257     return vrnd();
00258 }
00259 
00260 VPUBLIC int VRNDMX(void)
00261 {
00262     return vrndmx();
00263 }
00264 
00265 VPUBLIC double VEPSMA(void)
00266 {
00267     return vepsma();
00268 }
00269 
00270 VPUBLIC void VTSTRT(int *timer, char *name, int *len)
00271 {
00272     vtstrt(timer, name, len);
00273 }
00274 
00275 VPUBLIC void VTSTOP(int *timer, char *name, int *len)
00276 {
00277     vtstop(timer, name, len);
00278 }
00279 
00280 VPUBLIC int VSYSTM(char *cmd, int *len)
00281 {
00282     return vsystm(cmd, len);
00283 }
00284 
00285 VPUBLIC void VNMPRT(int *unit, char *strng, int *len)
00286 {
00287     vnmprt(unit, strng, len);
00288 }
00289 
00290 VPUBLIC void VNMPRI(int *unit, char *strng, int *len, int *val)
00291 {
00292     vnmpri(unit, strng, len, val);
00293 }
00294 
00295 VPUBLIC void VNMPRD(int *unit, char *strng, int *len, double *val)
00296 {
00297     vnmprd(unit, strng, len, val);
00298 }
00299 
00300 /*
00301  * ***************************************************************************
00302  * Class Vnm FORTRAN binding STUBS (one underscore, lowercase)
00303  * ***************************************************************************
00304  */
00305 
00306 VPUBLIC int vrnd_(void)
00307 {
00308     return vrnd();
00309 }
00310 
00311 VPUBLIC int vrndmx_(void)
00312 {
00313     return vrndmx();
00314 }
00315 
00316 VPUBLIC double vepsma_(void)
00317 {
00318     return vepsma();
00319 }
00320 
00321 VPUBLIC void vtstrt_(int *timer, char *name, int *len)
00322 {
00323     vtstrt(timer, name, len);
00324 }
00325 
00326 VPUBLIC void vtstop_(int *timer, char *name, int *len)
00327 {
00328     vtstop(timer, name, len);
00329 }
00330 
00331 VPUBLIC int vsystm_(char *cmd, int *len)
00332 {
00333     return vsystm(cmd, len);
00334 }
00335 
00336 VPUBLIC void vnmprt_(int *unit, char *strng, int *len)
00337 {
00338     vnmprt(unit, strng, len);
00339 }
00340 
00341 VPUBLIC void vnmpri_(int *unit, char *strng, int *len, int *val)
00342 {
00343     vnmpri(unit, strng, len, val);
00344 }
00345 
00346 VPUBLIC void vnmprd_(int *unit, char *strng, int *len, double *val)
00347 {
00348     vnmprd(unit, strng, len, val);
00349 }
00350 
00351 /*
00352  * ***************************************************************************
00353  * Class Vnm FORTRAN binding STUBS (one underscore, uppercase)
00354  * ***************************************************************************
00355  */
00356 
00357 VPUBLIC int VRND_(void)
00358 {
00359     return vrnd();
00360 }
00361 
00362 VPUBLIC int VRNDMX_(void)
00363 {
00364     return vrndmx();
00365 }
00366 
00367 VPUBLIC double VEPSMA_(void)
00368 {
00369     return vepsma();
00370 }
00371 
00372 VPUBLIC void VTSTRT_(int *timer, char *name, int *len)
00373 {
00374     vtstrt(timer, name, len);
00375 }
00376 
00377 VPUBLIC void VTSTOP_(int *timer, char *name, int *len)
00378 {
00379     vtstop(timer, name, len);
00380 }
00381 
00382 VPUBLIC int VSYSTM_(char *cmd, int *len)
00383 {
00384     return vsystm(cmd, len);
00385 }
00386 
00387 VPUBLIC void VNMPRT_(int *unit, char *strng, int *len)
00388 {
00389     vnmprt(unit, strng, len);
00390 }
00391 
00392 VPUBLIC void VNMPRI_(int *unit, char *strng, int *len, int *val)
00393 {
00394     vnmpri(unit, strng, len, val);
00395 }
00396 
00397 VPUBLIC void VNMPRD_(int *unit, char *strng, int *len, double *val)
00398 {
00399     vnmprd(unit, strng, len, val);
00400 }
00401 
00402 /*
00403  * ***************************************************************************
00404  * Class Vnm FORTRAN binding STUBS (double underscore, lowercase)
00405  * ***************************************************************************
00406  */
00407 
00408 VPUBLIC int vrnd__(void)
00409 {
00410     return vrnd();
00411 }
00412 
00413 VPUBLIC int vrndmx__(void)
00414 {
00415     return vrndmx();
00416 }
00417 
00418 VPUBLIC double vepsma__(void)
00419 {
00420     return vepsma();
00421 }
00422 
00423 VPUBLIC void vtstrt__(int *timer, char *name, int *len)
00424 {
00425     vtstrt(timer, name, len);
00426 }
00427 
00428 VPUBLIC void vtstop__(int *timer, char *name, int *len)
00429 {
00430     vtstop(timer, name, len);
00431 }
00432 
00433 VPUBLIC int vsystm__(char *cmd, int *len)
00434 {
00435     return vsystm(cmd, len);
00436 }
00437 
00438 VPUBLIC void vnmprt__(int *unit, char *strng, int *len)
00439 {
00440     vnmprt(unit, strng, len);
00441 }
00442 
00443 VPUBLIC void vnmpri__(int *unit, char *strng, int *len, int *val)
00444 {
00445     vnmpri(unit, strng, len, val);
00446 }
00447 
00448 VPUBLIC void vnmprd__(int *unit, char *strng, int *len, double *val)
00449 {
00450     vnmprd(unit, strng, len, val);
00451 }
00452 
00453 /*
00454  * ***************************************************************************
00455  * Class Vnm FORTRAN binding STUBS (double underscore, uppercase)
00456  * ***************************************************************************
00457  */
00458 
00459 VPUBLIC int VRND__(void)
00460 {
00461     return vrnd();
00462 }
00463 
00464 VPUBLIC int VRNDMX__(void)
00465 {
00466     return vrndmx();
00467 }
00468 
00469 VPUBLIC double VEPSMA__(void)
00470 {
00471     return vepsma();
00472 }
00473 
00474 VPUBLIC void VTSTRT__(int *timer, char *name, int *len)
00475 {
00476     vtstrt(timer, name, len);
00477 }
00478 
00479 VPUBLIC void VTSTOP__(int *timer, char *name, int *len)
00480 {
00481     vtstop(timer, name, len);
00482 }
00483 
00484 VPUBLIC int VSYSTM__(char *cmd, int *len)
00485 {
00486     return vsystm(cmd, len);
00487 }
00488 
00489 VPUBLIC void VNMPRT__(int *unit, char *strng, int *len)
00490 {
00491     vnmprt(unit, strng, len);
00492 }
00493 
00494 VPUBLIC void VNMPRI__(int *unit, char *strng, int *len, int *val)
00495 {
00496     vnmpri(unit, strng, len, val);
00497 }
00498 
00499 VPUBLIC void VNMPRD__(int *unit, char *strng, int *len, double *val)
00500 {
00501     vnmprd(unit, strng, len, val);
00502 }
00503 

Generated on Wed Oct 20 2010 11:12:15 for APBS by  doxygen 1.7.2