~ubuntu-branches/ubuntu/trusty/psicode/trusty

« back to all changes in this revision

Viewing changes to src/lib/libiwl/buf_close.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
/*! \defgroup IWL libiwl: I/O Library for Integrals with Labels */
 
2
 
 
3
/*!
 
4
  \file
 
5
  \ingroup IWL
 
6
*/
 
7
#include <cstdio>
 
8
#include <cstdlib>
 
9
#include <libpsio/psio.h>
 
10
extern "C" {
 
11
#include "iwl.h"
 
12
}
 
13
#include "iwl.hpp"
 
14
 
 
15
using namespace psi;
 
16
 
 
17
IWL::~IWL()
 
18
{
 
19
    close();
 
20
}
 
21
 
 
22
void IWL::close()
 
23
{
 
24
    psio_->close(itap_, keep_);
 
25
    if (labels_)
 
26
        delete[](labels_);
 
27
    if (values_)
 
28
        delete[](values_);
 
29
    labels_ = NULL;
 
30
    values_ = NULL;
 
31
}
 
32
 
 
33
extern "C" {
 
34
 
 
35
/*!
 
36
** IWL_BUF_CLOSE()
 
37
** 
 
38
**      \param Buf      Buffer to be closed
 
39
**      \param keep    Do not delete if keep==1
 
40
**
 
41
** Close a Integrals With Labels Buffer
 
42
** \ingroup IWL
 
43
*/
 
44
void iwl_buf_close(struct iwlbuf *Buf, int keep)
 
45
{
 
46
 
 
47
   psio_close(Buf->itap, keep ? 1 : 0);
 
48
   free(Buf->labels);
 
49
   free(Buf->values);
 
50
}
 
51
 
 
52
} /* extern "C" */
 
 
b'\\ No newline at end of file'