1 |
/*****************************************************************
|
2 |
|
3 |
r2d_file.c Type:Func
|
4 |
|
5 |
Gestion du fichier historique de l octree
|
6 |
|
7 |
Date de creation : Tue Jul 15 10:07:38 1997
|
8 |
|
9 |
Derniere version : Tue Jul 29 11:28:45 1997
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
Vincent FRANCOIS
|
15 |
|
16 |
*****************************************************************/
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
/**************************/
|
23 |
/* include */
|
24 |
#include <stdio.h>
|
25 |
#include <string.h>
|
26 |
#include <stdlib.h>
|
27 |
#include "const.h"
|
28 |
#include "memoire.h"
|
29 |
#include "struct.h"
|
30 |
#include "prototype.h"
|
31 |
|
32 |
/**************************/
|
33 |
/* variables globales */
|
34 |
extern struct environnement env;
|
35 |
|
36 |
|
37 |
/**************************/
|
38 |
/* programme principal */
|
39 |
|
40 |
void r3d_file(char *mess)
|
41 |
{
|
42 |
static int etat=0;
|
43 |
static FILE *out;
|
44 |
char path[255];
|
45 |
|
46 |
|
47 |
if (strcmp(mess,"Close")==0)
|
48 |
{
|
49 |
fclose(out);
|
50 |
return;
|
51 |
}
|
52 |
if (etat==0)
|
53 |
{
|
54 |
strcpy(path,env.fich2);
|
55 |
path[strlen(path)-4]=0;
|
56 |
strcat(path,".oct");
|
57 |
out=fopen(path,"rt");
|
58 |
if (out==NULL)
|
59 |
{
|
60 |
aff_text(R3D_FILE);
|
61 |
abort();
|
62 |
}
|
63 |
etat=1;
|
64 |
}
|
65 |
|
66 |
do
|
67 |
fgets(mess,255,out);
|
68 |
while (mess[0]=='*');
|
69 |
}
|