~ubuntu-branches/ubuntu/vivid/psicode/vivid

« back to all changes in this revision

Viewing changes to src/lib/libchkpt/prefix.c

  • 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 prefix.c
3
 
  \ingroup (CHKPT)
4
 
*/
5
 
 
6
 
#include <stdlib.h>
7
 
#include <string.h>
8
 
#include "chkpt.h"
9
 
#include <psifiles.h>
10
 
#include <libpsio/psio.h>
11
 
 
12
 
/*!
13
 
**  char *chkpt_rd_prefix() 
14
 
**  Reads the global default chkpt prefix keyword stored in the CHKPT file.
15
 
**
16
 
**  returns: the prefix string
17
 
** \ingroup (CHKPT)
18
 
*/
19
 
 
20
 
char *chkpt_rd_prefix(void)
21
 
{  
22
 
  char *prefix;
23
 
 
24
 
  prefix = (char *) malloc(CHKPT_PREFIX_LEN*sizeof(char));
25
 
 
26
 
  psio_read_entry(PSIF_CHKPT, "Default prefix", prefix, CHKPT_PREFIX_LEN*sizeof(char));
27
 
 
28
 
  return prefix;
29
 
}
30
 
 
31
 
/*!
32
 
**  void chkpt_wt_prefix() 
33
 
**  Writes the global default chkpt prefix keyword.
34
 
**
35
 
**  \param prefix = the prefix string (must be CHKPT_PREFIX_LEN long)
36
 
**
37
 
**  returns: none
38
 
** \ingroup (CHKPT)
39
 
*/
40
 
void chkpt_wt_prefix(char *prefix)
41
 
{  
42
 
  psio_write_entry(PSIF_CHKPT, "Default prefix", prefix, CHKPT_PREFIX_LEN*sizeof(char));
43
 
}
44
 
 
45
 
 
46
 
/*!
47
 
**  void chkpt_set_prefix() 
48
 
**  Sets the default chkpt prefix in global memory.  After this is set,
49
 
**  it is intended that all chkpt_rd_() and chkpt_wt_() calls will use
50
 
**  this prefix for psio keyword strings.
51
 
**
52
 
**  \param prefix = the prefix string
53
 
**
54
 
**  returns: none
55
 
** \ingroup (CHKPT)
56
 
*/
57
 
void chkpt_set_prefix(char *prefix)
58
 
{
59
 
  strcpy(chkpt_prefix, prefix);
60
 
}
61
 
 
62
 
/*!
63
 
**  void chkpt_commit_prefix() 
64
 
**  Writes the default chkpt prefix from global memory into the chkpt file.
65
 
**
66
 
**  arguments: none
67
 
**
68
 
**  returns: none
69
 
** \ingroup (CHKPT)
70
 
*/
71
 
void chkpt_commit_prefix(void)
72
 
{
73
 
  chkpt_wt_prefix(chkpt_prefix);
74
 
}
75
 
 
76
 
/*!
77
 
**  void chkpt_reset_prefix() 
78
 
**  Sets the chkpt prefix in global memory back to its default.  At 
79
 
**  present this is a null string.
80
 
**
81
 
**  arguments: none
82
 
**
83
 
**  returns: none
84
 
** \ingroup (CHKPT)
85
 
*/
86
 
void chkpt_reset_prefix(void)
87
 
{
88
 
  chkpt_prefix[0] = '\0';
89
 
}
90
 
 
91
 
/*!
92
 
**  char * chkpt_get_prefix() 
93
 
**  Returns a copy of the current chkpt prefix default stored 
94
 
**  in global memory.
95
 
**
96
 
**  arguments: none
97
 
**
98
 
**  returns: prefix = the current global prefix
99
 
** \ingroup (CHKPT)
100
 
*/
101
 
char *chkpt_get_prefix(void)
102
 
{
103
 
  char *prefix;
104
 
 
105
 
  prefix = (char *) malloc(CHKPT_PREFIX_LEN*sizeof(char));
106
 
 
107
 
  strcpy(prefix,chkpt_prefix);
108
 
 
109
 
  return prefix;
110
 
}