Subversion Repositories SvarDOS

Rev

Rev 244 | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 244 Rev 269
1
/* Functions that emulate UNIX catgets, some small DOS file functions */
1
/* Functions that emulate UNIX catgets, some small DOS file functions */
2
 
2
 
3
/* Copyright (C) 1999,2000 Jim Hall <jhall@freedos.org> */
3
/* Copyright (C) 1999,2000 Jim Hall <jhall@freedos.org> */
4
/* Kitten version by Tom Ehlert, heavily modified by Eric Auer 2003 */
4
/* Kitten version by Tom Ehlert, heavily modified by Eric Auer 2003 */
5
 
5
 
6
/*
6
/*
7
  This library is free software; you can redistribute it and/or
7
  This library is free software; you can redistribute it and/or
8
  modify it under the terms of the GNU Lesser General Public
8
  modify it under the terms of the GNU Lesser General Public
9
  License as published by the Free Software Foundation; either
9
  License as published by the Free Software Foundation; either
10
  version 2.1 of the License, or (at your option) any later version.
10
  version 2.1 of the License, or (at your option) any later version.
11

11

12
  This library is distributed in the hope that it will be useful,
12
  This library is distributed in the hope that it will be useful,
13
  but WITHOUT ANY WARRANTY; without even the implied warranty of
13
  but WITHOUT ANY WARRANTY; without even the implied warranty of
14
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15
  Lesser General Public License for more details.
15
  Lesser General Public License for more details.
16

16

17
  You should have received a copy of the GNU Lesser General Public
17
  You should have received a copy of the GNU Lesser General Public
18
  License along with this library; if not, write to the Free Software
18
  License along with this library; if not, write to the Free Software
19
  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19
  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
20
*/
20
*/
21
 
21
 
22
 
22
 
23
#ifndef _CATGETS_H
23
#ifndef _CATGETS_H
24
#define _CATGETS_H
24
#define _CATGETS_H
25
 
25
 
26
#ifdef __cplusplus
26
#ifdef __cplusplus
27
extern "C"
27
extern "C"
28
{
28
{
29
#endif
29
#endif
30
 
30
 
31
#ifdef NO_KITTEN
31
#ifdef NO_KITTEN
32
 
32
 
33
#define kittengets(x,y,z) (z)
33
#define kittengets(x,y,z) (z)
34
#define kittenclose()
34
#define kittenclose()
35
#define kittenopen(a)
35
#define kittenopen(a)
36
 
36
 
37
#else
37
#else
38
 
38
 
39
/* Data types */
39
/* Data types */
40
 
40
 
41
#define nl_catd int
41
#define nl_catd int
42
 
42
 
43
/* Functions */
43
/* Functions */
44
 
44
 
45
#define catgets(catalog, set,message_number,message) kittengets(set,message_number,message)
45
#define catgets(catalog, set,message_number,message) kittengets(set,message_number,message)
46
#define catopen(name,flag) kittenopen(name)
46
#define catopen(name,flag) kittenopen(name)
47
#define catclose(catalog)  kittenclose()
47
#define catclose(catalog)  kittenclose()
48
 
48
 
49
 
49
 
50
  char *kittengets (int set_number, int message_number, char *message);
50
  char *kittengets (int set_number, int message_number, char *message);
51
  nl_catd kittenopen (char *name);
51
  nl_catd kittenopen (char *name);
52
  void kittenclose (void);
52
  void kittenclose (void);
53
 
53
 
54
  int get_line (int file, char *buffer, int size);
54
  int get_line (int file, char *buffer, int size);
55
 
55
 
56
#ifndef _MICROC_
56
#ifndef _MICROC_
57
#ifndef __DJGPP__
57
#ifndef __DJGPP__
58
 
58
 
59
  int dos_open (char *filename, int mode);
59
  int dos_open (char *filename, int mode);
60
#define open(filename,mode) dos_open(filename,mode)
60
#define open(filename,mode) dos_open(filename,mode)
61
 
61
 
62
  int dos_read (int file, void *ptr, unsigned count);
62
  int dos_read (int file, void *ptr, unsigned count);
63
#define read(file, ptr, count) dos_read(file,ptr,count)
63
#define read(file, ptr, count) dos_read(file,ptr,count)
64
 
64
 
65
  int dos_write (int file, void *ptr, unsigned count);
65
  int dos_write (int file, void *ptr, unsigned count);
66
#define write(file, ptr, count) dos_write(file,ptr,count)
66
#define write(file, ptr, count) dos_write(file,ptr,count)
67
 
67
 
68
  void dos_close (int file);
68
  void dos_close (int file);
69
#define close(file) dos_close(file)
69
#define close(file) dos_close(file)
70
 
70
 
71
#endif  /*DJGPP*/
71
#endif  /*DJGPP*/
72
#endif				/*Micro-C */
72
#endif				/*Micro-C */
73
#endif				/*NO_KITTEN */
73
#endif				/*NO_KITTEN */
74
#ifdef __cplusplus
74
#ifdef __cplusplus
75
}
75
}
76
#endif
76
#endif
77
 
77
 
78
#endif				/* _CATGETS_H */
78
#endif				/* _CATGETS_H */
79
 
79