~ubuntu-branches/ubuntu/hoary/scilab/hoary

« back to all changes in this revision

Viewing changes to imp/Slatexprs.c

  • Committer: Bazaar Package Importer
  • Author(s): Torsten Werner
  • Date: 2005-01-09 22:58:21 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20050109225821-473xr8vhgugxxx5j
Tags: 3.0-12
changed configure.in to build scilab's own malloc.o, closes: #255869

Show diffs side-by-side

added added

removed removed

Lines of Context:
6
6
#include <malloc.h>
7
7
#endif 
8
8
#include <stdio.h>
9
 
 
10
 
void readOneLine();
 
9
#include "util.h" 
11
10
 
12
11
#ifdef WIN32 
13
12
extern void SciEnv(void);
33
32
 
34
33
char entete[160];
35
34
 
36
 
void WriteTeX(filename,wide,height)
37
 
     double wide,height;
38
 
     char filename[];
 
35
void WriteTeX(char *filename, double wide, double height)
39
36
{
40
37
  char filename1[255];
41
38
  FILE *fdo;
70
67
#ifdef EPSFIG
71
68
  fprintf(fdo,"\\epsfig{file=\\Figdir %s.ps}\n",filename);
72
69
#else
73
 
  fprintf(fdo,"%% if you want to use epsfig uncomment the following line \n");
74
 
  fprintf(fdo,"%% and comment the special line \n");
75
 
  fprintf(fdo,"%%\\epsfig{file=\\Figdir %s.ps}\n",filename);
 
70
  fprintf(fdo,"%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n");
 
71
  fprintf(fdo,"%% If you want do not want to use epsfig ,comment the following line \n");
 
72
  fprintf(fdo,"%% and uncomment the \\special line \n");
 
73
  fprintf(fdo,"\\epsfig{file=\\Figdir %s.ps}\n",filename);
 
74
  fprintf(fdo,"%%\\special{psfile=\\Figdir %s.ps}\n", filename);
76
75
#endif
77
 
  fprintf(fdo,"\\special{psfile=\\Figdir %s.ps}\n", filename);
78
76
  fprintf(fdo,"\\end{picture}}\n");
79
77
  fprintf(fdo,"\\end{center}\n");
80
78
#ifndef DOC 
88
86
 file et en ecrivant sur fdo
89
87
-------------------------------------------------------*/
90
88
 
91
 
void Sed(file,strin1,strout1,strin2,strout2,strin3,strout3,fdo)
92
 
     FILE *fdo;
93
 
     char file[],strin1[],strout1[],strout3[];
94
 
     char strin2[],strout2[],strin3[];
 
89
void Sed(char *file, char *strin1, char *strout1, char *strin2, char *strout2, char *strin3, char *strout3, FILE *fdo)
95
90
{
96
91
  FILE *fd;
 
92
 
 
93
  static char *buff = NULL;
 
94
  static int buflen = 512;
 
95
  if ( buff == NULL) 
 
96
    {
 
97
      buff = malloc(buflen*sizeof(char));
 
98
      if ( buff == NULL) 
 
99
        {
 
100
          fprintf(stderr,"Running out of space \n");
 
101
          exit(1);
 
102
        }
 
103
    }
 
104
 
97
105
  fd=fopen(file,"r");
98
106
  if (fd != 0)
99
107
    { int stop=0;
100
108
      while ( stop != 1)
101
 
        {  char buff[512];
102
 
           readOneLine (buff,&stop,fd); 
 
109
        {  
 
110
           read_one_line (&buff,&stop,fd,&buflen); 
103
111
           if (strncmp(buff,strin1,strlen(strin1))==0)
104
112
             fprintf(fdo,"%s\n",strout1);
105
113
           else
125
133
}
126
134
 
127
135
/*-----------------------------------------------
128
 
  lit une ligne dans fd et la stocke dans buff
129
 
---------------------------------------------------*/
130
 
 
131
 
void readOneLine(buff,stop,fd)
132
 
     char buff[];
133
 
     int *stop;
134
 
     FILE *fd;
135
 
{ int i ,c ;
136
 
  for ( i = 0 ;  (c =getc(fd)) !=  '\n' && c != EOF ; i++) buff[i]= c ;
137
 
  buff[i]='\n';buff[i+1]='\0';
138
 
  if ( c == EOF) {*stop = 1;}
139
 
}
140
 
 
141
 
/*-----------------------------------------------
142
136
  calcule la taille pour un dessin suivant le nombre de dessin a 
143
137
  placer dans la feuille 
144
138
  num est le nombre de dessins et i le numero du dessin 
147
141
  (*wt et *ht sont la hauteur totale et la argeur totale)
148
142
-----------------------------------------------------*/
149
143
 
150
 
void ComputeSize(num,i,x,y,w,h,wt,ht)
151
 
     int num,i;
152
 
     double *x,*y,*w,*h,*wt,*ht;
 
144
void ComputeSize(int num, int i, double *x, double *y, double *w, double *h, double *wt, double *ht)
153
145
{
154
146
  switch (num)
155
147
    {
228
220
 
229
221
 
230
222
 
231
 
int main(argc, argv)
232
 
     int argc;
233
 
     char *argv[];
234
 
 
 
223
int main(int argc, char **argv)
235
224
{
236
225
  char *env;
237
226
  char filename1[255];