summaryrefslogtreecommitdiff
path: root/app/luit/iso2022.h
diff options
context:
space:
mode:
Diffstat (limited to 'app/luit/iso2022.h')
-rw-r--r--app/luit/iso2022.h79
1 files changed, 43 insertions, 36 deletions
diff --git a/app/luit/iso2022.h b/app/luit/iso2022.h
index 33097df57..844cfdd10 100644
--- a/app/luit/iso2022.h
+++ b/app/luit/iso2022.h
@@ -19,58 +19,63 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
-/* $XFree86: xc/programs/luit/iso2022.h,v 1.4 2002/07/01 02:25:59 tsi Exp $ */
-
-#define ESC 0x1B
-#define CSI 0x9B
-#define CSI_7 '['
-#define SS2 0x8E
-#define SS2_7 0x4E
-#define SS3 0x8F
-#define SS3_7 0x4F
-#define LS0 0x0F
-#define LS1 0x0E
-#define LS2_7 0x6E
-#define LS3_7 0x6F
+
+#ifndef LUIT_ISO2022_H
+#define LUIT_ISO2022_H 1
+
+#include "charset.h"
+
+#define ESC 0x1B
+#define CSI 0x9B
+#define CSI_7 '['
+#define SS2 0x8E
+#define SS2_7 0x4E
+#define SS3 0x8F
+#define SS3_7 0x4F
+#define LS0 0x0F
+#define LS1 0x0E
+#define LS2_7 0x6E
+#define LS3_7 0x6F
#define LS1R_7 0x7E
#define LS2R_7 0x7D
#define LS3R_7 0x7C
#define IS_FINAL_ESC(x) (((x) & 0xF0 ) != 0x20)
-#define IS_FINAL_CSI(x) (((x) & 0xF0 ) != 0x20 && (((x) & 0xF0 ) != 0x30))
+#define IS_FINAL_CSI(x) (((x) & 0xF0 ) != 0x20 && (((x) & 0xF0 ) != 0x30))
-#define P_NORMAL 0
-#define P_ESC 1
-#define P_CSI 2
+#define P_NORMAL 0
+#define P_ESC 1
+#define P_CSI 2
-#define S_NORMAL 0
-#define S_SS2 1
-#define S_SS3 2
+#define S_NORMAL 0
+#define S_SS2 1
+#define S_SS3 2
-#define IF_SS 1
-#define IF_LS 2
+#define IF_SS 1
+#define IF_LS 2
#define IF_EIGHTBIT 4
-#define IF_SSGR 8
+#define IF_SSGR 8
-#define OF_SS 1
-#define OF_LS 2
-#define OF_SELECT 4
+#define OF_SS 1
+#define OF_LS 2
+#define OF_SELECT 4
#define OF_PASSTHRU 8
typedef struct _Iso2022 {
- CharsetPtr *glp, *grp;
- CharsetPtr g[4];
- CharsetPtr other;
+ const CharsetRec **glp;
+ const CharsetRec **grp;
+ const CharsetRec *g[4];
+ const CharsetRec *other;
int parserState;
int shiftState;
int inputFlags;
int outputFlags;
unsigned char *buffered;
- int buffered_len;
- int buffered_count;
+ size_t buffered_len;
+ size_t buffered_count;
int buffered_ku;
unsigned char *outbuf;
- int outbuf_count;
+ size_t outbuf_count;
} Iso2022Rec, *Iso2022Ptr;
#define GL(i) (*(i)->glp)
@@ -85,10 +90,12 @@ typedef struct _Iso2022 {
Iso2022Ptr allocIso2022(void);
void destroyIso2022(Iso2022Ptr);
-int initIso2022(char *, char *, Iso2022Ptr);
+int initIso2022(const char *, const char *, Iso2022Ptr);
int mergeIso2022(Iso2022Ptr, Iso2022Ptr);
void reportIso2022(Iso2022Ptr);
void terminate(Iso2022Ptr, int);
-void terminateEsc(Iso2022Ptr, int, unsigned char*, int);
-void copyIn(Iso2022Ptr, int, unsigned char*, int);
-void copyOut(Iso2022Ptr, int, unsigned char*, int);
+void terminateEsc(Iso2022Ptr, int, unsigned char *, unsigned);
+void copyIn(Iso2022Ptr, int, unsigned char *, int);
+void copyOut(Iso2022Ptr, int, unsigned char *, unsigned);
+
+#endif /* LUIT_ISO2022_H */