Psi4
psio.h
Go to the documentation of this file.
1 /*
2  * @BEGIN LICENSE
3  *
4  * Psi4: an open-source quantum chemistry software package
5  *
6  * Copyright (c) 2007-2017 The Psi4 Developers.
7  *
8  * The copyrights for code used from other parties are included in
9  * the corresponding files.
10  *
11  * This file is part of Psi4.
12  *
13  * Psi4 is free software; you can redistribute it and/or modify
14  * it under the terms of the GNU Lesser General Public License as published by
15  * the Free Software Foundation, version 3.
16  *
17  * Psi4 is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20  * GNU Lesser General Public License for more details.
21  *
22  * You should have received a copy of the GNU Lesser General Public License along
23  * with Psi4; if not, write to the Free Software Foundation, Inc.,
24  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
25  *
26  * @END LICENSE
27  */
28 
29 #ifndef PSIO_H
30 #define PSIO_H
31 
32 #include <cstdio>
33 #include "psi4/libpsio/config.h"
34 #include <string>
35 
36 namespace psi {
37 
38  int psio_init(void);
39  int psio_ipv1_config(void);
40  int psio_state(void);
41  int psio_done(void);
42  void psio_error(size_t unit, size_t errval);
43  int psio_open(size_t unit, int status);
44  int psio_close(size_t unit, int keep);
45  std::string psio_getpid(void);
46 
47  size_t psio_get_numvols_default(void);
48  int psio_get_volpath_default(size_t volume, char **path);
49  int psio_get_filename_default(char **name);
50  psio_address psio_get_address(psio_address start, size_t shift);
51  psio_address psio_get_global_address(psio_address entry_start,
52  psio_address rel_address);
53  int psio_volseek(psio_vol *vol, size_t page, size_t offset, size_t numvols);
54  //size_t psio_get_length(psio_address sadd, psio_address eadd);
55  psio_address psio_get_entry_end(size_t unit, const char *key);
56 
57  int psio_tocwrite(size_t unit);
58  int psio_tocread(size_t unit);
59  void psio_tocprint(size_t unit, FILE *output);
60  psio_tocentry *psio_tocscan(size_t unit, const char *key);
61  bool psio_tocentry_exists(size_t unit, const char *key);
62  psio_tocentry *psio_toclast(size_t unit);
63  int psio_tocclean(size_t unit, const char *key);
64 
65  int psio_write(size_t unit, const char *key, char *buffer, size_t size,
66  psio_address sadd, psio_address *eadd);
67  int psio_read(size_t unit, const char *key, char *buffer, size_t size,
68  psio_address sadd, psio_address *eadd);
69  int psio_write_entry(size_t unit, const char *key, char *buffer, size_t size);
70  int psio_read_entry(size_t unit, const char *key, char *buffer, size_t size);
71  int psio_write_block(size_t unit, const char *key, char *buffer, size_t blksiz,
72  size_t start_blk, size_t end_blk);
73  int psio_read_block(size_t unit, const char *key, char *buffer, size_t blksiz,
74  size_t start_blk, size_t end_blk);
75  int psio_rw(size_t unit, char *buffer, psio_address address, size_t size,
76  int wrt);
77  int psio_zero_disk(size_t unit, const char *key, size_t rows, size_t cols);
78 
79  int psio_open_check(size_t unit);
80 
81  size_t psio_rd_toclen(size_t unit);
82  void psio_wt_toclen(size_t unit, size_t toclen);
83 
84  int psio_set_filescfg_kwd(const char* kwdgrp, const char* kwd, int unit,
85  const char* kwdval);
86  const char* psio_get_filescfg_kwd(const char* kwdgrp, const char* kwd,
87  int unit);
88 
89  bool psio_tocdel(size_t unit, const char *key);
90 }
91 
92 #endif /* #ifndef PSIO_H */
void status(const char *, std::string)
Definition: cchbar/status.cc:38
psio_tocentry * psio_tocscan(size_t unit, const char *key)
Definition: tocscan.cc:78
int psio_tocclean(size_t unit, const char *key)
Definition: tocclean.cc:85
int psio_open(size_t unit, int status)
Definition: open.cc:234
int psio_set_filescfg_kwd(const char *kwdgrp, const char *kwd, int unit, const char *kwdval)
Definition: filescfg.cc:83
void psio_error(size_t unit, size_t errval)
Definition: libpsio/error.cc:51
psio_address psio_get_address(psio_address start, size_t shift)
Definition: get_address.cc:44
int psio_tocwrite(size_t unit)
Definition: tocwrite.cc:81
int psio_write_entry(size_t unit, const char *key, char *buffer, size_t size)
Definition: write_entry.cc:55
int psio_volseek(psio_vol *vol, size_t page, size_t offset, size_t numvols)
Definition: volseek.cc:46
int psio_read_entry(size_t unit, const char *key, char *buffer, size_t size)
Definition: read_entry.cc:60
int psio_write_block(size_t unit, const char *key, char *buffer, size_t blksiz, size_t start_blk, size_t end_blk)
psio_address psio_get_entry_end(size_t unit, const char *key)
psio_address psio_get_global_address(psio_address entry_start, psio_address rel_address)
Definition: get_global_address.cc:45
void psio_wt_toclen(size_t unit, size_t toclen)
int psio_ipv1_config(void)
bool psio_tocentry_exists(size_t unit, const char *key)
Definition: tocscan.cc:115
const char * psio_get_filescfg_kwd(const char *kwdgrp, const char *kwd, int unit)
Definition: filescfg.cc:89
bool psio_tocdel(size_t unit, const char *key)
Definition: tocdel.cc:69
int psio_tocread(size_t unit)
void psio_tocprint(size_t unit, FILE *output)
size_t psio_get_numvols_default(void)
Definition: get_numvols.cc:65
std::string psio_getpid(void)
Definition: getpid.cc:60
int psio_read_block(size_t unit, const char *key, char *buffer, size_t blksiz, size_t start_blk, size_t end_blk)
struct psi::psio_entry psio_tocentry
int psio_init(void)
Definition: libpsio/init.cc:123
int psio_get_filename_default(char **name)
Definition: get_filename.cc:83
int psio_get_volpath_default(size_t volume, char **path)
Definition: get_volpath.cc:73
int psio_close(size_t unit, int keep)
Definition: libpsio/close.cc:89
int psio_zero_disk(size_t unit, const char *key, size_t rows, size_t cols)
Definition: zero_disk.cc:65
size_t psio_rd_toclen(size_t unit)
Definition: toclen.cc:109
int psio_state()
Definition: libpsio/init.cc:144
int psio_open_check(size_t unit)
Definition: open_check.cc:64
int psio_read(size_t unit, const char *key, char *buffer, size_t size, psio_address sadd, psio_address *eadd)
Definition: read.cc:117
int psio_write(size_t unit, const char *key, char *buffer, size_t size, psio_address sadd, psio_address *eadd)
Definition: write.cc:163
psio_tocentry * psio_toclast(size_t unit)
int psio_rw(size_t unit, char *buffer, psio_address address, size_t size, int wrt)
Definition: rw.cc:146
int psio_done(void)
Definition: done.cc:84