source: src/lib/util/psi3/libpsio/get_numvols.cc@ 5d30c1

Last change on this file since 5d30c1 was 5d30c1, checked in by Frederik Heber <heber@…>, 13 years ago

Initial commit based on 3.0.0alpha (here claimed as 2.4).

  • simply added all files.
  • Property mode set to 100644
File size: 1.5 KB
Line 
1/*!
2 \file get_numvols.c
3 \ingroup (PSIO)
4*/
5
6#include <stdio.h>
7#include <string.h>
8#include <util/psi3/libpsio/psio.h>
9
10namespace psi3 {
11namespace libpsio {
12
13/*!
14** PSIO_GET_NUMVOLS(): Get the number of volumes that file number 'unit'
15** is split across.
16**
17** \ingroup (PSIO)
18*/
19unsigned int psio_get_numvols(unsigned int unit)
20{
21 unsigned int num;
22 int errcod;
23 char ip_token[PSIO_MAXSTR];
24
25 num = 0;
26
27 sprintf(ip_token,":PSI:FILES:FILE%u:NVOLUME",unit);
28// errcod = ip_data(ip_token,"%u",&num,0);
29// if(errcod == IPE_OK) return(num);
30
31 sprintf(ip_token,":PSI:FILES:DEFAULT:NVOLUME");
32// errcod = ip_data(ip_token,"%u",&num,0);
33// if(errcod == IPE_OK) return(num);
34
35 sprintf(ip_token,":DEFAULT:FILES:FILE%u:NVOLUME",unit);
36// errcod = ip_data(ip_token,"%u",&num,0);
37// if(errcod == IPE_OK) return(num);
38
39 sprintf(ip_token,":DEFAULT:FILES:DEFAULT:NVOLUME");
40// errcod = ip_data(ip_token,"%u",&num,0);
41// if(errcod == IPE_OK) return(num);
42
43 /* default to one volume */
44 return(1);
45}
46
47
48/*!
49** PSIO_GET_NUMVOLS_DEFAULT(): Get the number of volumes that file
50** number 'unit' is split across.
51**
52** \ingroup (PSIO)
53*/
54unsigned int psio_get_numvols_default(void)
55{
56 unsigned int num;
57 int errcod;
58 char ip_token[PSIO_MAXSTR];
59
60 num = 0;
61
62 sprintf(ip_token,":PSI:FILES:DEFAULT:NVOLUME");
63// errcod = ip_data(ip_token,"%u",&num,0);
64// if(errcod == IPE_OK) return(num);
65
66 sprintf(ip_token,":DEFAULT:FILES:DEFAULT:NVOLUME");
67// errcod = ip_data(ip_token,"%u",&num,0);
68// if(errcod == IPE_OK) return(num);
69
70 /* default to one volume */
71 return(1);
72}
73
74}
75}
Note: See TracBrowser for help on using the repository browser.