~ubuntu-branches/ubuntu/quantal/psicode/quantal

« back to all changes in this revision

Viewing changes to src/lib/libchkpt/us2s.cc

  • Committer: Bazaar Package Importer
  • Author(s): Michael Banck, Michael Banck, Daniel Leidert
  • Date: 2009-02-23 00:12:02 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20090223001202-rutldoy3dimfpesc
Tags: 3.4.0-1
* New upstream release.

[ Michael Banck ]
* debian/patches/01_DESTDIR.dpatch: Refreshed.
* debian/patches/02_FHS.dpatch: Removed, applied upstream.
* debian/patches/03_debian_docdir: Likewise.
* debian/patches/04_man.dpatch: Likewise.
* debian/patches/06_466828_fix_gcc_43_ftbfs.dpatch: Likewise.
* debian/patches/07_464867_move_executables: Fixed and refreshed.
* debian/patches/00list: Adjusted.
* debian/control: Improved description.
* debian/patches-held: Removed.
* debian/rules (install/psi3): Do not ship the ruby bindings for now.

[ Daniel Leidert ]
* debian/rules: Fix txtdir via DEB_MAKE_INSTALL_TARGET.
* debian/patches/01_DESTDIR.dpatch: Refreshed.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*!
 
2
  \file
 
3
  \ingroup CHKPT
 
4
*/
 
5
 
 
6
#include <cstdlib>
 
7
#include <psifiles.h>
 
8
#include <libpsio/psio.hpp>
 
9
extern "C" {
 
10
        #include <libchkpt/chkpt.h>
 
11
}
 
12
#include <libchkpt/chkpt.hpp>
 
13
 
 
14
using namespace psi;
 
15
 
 
16
int *Chkpt::rd_us2s(void)
 
17
{
 
18
        int *us2s;
 
19
        int num_unique_shells;
 
20
        char *keyword;
 
21
        keyword = build_keyword("Unique shell -> full shell map");
 
22
 
 
23
        num_unique_shells = rd_num_unique_shell();
 
24
        us2s = array<int>(num_unique_shells);
 
25
 
 
26
        psio->read_entry(PSIF_CHKPT, keyword, (char *) us2s, num_unique_shells*sizeof(int));
 
27
 
 
28
        free(keyword);
 
29
        return us2s;
 
30
}
 
31
 
 
32
void Chkpt::wt_us2s(int *us2s)
 
33
{
 
34
        int num_unique_shells;
 
35
        char *keyword;
 
36
        keyword = build_keyword("Unique shell -> full shell map");
 
37
 
 
38
        num_unique_shells = rd_num_unique_shell();
 
39
 
 
40
        psio->write_entry(PSIF_CHKPT, keyword, (char *) us2s, num_unique_shells*sizeof(int));
 
41
 
 
42
        free(keyword);
 
43
}
 
44
 
 
45
extern "C" {
 
46
/*!
 
47
** int *chkpt_rd_us2s()
 
48
** Read in a mapping array betwen unique shell and 
 
49
** full shell lists
 
50
**
 
51
** returns: us2s = Read in an array num_unique_shell
 
52
** 
 
53
** \ingroup CHKPT
 
54
*/
 
55
        int *chkpt_rd_us2s(void)
 
56
        {
 
57
                return _default_chkpt_lib_->rd_us2s();
 
58
        }
 
59
 
 
60
/*!
 
61
** void chkpt_wt_us2s(int *)
 
62
** Writes out a mapping array betwen unique shell and 
 
63
** full shell lists.
 
64
**
 
65
** \param us2s = An array num_unique_shell
 
66
**
 
67
** returns: none
 
68
** 
 
69
** \ingroup CHKPT
 
70
*/
 
71
        void chkpt_wt_us2s(int *us2s)
 
72
        {
 
73
                _default_chkpt_lib_->wt_us2s(us2s);
 
74
        }
 
75
}