1
/* TN5250 - An implementation of the 5250 telnet protocol.
2
* Copyright (C) 1997-2008 Michael Madore
4
* This file is part of TN5250.
6
* TN5250 is free software; you can redistribute it and/or modify
7
* it under the terms of the GNU Lesser General Public License as published by
8
* the Free Software Foundation; either version 2.1, or (at your option)
11
* TN5250 is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
* GNU Lesser General Public License for more details.
16
* You should have received a copy of the GNU Lesser General Public License
17
* along with this software; see the file COPYING. If not, write to
18
* the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
19
* Boston, MA 02111-1307 USA
30
typedef unsigned short Tn5250Uint16;
31
typedef signed short Tn5250Sint16;
33
typedef unsigned int Tn5250Uint16;
34
typedef signed int Tn5250Sint16;
36
ACK! Need a 16-bit type!
39
typedef unsigned char Tn5250Char;
41
/****s* lib5250/Tn5250CharMap
45
* Tn5250CharMap *map = tn5250_char_map_new ("37");
46
* ac = tn5250_char_map_to_local(map,ec);
47
* ec = tn5250_char_map_to_remote(map,ac);
48
* if (tn5250_char_map_printable_p (map,ec))
50
* if (tn5250_char_map_attribute_p (map,ec))
52
* tn5250_char_map_destroy(map);
54
* The Tn5250CharMap object embodies a translation map which can be
55
* used to translate characters from various flavours of ASCII and
56
* ISO character sets to various flavours of EBCDIC characters sets
62
struct _Tn5250CharMap {
64
const unsigned char *to_remote_map;
65
const unsigned char *to_local_map;
68
typedef struct _Tn5250CharMap Tn5250CharMap;
71
unsigned long int address;
72
unsigned long int mask;
75
typedef struct _clientaddr clientaddr;
77
extern Tn5250CharMap tn5250_transmaps[];
80
Tn5250CharMap *tn5250_char_map_new(const char *maping);
81
void tn5250_char_map_destroy(Tn5250CharMap *This);
83
void tn5250_closeall(int fd);
84
int tn5250_daemon(int nochdir, int noclose, int ignsigcld);
85
int tn5250_make_socket(unsigned short int port);
87
Tn5250Char tn5250_char_map_to_remote(Tn5250CharMap *This, Tn5250Char ascii);
88
Tn5250Char tn5250_char_map_to_local(Tn5250CharMap *This, Tn5250Char ebcdic);
90
int tn5250_char_map_printable_p(Tn5250CharMap *This, Tn5250Char data);
91
int tn5250_char_map_attribute_p(Tn5250CharMap *This, Tn5250Char data);
92
int tn5250_setenv(const char *name, const char *value, int overwrite);
94
/* Idea shamelessly stolen from GTK+ */
95
#define tn5250_new(type,count) (type *)malloc (sizeof (type) * (count))
97
#define TN5250_MAKESTRING(expr) #expr
99
void tn5250_log_open(const char *fname);
100
void tn5250_log_printf(const char *fmt,...);
101
void tn5250_log_close(void);
102
void tn5250_log_assert(int val, char const *expr, char const *file, int line);
103
#define TN5250_LOG(args) tn5250_log_printf args
104
#define TN5250_ASSERT(expr) \
105
tn5250_log_assert((expr), TN5250_MAKESTRING(expr), __FILE__, __LINE__)
107
extern FILE * tn5250_logfile;
109
#define TN5250_LOG(args)
110
#define TN5250_ASSERT(expr)
115
int tn5250_parse_color(Tn5250Config *config, const char *colorname,
116
int *r, int *g, int *b);
117
int tn5250_run_cmd(const char *cmd, int wait);
123
#endif /* UTILITY_H */
125
/* vi:set sts=3 sw=3: */