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-2018 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();
39 int psio_ipv1_config();
40 int psio_state();
41 int psio_done();
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();
46 
48 int psio_get_volpath_default(size_t volume, char **path);
49 int psio_get_filename_default(char **name);
50 PSI_API psio_address psio_get_address(psio_address start, size_t shift);
51 psio_address psio_get_global_address(psio_address entry_start, psio_address rel_address);
52 int psio_volseek(psio_vol *vol, size_t page, size_t offset, size_t numvols);
53 // size_t psio_get_length(psio_address sadd, psio_address eadd);
54 psio_address psio_get_entry_end(size_t unit, const char *key);
55 
56 int psio_tocwrite(size_t unit);
57 int psio_tocread(size_t unit);
58 void psio_tocprint(size_t unit, FILE *output);
59 psio_tocentry *psio_tocscan(size_t unit, const char *key);
60 bool psio_tocentry_exists(size_t unit, const char *key);
61 psio_tocentry *psio_toclast(size_t unit);
62 int psio_tocclean(size_t unit, const char *key);
63 
64 int psio_write(size_t unit, const char *key, char *buffer, size_t size, psio_address sadd, psio_address *eadd);
65 int psio_read(size_t unit, const char *key, char *buffer, size_t size, psio_address sadd, psio_address *eadd);
66 int psio_write_entry(size_t unit, const char *key, char *buffer, size_t size);
67 int psio_read_entry(size_t unit, const char *key, char *buffer, size_t size);
68 int psio_write_block(size_t unit, const char *key, char *buffer, size_t blksiz, size_t start_blk, size_t end_blk);
69 int psio_read_block(size_t unit, const char *key, char *buffer, size_t blksiz, size_t start_blk, size_t end_blk);
70 int psio_rw(size_t unit, char *buffer, psio_address address, size_t size, int wrt);
71 int psio_zero_disk(size_t unit, const char *key, size_t rows, size_t cols);
72 
73 int psio_open_check(size_t unit);
74 
75 size_t psio_rd_toclen(size_t unit);
76 void psio_wt_toclen(size_t unit, size_t toclen);
77 
78 int psio_set_filescfg_kwd(const char *kwdgrp, const char *kwd, int unit, const char *kwdval);
79 const char *psio_get_filescfg_kwd(const char *kwdgrp, const char *kwd, int unit);
80 
81 bool psio_tocdel(size_t unit, const char *key);
82 } // namespace psi
83 
84 #endif /* #ifndef PSIO_H */
void status(const char *, std::string)
Definition: cchbar/status.cc:39
psio_address psio_get_address(psio_address start, size_t shift)
Definition: get_address.cc:44
psio_tocentry * psio_tocscan(size_t unit, const char *key)
Definition: tocscan.cc:76
int psio_tocclean(size_t unit, const char *key)
Definition: tocclean.cc:85
int psio_open(size_t unit, int status)
Definition: open.cc:231
int psio_set_filescfg_kwd(const char *kwdgrp, const char *kwd, int unit, const char *kwdval)
Definition: filescfg.cc:81
void psio_error(size_t unit, size_t errval)
Definition: libpsio/error.cc:51
int psio_tocwrite(size_t unit)
Definition: tocwrite.cc:78
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:52
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)
std::string psio_getpid()
Definition: getpid.cc:63
bool psio_tocentry_exists(size_t unit, const char *key)
Definition: tocscan.cc:109
const char * psio_get_filescfg_kwd(const char *kwdgrp, const char *kwd, int unit)
Definition: filescfg.cc:86
bool psio_tocdel(size_t unit, const char *key)
Definition: tocdel.cc:70
int psio_ipv1_config()
int psio_tocread(size_t unit)
void psio_tocprint(size_t unit, FILE *output)
int psio_done()
Definition: done.cc:82
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_get_filename_default(char **name)
Definition: get_filename.cc:82
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:95
int psio_zero_disk(size_t unit, const char *key, size_t rows, size_t cols)
Definition: zero_disk.cc:63
size_t psio_rd_toclen(size_t unit)
Definition: toclen.cc:117
#define PSI_API
Definition: pragma.h:155
int psio_state()
Definition: libpsio/init.cc:138
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:112
int psio_init()
Definition: libpsio/init.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:159
psio_tocentry * psio_toclast(size_t unit)
size_t psio_get_numvols_default()
Definition: get_numvols.cc:61
int psio_rw(size_t unit, char *buffer, psio_address address, size_t size, int wrt)
Definition: rw.cc:138