update of localizatio (same error message)
[scilab.git] / scilab / modules / fileio / src / c / mgetstr.c
1 /*--------------------------------------------------------------------------*/
2 /* Scilab */
3 /* INRIA 2007 */
4 /*--------------------------------------------------------------------------*/
5 #include <stdio.h>
6 #include "mgetstr.h"
7 #include "filesmanagement.h"
8 #include "MALLOC.h"
9 #include "sciprint.h"
10 #include "machine.h"
11 #include "localization.h"
12 /*--------------------------------------------------------------------------*/
13 void C2F(mgetstr) (integer *fd, char **start, integer *n, integer *ierr)
14
15         int count=0;
16         FILE *fa=NULL;
17         fa = GetFileOpenedInScilab(*fd);
18         *ierr=0;
19         if (fa)
20         { 
21                 *start= (char *) MALLOC((*n+1)*sizeof(char));
22                 if ( *start == (char *) 0)
23                 {       
24                         sciprint(_("%s: No more memory.\n"),"mgetstr");
25                         *ierr=1;
26                         return;
27                 }
28                 count=(int)fread(*start,sizeof(char),*n,fa);
29                 (*start)[*n]='\0';
30                 if ( count != *n ) 
31                 {
32                         *ierr = - count -1;
33                 }
34                 return;
35         }
36         sciprint(_("No input file\n"));
37         *ierr=1;
38 }
39 /*--------------------------------------------------------------------------*/
40 void C2F(mgetstr1) (integer *fd, char *start, integer *n, integer *ierr)
41
42         int count=0;
43         FILE *fa=NULL;
44         fa = GetFileOpenedInScilab(*fd);
45         *ierr=0;
46         if (fa)
47         { 
48                 count=(int)fread(start,sizeof(char),*n,fa);
49                 start[*n]='\0';
50                 if ( count != *n ) 
51                 {
52                         *ierr = - count -1;
53                 }
54                 return;
55         }
56         sciprint(_("No input file\n"));
57         *ierr=1;
58 }
59 /*--------------------------------------------------------------------------*/