File: cplib.h

package info (click to toggle)
wp2latex 3.112%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 5,916 kB
  • sloc: cpp: 49,708; ansic: 9,318; asm: 5,429; makefile: 542; sh: 22
file content (53 lines) | stat: -rw-r--r-- 1,139 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#ifndef __CP_Lib_h
#define __CP_Lib_h

#include <stdio.h>

#include "typedfs.h"


class codepage
	{
public: codepage(void)	{name=NULL;characters=NULL;MaxUsed=Allocated=0;};
	~codepage(void);

	char *name;
	WORD Allocated;
	WORD MaxUsed;
	char **characters;

	void InsertCharDesc(WORD position, const char *Name);
        void Erase(void);
	};


class Translator
	{
public: Translator(void)  {ToCp=FromCp=NULL;Data=NULL;}
	~Translator(void) {erase();}

	const codepage *FromCp;
	const codepage *ToCp;
	WORD *Data;

	void erase(void);
	};


int CreateTranslator(Translator & trn, const codepage & cp1, const codepage & cp2);
int WriteTranslator(const codepage & cp_from, const codepage & cp_to, Translator &trn, FILE *F);
void WriteStringTable(FILE *F,const codepage & cp,doublelist & ll);

void CreateCodePage(string cpfilename,codepage & cp,doublelist & ll);
bool LoadCodePage(string cpfilename, codepage & cp, int ShowAll=1);
void LoadTextCodePage(string cpfilename,doublelist & ll);

string & fGets2(FILE *f, string & pstr);


#ifndef coreleft
  #define coreleft() 0l
#endif


#endif