home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Source Code / C / Applications / UIFlow 1.0.1 / UIFlow Source / VSet2.0 / Src / vgF.c < prev    next >
Encoding:
C/C++ Source or Header  |  1992-04-20  |  19.7 KB  |  1,242 lines  |  [TEXT/????]

  1. /*****************************************************************************
  2. *              NCSA HDF Vset release 2.1
  3. *                    May 1991
  4. *
  5. * NCSA HDF Vset release 2.1 source code and documentation are in the public
  6. * domain.  Specifically, we give to the public domain all rights for future
  7. * licensing of the source code, all resale rights, and all publishing rights.
  8. * We ask, but do not require, that the following message be included in all
  9. * derived works:
  10. * Portions developed at the National Center for Supercomputing Applications at
  11. * the University of Illinois at Urbana-Champaign.
  12. * THE UNIVERSITY OF ILLINOIS GIVES NO WARRANTY, EXPRESSED OR IMPLIED, FOR THE
  13. * SOFTWARE AND/OR DOCUMENTATION PROVIDED, INCLUDING, WITHOUT LIMITATION,
  14. * WARRANTY OF MERCHANTABILITY AND WARRANTY OF FITNESS FOR A PARTICULAR PURPOSE
  15. *****************************************************************************
  16. * Likkai Ng May 1991 NCSA
  17. *
  18. * vgF.c
  19. * Part of the HDF VSet interface.
  20. *
  21. * C routines (short names) to be called from fortran 
  22. *
  23. *
  24. ************************************************************************/
  25.  
  26.  
  27. #include "vg.h"
  28.  
  29. /* 
  30. remove trailing blanks from a string. input argument is a  string
  31. and *MUST* be a variable and not a constant!! For internal use only!! 
  32. Used only on Crays where the Fortran compiler will pad strings to the 
  33. nearest 8-byte boundary.
  34. */
  35.  
  36. trimendblanks(ss) char *ss;
  37. {
  38. #ifdef UNICOS
  39.  
  40.     int i,n;
  41.     n = strlen(ss);
  42.     for(i=n-1;i>=0;i--) {
  43.         if(ss[i]!=' ') {
  44.             ss[i+1]='\0';
  45.             break;
  46.         }
  47.     }
  48. #endif
  49. }
  50.  
  51. /* ================================================== */
  52. /*  VGROUP routines                                   */
  53. /* ================================================== */
  54.  
  55. /* 
  56. attach from a vgroup
  57. related: Vattach--vatchc--VFATCH
  58. */
  59.  
  60.  
  61. #ifdef MAC
  62. pascal
  63. #endif 
  64.  
  65. #ifdef DF_CAPFNAMES
  66. int * VATCHC (f, vgid, accesstype)
  67.  
  68. #else 
  69. int * vatchc_ (f, vgid, accesstype)
  70. #endif
  71.  
  72. DF        **f;
  73. int    *vgid;
  74. _fcd     accesstype;                        /* one character only */
  75. {
  76.     VGROUP *vg;
  77.     char     *acc;
  78.  
  79.     acc = (char *) DFIf2cstring (accesstype,1); /* ie 'r' or 'w' only */
  80.  
  81.     vg = (VGROUP*) Vattach(*f, *vgid, acc);
  82.     (void) DFIfreespace(acc);
  83.  
  84.     if(vg==NULL)
  85.         return((int*) -1);
  86.     else 
  87.         return( (int*) vg);
  88. }
  89.  
  90. /* ------------------------------------------------------------------ */
  91.  
  92. /* 
  93. detach from a vgroup
  94. related: Vdetach--vdtchc--VFDTCH
  95. */
  96.  
  97. #ifdef MAC
  98. pascal
  99. #endif
  100.  
  101. #ifdef DF_CAPFNAMES
  102. void VDTCHC (vg)
  103.  
  104. #else
  105. void  vdtchc_ (vg)
  106. #endif
  107.  
  108. VGROUP **vg;
  109. {
  110.     Vdetach(*vg);
  111. }
  112. /* ------------------------------------------------------------------ */
  113.  
  114. /* 
  115. get the name of a vgroup
  116. related: Vgetname--vgnamc--VFGNAM
  117. */
  118.  
  119. #ifdef MAC
  120. pascal
  121. #endif
  122.  
  123. #ifdef DF_CAPFNAMES
  124. void VGNAMC (vg, vgname)
  125.  
  126. #else
  127. void vgnamc_ (vg, vgname)
  128. #endif
  129.  
  130. VGROUP **vg;
  131. _fcd     vgname;
  132.  
  133. {
  134.     char  *name;
  135.     name = _fcdtocp(vgname);
  136.     Vgetname (*vg, name);
  137. }    /* VGNAMC */
  138.  
  139. /* ------------------------------------------------------------------ */
  140. /* 
  141. get the class name of a vgroup
  142. related: Vgetclass--vgclsc--VFGCLS
  143. */
  144.  
  145. #ifdef MAC
  146.     pascal
  147. #endif
  148.  
  149. #ifdef DF_CAPFNAMES
  150.         void VGCLSC (vg, vgclass)
  151.  
  152. #else
  153.         void vgclsc_ (vg, vgclass)
  154. #endif
  155.  
  156.         VGROUP **vg;
  157.     _fcd     vgclass;
  158.  
  159.     {
  160.         char  *class;
  161.         class = _fcdtocp(vgclass);
  162.         Vgetclass(*vg, class);
  163.     }    /* VGCLSC */
  164.  
  165. /* ------------------------------------------------------------------ */
  166. /* 
  167. general inquiry on a vgroup 
  168. related: Vinquire--vinqc--VFINQ
  169. */
  170.  
  171. #ifdef MAC
  172. pascal
  173. #endif
  174.  
  175. #ifdef DF_CAPFNAMES
  176. int VINQC (vg, nentries, vgname)
  177.  
  178. #else
  179. int vinqc_ (vg, nentries, vgname)
  180. #endif
  181.  
  182. VGROUP **vg;
  183. int     *nentries;
  184. _fcd   vgname;
  185.  
  186. {
  187.     char  *name;
  188.     name =  _fcdtocp(vgname);
  189.     return( Vinquire(*vg, nentries, name) );
  190. } /* VINQC */
  191.  
  192.  
  193. /* ------------------------------------------------------------------ */
  194. /* 
  195. gets the id of the next vgroup in the file
  196. related: Vgetid--vgidc--VFGID
  197. */
  198.  
  199. #ifdef MAC
  200. pascal
  201. #endif
  202.  
  203. #ifdef DF_CAPFNAMES
  204. int VGIDC (f,vgid)
  205.  
  206. #else
  207. int vgidc_ (f,vgid)
  208. #endif
  209.  
  210. DF            **f;
  211. int         *vgid;
  212. {
  213.     return( Vgetid (*f, *vgid) );
  214. }
  215.  
  216. /* ------------------------------------------------------------------ */
  217. /* 
  218. gets the id of the next entry in the vgroup
  219. related: Vgetnext--vgnxtc--VFGNXT
  220. */
  221.  
  222. #ifdef MAC
  223. pascal
  224. #endif
  225.  
  226. #ifdef DF_CAPFNAMES
  227. int VGNXTC (vg,id)
  228.  
  229. #else
  230. int vgnxtc_ (vg,id)
  231. #endif
  232.  
  233. VGROUP    **vg;
  234. int        *id;
  235. {
  236.     return( Vgetnext(*vg, *id) );
  237. }
  238.  
  239. /* ------------------------------------------------------------------ */
  240. /* 
  241. sets the name of the vgroup
  242. related: Vsetname--vsnamc--VFSNAM
  243. */
  244.  
  245. #ifdef MAC
  246. pascal
  247. #endif
  248.  
  249. #ifdef DF_CAPFNAMES
  250. void VSNAMC (vg, vgname)
  251.  
  252. #else
  253. void vsnamc_ (vg, vgname)
  254. #endif
  255.  
  256. VGROUP    **vg;
  257. _fcd        vgname;
  258.  
  259. {
  260.     char *name;
  261.     name = (char*) DFIf2cstring (vgname,VSNAMELENMAX);
  262.     trimendblanks(name);
  263.     Vsetname (*vg, name);
  264.     (void) DFIfreespace(name);
  265. }
  266. /* ------------------------------------------------------------------ */
  267. /* 
  268. sets the class name of the vgroup
  269. related: Vsetclass--vsclsc--VFSCLS
  270.  
  271. */
  272.  
  273. #ifdef MAC
  274.     pascal
  275. #endif
  276.  
  277. #ifdef DF_CAPFNAMES
  278.         void VSCLSC (vg, vgclass)
  279.  
  280. #else
  281.         void vsclsc_ (vg, vgclass)
  282. #endif
  283.  
  284.         VGROUP    **vg;
  285.     _fcd        vgclass;
  286.  
  287.     {
  288.         char *class;
  289.         class = (char*) DFIf2cstring (vgclass,VGNAMELENMAX);
  290.         trimendblanks(class);
  291.         Vsetclass (*vg, class);
  292.         (void) DFIfreespace(class);
  293.     }
  294.  
  295. /* ------------------------------------------------------------------ */
  296. /* 
  297. inserts a vset entity (ie vgroup or vdata) into the given vgroup
  298. related: Vinsert--vinsrtc--VFINSRT
  299. */
  300.  
  301. #ifdef MAC
  302. pascal
  303. #endif
  304.  
  305. #ifdef DF_CAPFNAMES
  306. int VINSRTC (vg,ventity)
  307.  
  308. #else
  309. int vinsrtc_ (vg,ventity)
  310. #endif
  311.  
  312. VGROUP    **vg;
  313. int        **ventity; /* actually can be either VDATA * or VGROUP * */
  314. {
  315.     return( Vinsert(*vg, (VDATA*) *ventity) );
  316. }
  317.  
  318. /* ------------------------------------------------------------------ */
  319. /* 
  320. tests if an id in a vgroup is a vgroup
  321. related: Visvg--visvgc--VFISVG
  322. */
  323.  
  324. #ifdef MAC
  325. pascal
  326. #endif
  327.  
  328. #ifdef DF_CAPFNAMES
  329. int VISVGC (vg, id)
  330.  
  331. #else
  332. int visvgc_ (vg, id)
  333. #endif
  334.  
  335.  
  336. VGROUP    **vg;
  337. int        *id;
  338. {
  339.     return( Visvg(*vg, *id) );
  340. }
  341.  
  342. /* ------------------------------------------------------------------ */
  343. /* 
  344. tests if an id in a vgroup is a vdata
  345. related: Visvs--visvsc--VFISVS
  346. */
  347.  
  348. #ifdef MAC
  349. pascal
  350. #endif
  351.  
  352. #ifdef DF_CAPFNAMES
  353. int VISVSC (vg, id)
  354.  
  355. #else
  356. int visvsc_ (vg, id)
  357. #endif
  358.  
  359.  
  360. VGROUP    **vg;
  361. int        *id;
  362. {
  363.     return( Visvs(*vg, *id) );
  364. }
  365. /* ================================================== */
  366. /*  VDATA routines                                    */
  367. /* ================================================== */
  368.  
  369. /* 
  370. attach to a vdata
  371. related: VSattach--vsatchc--VFATCH
  372. */
  373.  
  374. #ifdef MAC
  375. pascal
  376. #endif
  377.  
  378. #ifdef DF_CAPFNAMES
  379. int * VSATCHC (f, vsid, accesstype)
  380.  
  381. #else
  382. int * vsatchc_ (f, vsid, accesstype)
  383.  
  384. #endif
  385.  
  386. DF        **f;
  387. int    *vsid;
  388. _fcd    accesstype;
  389. {
  390.     VDATA *vs;
  391.     char *acc;
  392.  
  393.     acc = (char*) DFIf2cstring (accesstype,1);   /* ie 'r' or 'w' only */
  394.  
  395.     vs =  (VDATA*) VSattach(*f, *vsid, acc);
  396.     (void) DFIfreespace(acc);
  397.     if ( vs == NULL)
  398.         return((int*) -1);
  399.     else 
  400.         return( (int*) vs);
  401. }
  402.  
  403. /* ------------------------------------------------------------------ */
  404. /*  
  405. detach from a vdata
  406. related: VSdetach--vsdtchc--VFDTCH
  407. */
  408.  
  409. #ifdef MAC
  410. pascal
  411. #endif
  412.  
  413. #ifdef DF_CAPFNAMES
  414. void VSDTCHC (vs)
  415.  
  416. #else
  417. void vsdtchc_ (vs)
  418. #endif
  419.  
  420. VDATA **vs;
  421. {
  422.     VSdetach(*vs);
  423. }
  424.  
  425. /* ------------------------------------------------------------------ */
  426. /* 
  427. seeks to a given element position in a vadata
  428. related: VSseek--vsseekc--VSFSEEK
  429. */
  430.  
  431. #ifdef MAC
  432. pascal
  433. #endif
  434.  
  435. #ifdef DF_CAPFNAMES
  436. int VSSEEKC (vs,eltpos)
  437.  
  438. #else
  439. int vsseekc_ (vs,eltpos)
  440. #endif
  441.  
  442.  
  443. VDATA **vs;
  444. int    *eltpos;
  445. {
  446.     return( VSseek(*vs, *eltpos) );
  447. }
  448.  
  449. /* ------------------------------------------------------------------ */
  450. /* 
  451. gets the name of a vdata
  452. related: VSgetname--vsgnamc--VSFGNAM
  453. */
  454.  
  455. #ifdef MAC
  456. pascal
  457. #endif
  458.  
  459. #ifdef DF_CAPFNAMES
  460. void VSGNAMC (vs, vsname)
  461.  
  462. #else
  463. void vsgnamc_ (vs, vsname)
  464. #endif
  465.  
  466. VDATA **vs;
  467. _fcd vsname;
  468.  
  469. {
  470.     char  *name;
  471.  
  472.     name =  _fcdtocp(vsname);
  473.     VSgetname (*vs, name);
  474. }    /* VSGNAMC */
  475.  
  476. /* ------------------------------------------------------------------ */
  477. /* 
  478. get the class name of a vdata
  479. related: VSgetclass--vsgclsc--VSFGCLS
  480. */
  481.  
  482. #ifdef MAC
  483.     pascal
  484. #endif
  485.  
  486. #ifdef DF_CAPFNAMES
  487.         void VSGCLSC (vs, vsclass)
  488.  
  489. #else
  490.         void vsgclsc_ (vs, vsclass)
  491. #endif
  492.  
  493.         VDATA **vs;
  494.     _fcd     vsclass;
  495.  
  496.     {
  497.         char  *class;
  498.         class = _fcdtocp(vsclass);
  499.         VSgetclass(*vs, class);
  500.     }    /* VSGCLSC */
  501.  
  502. /* ------------------------------------------------------------------ */
  503. /*
  504. general inquiry on a vdata
  505. related: VSinquire--vsinqc--VSFINQ
  506. */
  507.  
  508. #ifdef MAC
  509. pascal
  510. #endif
  511.  
  512. #ifdef DF_CAPFNAMES
  513. int VSINQC (vs, nelt ,interlace, fields, eltsize, vsname)
  514.  
  515. #else
  516. int vsinqc_ (vs, nelt ,interlace, fields, eltsize, vsname)
  517. #endif
  518.  
  519.  
  520. VDATA **vs;
  521. int    *nelt, *interlace, *eltsize;
  522. _fcd  fields, vsname;
  523.  
  524. {
  525.  
  526.     char  *name,  *flds;
  527.     name =  _fcdtocp(vsname);
  528.     flds =  _fcdtocp(fields);
  529.     trimendblanks(name);
  530.     trimendblanks(flds);
  531.     return( VSinquire (*vs, nelt, interlace, flds, eltsize, name) );
  532. }     /* VSINQC */
  533.  
  534.  
  535.  
  536.  
  537. /* ------------------------------------------------------------------ */
  538. /* 
  539. tests if given fields exist in the vdata
  540. related: VSfexist--vsfexc--VSFEX
  541. */
  542.  
  543. #ifdef MAC
  544. pascal
  545. #endif
  546.  
  547. #ifdef DF_CAPFNAMES
  548. int VSFEXC (vs, fields)
  549.  
  550. #else
  551. int vsfexc_ (vs, fields)
  552. #endif
  553.  
  554. VDATA **vs;
  555. _fcd    fields;
  556. {
  557.     int     stat;
  558.     char    *flds;
  559.  
  560.     flds = (char*) DFIf2cstring(fields, 55);
  561.     trimendblanks(flds);
  562.     stat =  VSfexist(*vs, flds);
  563.     (void) DFIfreespace(flds);
  564.  
  565.     return (stat);
  566. }
  567.  
  568. /* ------------------------------------------------------------------ */
  569. /* 
  570. gets the id of the next vdata from the file
  571. related: VSgetid--vsgidc--VSFGID
  572. */
  573.  
  574. #ifdef MAC
  575. pascal
  576. #endif
  577.  
  578. #ifdef DF_CAPFNAMES
  579. int VSGIDC (f,vsid)
  580.  
  581. #else
  582. int vsgidc_ (f,vsid)
  583. #endif
  584.  
  585. DF        **f;
  586. int    *vsid;
  587. {
  588.     return( VSgetid( *f, *vsid) );
  589. }
  590.  
  591. /* ------------------------------------------------------------------ */
  592. /* 
  593. sets the name of a vdata
  594. related: VSsetname--vssnamc--VSFSNAM
  595. */
  596.  
  597. #ifdef MAC
  598. pascal
  599. #endif
  600.  
  601. #ifdef DF_CAPFNAMES
  602. void VSSNAMC (vs, vsname)
  603.  
  604. #else
  605. void vssnamc_ (vs, vsname)
  606. #endif
  607.  
  608. VDATA **vs;
  609. _fcd    vsname;
  610.  
  611. {
  612.     char    *name;
  613.  
  614.     name = (char*) DFIf2cstring(vsname, VSNAMELENMAX);
  615.     trimendblanks(name);
  616.     VSsetname(*vs, name);
  617.     (void) DFIfreespace(name);
  618. }
  619.  
  620. /* ------------------------------------------------------------------ */
  621. /* 
  622. sets the class name of the vdata
  623. related: VSsetclass--vssclsc--VSFSCLS
  624. */
  625.  
  626. #ifdef MAC
  627.     pascal
  628. #endif
  629.  
  630. #ifdef DF_CAPFNAMES
  631.         void VSSCLSC (vs, vsclass)
  632.  
  633. #else
  634.         void vssclsc_ (vs, vsclass)
  635. #endif
  636.  
  637.         VDATA        **vs;
  638.     _fcd        vsclass;
  639.  
  640.     {
  641.         char *class;
  642.         class = (char*) DFIf2cstring (vsclass,VSNAMELENMAX);
  643.         trimendblanks(class);
  644.         VSsetclass (*vs, class);
  645.         (void) DFIfreespace(class);
  646.     }
  647.  
  648. /* ------------------------------------------------------------------ */
  649. /* 
  650. sets the fields in a vdata for reading or writing
  651. related: VSsetfields--vssfldc--VSFSFLD
  652. */
  653.  
  654. #ifdef MAC
  655. pascal
  656. #endif
  657.  
  658. #ifdef DF_CAPFNAMES
  659. int VSSFLDC (vs,fields)
  660.  
  661. #else
  662. int vssfldc_ (vs,fields)
  663. #endif
  664.  
  665. VDATA **vs;
  666. _fcd    fields;
  667. {
  668.     char *ss;
  669.     int ret;
  670.  
  671.     ss = (char*) DFIf2cstring (fields,55);
  672.     trimendblanks(ss);
  673.     ret =    VSsetfields (*vs,ss);
  674.  
  675.     (void) DFIfreespace(ss);
  676.     return( ret);
  677. }
  678.  
  679.  
  680. /* ------------------------------------------------------------------ */
  681. /* 
  682. sets the file interlace of a vdata
  683. related: VSsetinterlace--vssintc--VSFSINT
  684. */
  685.  
  686. #ifdef MAC
  687. pascal
  688. #endif
  689.  
  690. #ifdef DF_CAPFNAMES
  691. int VSSINTC (vs, interlace)
  692.  
  693. #else
  694. int vssintc_ (vs, interlace)
  695. #endif
  696.  
  697. VDATA  **vs;
  698. int     *interlace;
  699. {
  700.     return( VSsetinterlace (*vs, *interlace) );
  701. }
  702.  
  703. /* ------------------------------------------------------------------ */
  704. /* 
  705. defines a new field to be used in the vdata
  706. related: VSfdefine--vsfdefc--VSFFDEF
  707. */
  708.  
  709. #ifdef MAC
  710. pascal
  711. #endif
  712.  
  713. #ifdef DF_CAPFNAMES
  714. int VSFDEFC (vs,field,localtype,order)
  715.  
  716. #else
  717. int vsfdefc_ (vs,field,localtype,order)
  718. #endif
  719.  
  720. VDATA **vs;
  721. _fcd    field;
  722. int     *localtype, *order;
  723. {
  724.     int ret;
  725.     char *ss;
  726.  
  727.     ss  = (char*) DFIf2cstring (field, FIELDNAMELENMAX);
  728.     trimendblanks(ss);
  729.     ret =  VSfdefine(*vs, ss, *localtype, *order );
  730.     (void) DFIfreespace(ss);
  731.     return (ret);
  732. }
  733.  
  734. /* ------------------------------------------------------------------ */
  735. /* 
  736. reads from a vdata
  737. related: VSread--vsreadc--VSFREAD
  738. */
  739.  
  740. #ifdef MAC
  741. pascal
  742. #endif
  743.  
  744. #ifdef DF_CAPFNAMES
  745. int VSREADC (vs, buf, nelt, interlace)
  746.  
  747. #else
  748. int vsreadc_ (vs, buf, nelt, interlace)
  749. #endif
  750.  
  751. VDATA              **vs;
  752. int                *nelt, *interlace;
  753. unsigned char     *buf;
  754. {
  755.     return( VSread(*vs, buf, *nelt, *interlace) );
  756. }
  757.  
  758. /* ------------------------------------------------------------------ */
  759. /* 
  760. writes to a vdata
  761. related: VSwrite--vswritc--VSFWRIT
  762. */
  763.  
  764. #ifdef MAC
  765. pascal
  766. #endif
  767.  
  768. #ifdef DF_CAPFNAMES
  769. int VSWRITC (vs, buf, nelt, interlace)
  770.  
  771. #else
  772. int vswritc_ (vs, buf, nelt, interlace)
  773. #endif
  774.  
  775.  
  776. VDATA                **vs;
  777. int                *nelt, *interlace;
  778. unsigned char     *buf;
  779. {
  780.  
  781.     return( VSwrite(*vs, buf, *nelt, *interlace) );
  782. }
  783.  
  784.  
  785. /* ======================================== */
  786. /* miscellaneous VDATA inquiry routines */
  787. /* ======================================== */
  788. /* undocumented */
  789.  
  790. /* ------------------------------------------------------------------ */
  791. /* 
  792. gets the interlace of the vdata
  793. related: VSgetinterlace--vsgintc--VSFGINT
  794. */
  795.  
  796. #ifdef MAC
  797. pascal
  798. #endif
  799.  
  800. #ifdef DF_CAPFNAMES
  801. int VSGINTC (vs)
  802.  
  803. #else
  804. int vsgintc_ (vs)
  805. #endif
  806.  
  807. VDATA **vs;
  808. {
  809.     return( VSgetinterlace(*vs) );
  810. }
  811.  
  812. /* ------------------------------------------------------------------ */
  813. /* 
  814. gets the number of elements in the vdata
  815. related: VSelts--vseltsc--VSFELTS
  816. */
  817.  
  818. #ifdef MAC
  819. pascal
  820. #endif
  821.  
  822. #ifdef DF_CAPFNAMES
  823. int VSELTSC (vs)
  824.  
  825. #else
  826. int vseltsc_ (vs)
  827. #endif
  828.  
  829. VDATA **vs;
  830. {
  831.     return( VSelts (*vs) );
  832. }
  833.  
  834. /* ------------------------------------------------------------------ */
  835. /* 
  836. gets the fields in the vdata
  837. related: VSgetfields--vsgfldc--VSFGFLD
  838. */
  839.  
  840. #ifdef MAC
  841. pascal
  842. #endif
  843.  
  844. #ifdef DF_CAPFNAMES
  845. int VSGFLDC (vs,fields)
  846.  
  847. #else
  848. int vsgfldc_ (vs,fields)
  849. #endif
  850.  
  851. VDATA **vs;
  852. _fcd  fields;
  853. {
  854.     char  *flds;
  855.     flds =  _fcdtocp(fields);
  856.  
  857.     return( VSgetfields(*vs,flds) );
  858. }    /* VSGFLDC */
  859.  
  860. /* ------------------------------------------------------------------ */
  861. /* 
  862. determines the (machine) size of the given fields
  863. related: VSsizeof--vssizc--VSFSIZ
  864. */
  865.  
  866. #ifdef MAC
  867. pascal
  868. #endif
  869.  
  870. #ifdef DF_CAPFNAMES
  871. int VSSIZC (vs,fields)
  872.  
  873. #else
  874. int vssizc_ (vs,fields)
  875. #endif
  876.  
  877. VDATA **vs;
  878. _fcd    fields;
  879. {
  880.     int     stat;
  881.     char *flds;
  882.  
  883.     flds = (char*) DFIf2cstring (fields,55);
  884.     trimendblanks(flds);
  885.     stat =  VSsizeof(*vs, flds);
  886.     (void) DFIfreespace(flds);
  887.     return (stat);
  888. }
  889.  
  890. /* ------------------------------------------------------------------ */
  891. /*
  892. determines the no of entries in a vgroup
  893. related: Ventries--ventsc--VFENTS
  894. */
  895.  
  896. #ifdef MAC
  897. pascal
  898. #endif
  899.  
  900. #ifdef DF_CAPFNAMES
  901. int VENTSC (f,vgid) 
  902. #else
  903.     int ventsc_ (f,vgid) 
  904. #endif
  905. DF * f;
  906. int vgid;
  907. {
  908.  
  909.         return( Ventries (f,vgid) );
  910.     }
  911.  
  912. /* ======================================================= */
  913. /* DEBUGGING ROUTINES                                      */
  914. /* ======================================================= */
  915. /*
  916. enable debug
  917. related: setjj--setjjc--SETFJJ
  918. */
  919.  
  920. #ifdef MAC
  921.     pascal
  922. #endif
  923.  
  924. #ifdef DF_CAPFNAMES
  925.         void SETJJC ()
  926. #else
  927.         void setjjc_ ()
  928. #endif
  929.         { setjj(); }
  930.  
  931. /* ------------------------------------------------------------------ */
  932. /*
  933. disable debug
  934. related: setnojj--setnojjc--SETFNJJ
  935. */
  936.  
  937. #ifdef MAC
  938.     pascal
  939. #endif
  940.  
  941. #ifdef DF_CAPFNAMES
  942.         void SETNOJJC ()
  943. #else
  944.         void  setnojjc_ ()
  945. #endif
  946.  
  947.         { setnojj(); }
  948.  
  949. /* ------------------------------------------------------------------ */
  950. /* 
  951. gets the refs of all lone vgroups in the file
  952. related: Vlone--vlonec--VFLONE
  953. */
  954.  
  955. #ifdef MAC
  956.     pascal
  957. #endif
  958.  
  959. #ifdef DF_CAPFNAMES
  960.         int VLONEC (f, idarray, asize)
  961.  
  962. #else
  963.         int vlonec_ (f, idarray, asize)
  964. #endif
  965.  
  966.             DF        **f;
  967.     int    **idarray; /* an integer array */
  968.     int    *asize;
  969.     {
  970.         return( Vlone( *f, *idarray, *asize) );
  971.     }
  972.  
  973. /* ------------------------------------------------------------------ */
  974. /*
  975. gets the refs of all lone vdatas in the file
  976. related: VSlone--vslonec--VSFLONE
  977. */
  978.  
  979. #ifdef MAC
  980.     pascal
  981. #endif
  982.  
  983. #ifdef DF_CAPFNAMES
  984.         int VSLONEC (f, idarray, asize)
  985.  
  986. #else
  987.         int vslonec_ (f, idarray, asize)
  988. #endif
  989.  
  990.             DF        **f;
  991.     int    **idarray; /* an integer array */
  992.     int    *asize;
  993.     {
  994.         return( VSlone( *f, *idarray, *asize) );
  995.     }
  996.  
  997. /*
  998. ==================================================================
  999. HIGH-LEVEL VSET ROUTINES --- VHxxxxx()
  1000. ==================================================================
  1001. */
  1002.  
  1003. /*
  1004. store a simple dataset in a vdata 
  1005. related: VHstoredata--vhsdc--vhfsd
  1006. */
  1007. #ifdef MAC
  1008. pascal
  1009. #endif
  1010.  
  1011. #ifdef DF_CAPFNAMES
  1012. int VHSDC (f, field, buf, n, datatype, vsname, vsclass)
  1013.  
  1014. #else
  1015. int vhsdc_ (f, field, buf, n, datatype, vsname, vsclass)
  1016. #endif
  1017.  
  1018. DF        **f;
  1019. _fcd   field, vsname, vsclass;
  1020. int    *n, *datatype;
  1021. unsigned char *buf;
  1022.  
  1023. {
  1024.    char  *name,  *class, *fld;
  1025.     name  =  _fcdtocp(vsname);
  1026.     class =  _fcdtocp(vsclass);
  1027.     fld   =  _fcdtocp(field);
  1028.     trimendblanks(name);
  1029.     trimendblanks(class);
  1030.     trimendblanks(fld);
  1031.      return( VHstoredata (*f, fld , buf, *n, *datatype, name, class));
  1032. }
  1033.  
  1034. /* ------------------------------------------------------------------ */
  1035. /*
  1036. store an aggregate dataset in a vdata
  1037. related: VHstoredatam--vhsdmc--vhfsdm
  1038. */
  1039. #ifdef MAC
  1040. pascal
  1041. #endif
  1042.  
  1043. #ifdef DF_CAPFNAMES
  1044. int VHSDMC (f, field, buf, n, datatype, vsname, vsclass, order)
  1045.  
  1046. #else
  1047. int vhsdmc_ (f, field, buf, n, datatype, vsname, vsclass, order)
  1048. #endif
  1049.  
  1050. DF        **f;
  1051. _fcd   field, vsname, vsclass;
  1052. int    *n, *datatype, *order;
  1053. unsigned char *buf;
  1054.  
  1055. {
  1056.    char  *name,  *fld, *class;
  1057.     name  =  _fcdtocp(vsname);
  1058.     class =  _fcdtocp(vsclass);
  1059.     fld   =  _fcdtocp(field);
  1060.     trimendblanks (name);
  1061.     trimendblanks (class);
  1062.     trimendblanks (fld);
  1063.  
  1064.      return( VHstoredatam (*f, fld , buf, *n, *datatype, name, class, *order));
  1065. }
  1066.  
  1067.  
  1068.  
  1069. /* ------------------------------------------------------------------ */
  1070. /*
  1071. make a new vgroup given several tag/ref pairs 
  1072. related: VHmakegroup--vhmkgpc--vhfmkgp
  1073. */
  1074. #ifdef MAC
  1075. pascal
  1076. #endif
  1077.  
  1078. #ifdef DF_CAPFNAMES
  1079. int VHMKGPC  (f, tagarray, refarray , n, vgname, vgclass)
  1080.  
  1081. #else
  1082. int vhmkgpc_  (f, tagarray, refarray , n, vgname, vgclass)
  1083. #endif
  1084.  
  1085. DF        **f;
  1086. _fcd   vgname, vgclass;
  1087. int    *n, *tagarray, *refarray;
  1088.  
  1089. {
  1090.    char  *name, *class;
  1091.     name  =  _fcdtocp(vgname);
  1092.     class =  _fcdtocp(vgclass);
  1093.     trimendblanks (name);
  1094.     trimendblanks (class);
  1095.     return ( VHmakegroup (*f, tagarray, refarray , *n, name, class));
  1096.  
  1097. }
  1098.  
  1099. /* ================================================================== */
  1100. /* ------- May 1991 new routines ---- */
  1101. #ifdef MAC
  1102. pascal
  1103. #endif
  1104.  
  1105. #ifdef DF_CAPFNAMES
  1106. int VFLOCC (vg, field)
  1107.  
  1108. #else
  1109. int vflocc_ (vg, field)
  1110. #endif
  1111.  
  1112. VGROUP    **vg;
  1113. _fcd   field;
  1114. {
  1115.    char  *fld;
  1116.     fld =  _fcdtocp(field);
  1117.     trimendblanks(fld);
  1118.  
  1119.  
  1120.     return( Vflocate (*vg, fld));
  1121. }
  1122. /* ------------------------------------------------------------------ */
  1123. /* 
  1124. tests if a tag/ref pair is in a vgroup.
  1125. related: Vinqtagref--vinqtrc--vfinqtr
  1126. */
  1127.  
  1128. #ifdef MAC
  1129. pascal
  1130. #endif
  1131.  
  1132. #ifdef DF_CAPFNAMES
  1133. int VINQTRC (vg, tag, ref)
  1134.  
  1135. #else
  1136. int vinqtrc_ (vg, tag, ref)
  1137. #endif
  1138.  
  1139. VGROUP    **vg;
  1140. int     *tag, *ref;
  1141.  
  1142. {
  1143.     return ( Vinqtagref ( *vg, *tag, *ref) );
  1144. }
  1145. /* ------------------------------------------------------------------ */
  1146.  
  1147. /* 
  1148. gets the number of tag/refs stored in a vgroup
  1149. related: Vntagrefs--vntrc--VFNTR
  1150. */
  1151.  
  1152. #ifdef MAC
  1153. pascal
  1154. #endif
  1155.  
  1156. #ifdef DF_CAPFNAMES
  1157. int VNTRC (vg)
  1158.  
  1159. #else
  1160. int vntrc_ (vg)
  1161. #endif
  1162.  
  1163. VGROUP    **vg;
  1164.  
  1165. {
  1166.     return (  Vntagrefs (*vg) );
  1167. }
  1168. /* ------------------------------------------------------------------ */
  1169.  
  1170. /*
  1171. returns all the tag/ref pairs in a vgroup 
  1172. related: Vgettagrefs--vgttrsc--vfgttrs
  1173. */
  1174.  
  1175. #ifdef MAC
  1176. pascal
  1177. #endif
  1178.  
  1179. #ifdef DF_CAPFNAMES
  1180. int VGTTRSC (vg, tagarray, refarray, n)
  1181.  
  1182. #else
  1183. int vgttrsc_ (vg, tagarray, refarray, n)
  1184. #endif
  1185.  
  1186. VGROUP    **vg;
  1187. int *tagarray, *refarray, *n;
  1188. {
  1189.     return (  Vgettagrefs (*vg, tagarray, refarray, *n) );
  1190. }
  1191.  
  1192. /*
  1193. returns a specified tag/ref pair in a vgroup 
  1194. related: Vgettagref--vgttrc--vfgttr
  1195. */
  1196.  
  1197. #ifdef MAC
  1198. pascal
  1199. #endif
  1200.  
  1201. #ifdef DF_CAPFNAMES
  1202. int VGTTRC (vg, which, tag, ref)
  1203.  
  1204. #else
  1205. int vgttrc_ (vg, which, tag, ref)
  1206. #endif
  1207.  
  1208. VGROUP    **vg;
  1209. int *which;
  1210. int *tag, *ref;
  1211. {
  1212.     return (  Vgettagref (*vg, *which, tag, ref) );
  1213. }
  1214. /* ------------------------------------------------------------------ */
  1215.  
  1216. /*
  1217. add a tag/ref pair to a vgroup 
  1218. related: Vaddtagref--vadtrc--VFADTR 
  1219. */
  1220. #ifdef MAC
  1221. pascal
  1222. #endif
  1223.  
  1224. #ifdef DF_CAPFNAMES
  1225. int  VADTRC ( vg, tag, ref)
  1226.  
  1227. #else
  1228. int  vadtrc_ ( vg, tag, ref)
  1229. #endif
  1230. VGROUP    **vg;
  1231. int        *tag, *ref;
  1232. {
  1233.     return ( Vaddtagref ( *vg, *tag, *ref) );
  1234. }
  1235. /* ------------------------------------------------------------------ */
  1236.  
  1237.