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

« back to all changes in this revision

Viewing changes to src/lib/libipv1/ip_print.c

  • Committer: Bazaar Package Importer
  • Author(s): Michael Banck
  • Date: 2008-06-07 16:49:57 UTC
  • mfrom: (2.1.2 hardy)
  • Revision ID: james.westby@ubuntu.com-20080607164957-8pifvb133yjlkagn
Tags: 3.3.0-3
* debian/rules (DEB_MAKE_CHECK_TARGET): Do not abort test suite on
  failures.
* debian/rules (DEB_CONFIGURE_EXTRA_FLAGS): Set ${bindir} to /usr/lib/psi.
* debian/rules (install/psi3): Move psi3 file to /usr/bin.
* debian/patches/07_464867_move_executables.dpatch: New patch, add
  /usr/lib/psi to the $PATH, so that the moved executables are found.
  (closes: #464867)
* debian/patches/00list: Adjusted.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
 
2
 
/* $Log: ip_print.c,v $
3
 
/* Revision 1.2.4.1  2003/11/23 19:17:39  crawdad
4
 
/* Minor fixes: (1) Corrected dependencies in doc/Make*.in; (2) Elimintated
5
 
/* warnings from gcc -Wall in several libipv1 routines and psi2molden.
6
 
/* -TDC
7
 
/*
8
 
/* Revision 1.2  2003/08/21 19:03:36  evaleev
9
 
/* Fixed ip_cwk_add to add the keyword to the current keyword tree list even if
10
 
/* no parsed input contains entries under the keyword. Subsequent ip_append is
11
 
/* thus guaranteed to set the current keyword list properly.
12
 
/*
13
 
/* Revision 1.1.1.1  2000/02/04 22:53:26  evaleev
14
 
/* Started PSI 3 repository
15
 
/*
16
 
/* Revision 1.4  1994/06/02 02:22:28  seidl
17
 
/* using new tmpl now...change .global to .gbl and .local to .lcl
18
 
/*
19
 
 * Revision 1.1.1.1  1994/05/02  17:05:52  cljanss
20
 
 * The May 1, 1994 version of psi as on the CCQC machines.
21
 
 *
22
 
 * Revision 1.3  1991/07/30  03:28:45  seidl
23
 
 * add rcs log and id
24
 
 * */
25
 
 
26
1
#include <stdio.h>
27
2
#include <stdlib.h>
28
3
#include <string.h>
36
11
 
37
12
#define N_INDENT 2
38
13
 
39
 
GLOBAL_FUNCTION VOID
40
 
ip_print_keyword(fp,st)
41
 
FILE *fp;
42
 
ip_keyword_tree_t *st;
 
14
void ip_print_keyword(FILE *fp, ip_keyword_tree_t *st)
43
15
{
44
16
  if (st->up) ip_print_keyword(fp,st->up);
45
17
  fprintf(fp,"%s:",st->keyword);
47
19
 
48
20
/* This prints out a keyword tree, tree.  If tree is NULL then ip_tree
49
21
 * is printed out. */
50
 
GLOBAL_FUNCTION VOID
51
 
ip_print_tree(fp,tree)
52
 
FILE *fp;
53
 
ip_keyword_tree_t *tree;
 
22
void ip_print_tree(FILE *fp, ip_keyword_tree_t *tree)
54
23
{
55
24
  if (!tree) tree = ip_tree;
56
25
 
61
30
/* This prints out a keyword tree, tree.  If tree is NULL then ip_tree
62
31
 * is printed out.  Indent is used to record how deep in the tree we
63
32
 * are, so we know how far to indent things. */
64
 
LOCAL_FUNCTION VOID
65
 
ip_print_tree_(fp,tree,indent)
66
 
FILE *fp;
67
 
ip_keyword_tree_t *tree;
68
 
int indent;
 
33
LOCAL_FUNCTION void ip_print_tree_(FILE *fp, ip_keyword_tree_t *tree, int indent)
69
34
{
70
35
  ip_keyword_tree_t *I;
71
36
 
114
79
 
115
80
  }
116
81
 
117
 
LOCAL_FUNCTION VOID
118
 
ip_indent(fp,n)
119
 
FILE *fp;
120
 
int n;
 
82
LOCAL_FUNCTION void ip_indent(FILE *fp, int n)
121
83
{
122
84
  int i;
123
85
 
124
86
  for (i=0; i<n; i++) fprintf(fp," ");
125
87
  }
126
88
 
127
 
GLOBAL_FUNCTION VOID
128
 
ip_print_value(fp,value)
129
 
FILE *fp;
130
 
ip_value_t *value;
 
89
void ip_print_value(FILE *fp, ip_value_t *value)
131
90
{
132
91
  if (!value) return;
133
92
  ip_print_value_(fp,value,0);
134
93
  fprintf(fp,"\n");
135
94
  }
136
95
 
137
 
LOCAL_FUNCTION VOID
138
 
ip_print_value_(fp,value,indent)
139
 
FILE *fp;
140
 
ip_value_t *value;
141
 
int indent;
 
96
LOCAL_FUNCTION void ip_print_value_(FILE *fp, ip_value_t *value, int indent)
142
97
{
143
98
  if (value->type == IP_SCALAR) {
144
99
    if (ip_special_characters(value->v.scalar)) {
156
111
    }
157
112
  }
158
113
 
159
 
LOCAL_FUNCTION VOID
160
 
ip_print_array_(fp,array,indent)
161
 
FILE *fp;
162
 
ip_array_t *array;
163
 
int indent;
 
114
LOCAL_FUNCTION void ip_print_array_(FILE *fp, ip_array_t *array, int indent)
164
115
{
165
116
  int i;
166
117
  fprintf(fp,"(");
171
122
  fprintf(fp,")");
172
123
  }
173
124
 
174
 
LOCAL_FUNCTION int
175
 
ip_special_characters(keyword)
176
 
char *keyword;
 
125
LOCAL_FUNCTION int ip_special_characters(char *keyword)
177
126
{
178
127
  char *ch=keyword;
179
128