PIPS
maind.c File Reference
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include "pip__type.h"
#include "pip__sol.h"
#include "pip__tab.h"
#include <sys/types.h>
+ Include dependency graph for maind.c:

Go to the source code of this file.

Macros

#define INLENGTH   1024
 This file comes directly from maind.c, from which main() has been removed. More...
 

Functions

Tableauexpanser ()
 
int dgetc (FILE *foo)
 
int dscanf (FILE *foo, char *format, Entier *val)
 
void balance (FILE *foo, FILE *bar)
 
void escape (FILE *foo, FILE *bar, int level)
 

Variables

long int cross_product
 
long int limit
 
int allocation
 External variables for direct call to PIP. More...
 
int comptage
 
char inbuff []
 
int inptr
 
int proviso
 
int verbose
 
FILE * dump
 Should not be used : put here for Pip copatibility. More...
 
char dump_name []
 

Macro Definition Documentation

◆ INLENGTH

#define INLENGTH   1024

This file comes directly from maind.c, from which main() has been removed.

All globals definitions has also been removed. This file is necessary for compilation. AL 9/12/93

Definition at line 41 of file maind.c.

Function Documentation

◆ balance()

void balance ( FILE *  foo,
FILE *  bar 
)

Definition at line 98 of file maind.c.

100 {
101  int level = 0;
102  int c;
103  while((c = dgetc(foo)) != EOF)
104  {putc(c, bar);
105  switch(c)
106  {case '(' : level++; break;
107  case ')' : if(--level == 0) return;
108  }
109  }
110 }
int dgetc(FILE *foo)
Definition: maind.c:52
#define level

References dgetc(), and level.

+ Here is the call graph for this function:

◆ dgetc()

int dgetc ( FILE *  foo)

Definition at line 52 of file maind.c.

54 {
55  char *p;
56  if(inptr >= proviso)
57  {p = fgets(inbuff, INLENGTH, foo);
58  if(p == NULL) return EOF;
59  proviso = strlen(inbuff);
60  if(INLENGTH - proviso <= 1) {
61  fprintf(stderr, "troncature %d\n",proviso);
62  exit(12);
63  }
64  inptr = 0;
65  if(verbose > 0) fprintf(dump, "-- %s", inbuff);
66  }
67  return inbuff[inptr++];
68 }
int verbose
Definition: maind.c:45
int inptr
Definition: pip.c:94
int proviso
Definition: maind.c:45
#define INLENGTH
This file comes directly from maind.c, from which main() has been removed.
Definition: maind.c:41
char inbuff[]
Definition: pip.c:93
FILE * dump
Should not be used : put here for Pip copatibility.
Definition: pip.c:97
#define exit(code)
Definition: misc-local.h:54
int fprintf()
test sc_min : ce test s'appelle par : programme fichier1.data fichier2.data ...

References dump, exit, fprintf(), inbuff, INLENGTH, inptr, proviso, and verbose.

Referenced by balance(), escape(), and tab_get().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dscanf()

int dscanf ( FILE *  foo,
char *  format,
Entier val 
)

Definition at line 70 of file maind.c.

74 {
75  char * p;
76  int c;
77  for(;inptr < proviso; inptr++)
78  if(inbuff[inptr] != ' ' && inbuff[inptr] != '\n' && inbuff[inptr] != '\t')
79  break;
80  while(inptr >= proviso)
81  {p = fgets(inbuff, 256, foo);
82  if(p == NULL) return EOF;
83  proviso = strlen(inbuff);
84  if(verbose > 0) {
85  fprintf(dump, ".. %s", inbuff);
86  fflush(dump);
87  }
88  for(inptr = 0; inptr < proviso; inptr++)
89  if(inbuff[inptr] != ' ' && inbuff[inptr] != '\n' && inbuff[inptr] != '\t')
90  break;
91  }
92  if(sscanf(inbuff+inptr, format, val) != 1) return -1;
93  for(; inptr < proviso; inptr++)
94  if((c = inbuff[inptr]) != '-' && !isdigit(c)) break;
95  return 0;
96 }

References dump, fprintf(), inbuff, inptr, proviso, and verbose.

Referenced by tab_get().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ escape()

void escape ( FILE *  foo,
FILE *  bar,
int  level 
)

Definition at line 112 of file maind.c.

115 {int c;
116  while((c = dgetc(foo)) != EOF)
117  switch(c)
118  {case '(' : level ++; break;
119  case ')' : if(--level == 0)
120  { fprintf(bar, "\nerror\n)\n");
121  return;
122  }
123  }
124 }

References dgetc(), fprintf(), and level.

+ Here is the call graph for this function:

◆ expanser()

Tableau* expanser ( )

Variable Documentation

◆ allocation

int allocation
extern

External variables for direct call to PIP.

Definition at line 92 of file pip.c.

Referenced by dag_vertex_pred_imagelets(), and freia_terapix_call().

◆ comptage

int comptage

Definition at line 43 of file maind.c.

◆ cross_product

long int cross_product
extern

Definition at line 91 of file pip.c.

Referenced by choisir_piv(), integrer(), pivoter(), and traiter().

◆ dump

FILE* dump
extern

Should not be used : put here for Pip copatibility.

Definition at line 97 of file pip.c.

Referenced by dgetc(), dscanf(), and pivoter().

◆ dump_name

char dump_name[]
extern

Definition at line 98 of file pip.c.

◆ inbuff

char inbuff[]
extern

Definition at line 93 of file pip.c.

Referenced by dgetc(), and dscanf().

◆ inptr

int inptr
extern

Definition at line 94 of file pip.c.

Referenced by dgetc(), and dscanf().

◆ limit

long int limit

Definition at line 42 of file maind.c.

◆ proviso

int proviso

Definition at line 45 of file maind.c.

Referenced by dgetc(), and dscanf().

◆ verbose

int verbose

Definition at line 45 of file maind.c.

Referenced by dgetc(), dscanf(), and pivoter().