Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 234824 | Differences between
and this patch

Collapse All | Expand All

(-)CMakeLists.txt (+3 lines)
Lines 12-16 Link Here
12
   message(FATAL_ERROR "In-tree build attempt detected, aborting. Set your build dir outside your source dir and try again.")
12
   message(FATAL_ERROR "In-tree build attempt detected, aborting. Set your build dir outside your source dir and try again.")
13
endif()
13
endif()
14
14
15
set(RELATIVE_DATADIR "share/cuneiform")
16
set(INSTALL_DATADIR "${CMAKE_INSTALL_PREFIX}/${RELATIVE_DATADIR}")
17
15
add_subdirectory(datafiles)
18
add_subdirectory(datafiles)
16
add_subdirectory(cuneiform_src)
19
add_subdirectory(cuneiform_src)
(-)cuneiform_src/Kern/CMakeLists.txt (+3 lines)
Lines 102-104 Link Here
102
add_executable(cuneiform cuneiform-cli.cpp)
102
add_executable(cuneiform cuneiform-cli.cpp)
103
target_link_libraries(cuneiform puma ${MAGICK_LIBRARIES} ${DL_LIB})
103
target_link_libraries(cuneiform puma ${MAGICK_LIBRARIES} ${DL_LIB})
104
#${PUMA_LIBS} ${RPSTR_LIBS} ${SNP_LIBS} dl)
104
#${PUMA_LIBS} ${RPSTR_LIBS} ${SNP_LIBS} dl)
105
106
install(TARGETS windummy LIBRARY DESTINATION lib)
107
install(TARGETS cuneiform RUNTIME DESTINATION bin)
(-)cuneiform_src/Kern/ccom/CMakeLists.txt (-1 / +3 lines)
Lines 2-5 Link Here
2
2
3
add_library(ccom ${LIBTYPE}
3
add_library(ccom ${LIBTYPE}
4
src/ccom.c
4
src/ccom.c
5
src/ccom_loc.c)
5
src/ccom_loc.c)
6
7
install(TARGETS ccom LIBRARY DESTINATION lib)
(-)cuneiform_src/Kern/ced/CMakeLists.txt (-1 / +3 lines)
Lines 11-14 Link Here
11
sources/main/wrapper.cpp
11
sources/main/wrapper.cpp
12
)
12
)
13
13
14
target_link_libraries(ced cfio windummy)
14
target_link_libraries(ced cfio windummy)
15
16
install(TARGETS ced LIBRARY DESTINATION lib)
(-)cuneiform_src/Kern/cfio/CMakeLists.txt (-1 / +3 lines)
Lines 9-12 Link Here
9
sources/cpp/dll_main.cpp
9
sources/cpp/dll_main.cpp
10
)
10
)
11
11
12
target_link_libraries(cfio windummy)
12
target_link_libraries(cfio windummy)
13
14
install(TARGETS cfio LIBRARY DESTINATION lib)
(-)cuneiform_src/Kern/cimage/CMakeLists.txt (-1 / +3 lines)
Lines 13-16 Link Here
13
sources/main/dll.cpp
13
sources/main/dll.cpp
14
)
14
)
15
15
16
target_link_libraries(cimage cfio rdib)
16
target_link_libraries(cimage cfio rdib)
17
18
install(TARGETS cimage LIBRARY DESTINATION lib)
(-)cuneiform_src/Kern/cline/CMakeLists.txt (-1 / +3 lines)
Lines 9-12 Link Here
9
sources/src/cpp/lcline.cpp
9
sources/src/cpp/lcline.cpp
10
)
10
)
11
11
12
target_link_libraries(cline windummy)
12
target_link_libraries(cline windummy)
13
14
install(TARGETS cline LIBRARY DESTINATION lib)
(-)cuneiform_src/Kern/config.h.in (+3 lines)
Line 1 Link Here
1
#cmakedefine USE_MAGICK
1
#cmakedefine USE_MAGICK
2
3
#define INSTALL_PREFIX "@CMAKE_INSTALL_PREFIX@"
4
#define INSTALL_DATADIR "@INSTALL_DATADIR@"
(-)cuneiform_src/Kern/cpage/CMakeLists.txt (-1 / +3 lines)
Lines 19-22 Link Here
19
sources/cpp/tableclass.cpp
19
sources/cpp/tableclass.cpp
20
)
20
)
21
21
22
target_link_libraries(cpage windummy)
22
target_link_libraries(cpage windummy)
23
24
install(TARGETS cpage LIBRARY DESTINATION lib)
(-)cuneiform_src/Kern/cpu/CMakeLists.txt (-1 / +3 lines)
Lines 1-4 Link Here
1
add_library(cpu ${LIBTYPE}
1
add_library(cpu ${LIBTYPE}
2
src/cpu.c
2
src/cpu.c
3
src/cpu32.c
3
src/cpu32.c
4
)
4
)
5
6
install(TARGETS cpu LIBRARY DESTINATION lib)
(-)cuneiform_src/Kern/cstr/CMakeLists.txt (-1 / +3 lines)
Lines 4-7 Link Here
4
src/cgraph.cpp
4
src/cgraph.cpp
5
src/cstr.c)
5
src/cstr.c)
6
6
7
target_link_libraries(cstr ccom)
7
target_link_libraries(cstr ccom)
8
9
install(TARGETS cstr LIBRARY DESTINATION lib)
(-)cuneiform_src/Kern/ctb/CMakeLists.txt (-1 / +3 lines)
Lines 9-12 Link Here
9
src/ctb_tool.c
9
src/ctb_tool.c
10
)
10
)
11
11
12
target_link_libraries(ctb32 windummy)
12
target_link_libraries(ctb32 windummy)
13
14
install(TARGETS ctb32 LIBRARY DESTINATION lib)
(-)cuneiform_src/Kern/dif/CMakeLists.txt (+2 lines)
Lines 8-10 Link Here
8
src/sticdif.c
8
src/sticdif.c
9
src/stictool.c
9
src/stictool.c
10
)
10
)
11
12
install(TARGETS dif LIBRARY DESTINATION lib)
(-)cuneiform_src/Kern/evn32/CMakeLists.txt (-1 / +3 lines)
Lines 13-16 Link Here
13
src/v0comprq.c
13
src/v0comprq.c
14
)
14
)
15
15
16
target_link_libraries(evn32 dif windummy)
16
target_link_libraries(evn32 dif windummy)
17
18
install(TARGETS evn32 LIBRARY DESTINATION lib)
(-)cuneiform_src/Kern/evn32/src/evn.c (-2 / +2 lines)
Lines 194-200 Link Here
194
194
195
  evn_error_code = ER_EVN_NO_ERROR;
195
  evn_error_code = ER_EVN_NO_ERROR;
196
196
197
  h=open(file1, O_BINARY| O_RDONLY);
197
  h = open_data_file(file1, O_BINARY| O_RDONLY);
198
  strcpy(load_tab1, file1);
198
  strcpy(load_tab1, file1);
199
  if( h==-1 )
199
  if( h==-1 )
200
    {
200
    {
Lines 219-225 Link Here
219
219
220
  close( h );
220
  close( h );
221
221
222
  h=open( file2, O_BINARY| O_RDONLY );
222
  h = open_data_file(file2, O_BINARY| O_RDONLY);
223
  strcpy(load_tab2, file2);
223
  strcpy(load_tab2, file2);
224
  if( h==-1 )
224
  if( h==-1 )
225
    {
225
    {
(-)cuneiform_src/Kern/exc/CMakeLists.txt (-1 / +3 lines)
Lines 11-14 Link Here
11
src/v0compmn.c
11
src/v0compmn.c
12
)
12
)
13
13
14
target_link_libraries(exc loc ccom evn32)
14
target_link_libraries(exc loc ccom evn32)
15
16
install(TARGETS exc LIBRARY DESTINATION lib)
(-)cuneiform_src/Kern/fon/CMakeLists.txt (-1 / +3 lines)
Lines 16-19 Link Here
16
src/utilctb.c
16
src/utilctb.c
17
)
17
)
18
18
19
target_link_libraries(fon cstr ctb32)
19
target_link_libraries(fon cstr ctb32)
20
21
install(TARGETS fon LIBRARY DESTINATION lib)
(-)cuneiform_src/Kern/include/winfuncs.h (+7 lines)
Lines 186-189 Link Here
186
  int nLeftRect, int nTopRect, int nRightRect, int nBottomRect);
186
  int nLeftRect, int nTopRect, int nRightRect, int nBottomRect);
187
char* _strupr(char*s);
187
char* _strupr(char*s);
188
188
189
/* These are not windows compat functions, but general helper functions.
190
 * I had no other place to put it.
191
 */
192
193
int open_data_file(const char *basename, int mode);
194
int data_file_exists(const char *basename);
195
189
#endif
196
#endif
(-)cuneiform_src/Kern/leo/CMakeLists.txt (+2 lines)
Lines 23-25 Link Here
23
r35
23
r35
24
std32
24
std32
25
)
25
)
26
27
install(TARGETS leo LIBRARY DESTINATION lib)
(-)cuneiform_src/Kern/lns32/CMakeLists.txt (-1 / +3 lines)
Lines 25-28 Link Here
25
src/tgreader.cpp
25
src/tgreader.cpp
26
)
26
)
27
27
28
target_link_libraries(lns32 cline std32 windummy)
28
target_link_libraries(lns32 cline std32 windummy)
29
30
install(TARGETS lns32 LIBRARY DESTINATION lib)
(-)cuneiform_src/Kern/loc/CMakeLists.txt (-1 / +3 lines)
Lines 8-11 Link Here
8
src/v0compgl.c
8
src/v0compgl.c
9
)
9
)
10
10
11
target_link_libraries(loc windummy)
11
target_link_libraries(loc windummy)
12
13
install(TARGETS loc LIBRARY DESTINATION lib)
(-)cuneiform_src/Kern/mmx/CMakeLists.txt (-1 / +3 lines)
Lines 6-9 Link Here
6
src/mmx_net.c
6
src/mmx_net.c
7
src/mmx_r35.c
7
src/mmx_r35.c
8
src/mmxmain.c
8
src/mmxmain.c
9
)
9
)
10
11
install(TARGETS mmx LIBRARY DESTINATION lib)
(-)cuneiform_src/Kern/msk/CMakeLists.txt (-1 / +3 lines)
Lines 2-5 Link Here
2
2
3
add_library(msk ${LIBTYPE} src/msk.c)
3
add_library(msk ${LIBTYPE} src/msk.c)
4
4
5
target_link_libraries(msk mmx)
5
target_link_libraries(msk mmx windummy)
6
7
install(TARGETS msk LIBRARY DESTINATION lib)
(-)cuneiform_src/Kern/msk/src/msk.c (-1 / +1 lines)
Lines 647-653 Link Here
647
647
648
	initiated++;
648
	initiated++;
649
	Hnd_abc_n[initiated]=0;
649
	Hnd_abc_n[initiated]=0;
650
	if( (hnd=open(NameFile,O_RDONLY|O_BINARY))> 0 )
650
	if((hnd = open_data_file(NameFile, O_RDONLY|O_BINARY)) > 0)
651
	{	read(hnd,NameTab,32*sizeof(char));
651
	{	read(hnd,NameTab,32*sizeof(char));
652
		read(hnd,(Word16 *)&Hnd_abc_n[initiated],sizeof(short));
652
		read(hnd,(Word16 *)&Hnd_abc_n[initiated],sizeof(short));
653
		read(hnd,(Word16 *)&num_mask,sizeof(short));
653
		read(hnd,(Word16 *)&num_mask,sizeof(short));
(-)cuneiform_src/Kern/pass2/CMakeLists.txt (-1 / +3 lines)
Lines 8-11 Link Here
8
src/p2_tools.c
8
src/p2_tools.c
9
)
9
)
10
10
11
target_link_libraries(pass2 cstr fon std32)
11
target_link_libraries(pass2 cstr fon std32)
12
13
install(TARGETS pass2 LIBRARY DESTINATION lib)
(-)cuneiform_src/Kern/puma/CMakeLists.txt (-1 / +2 lines)
Lines 34-37 Link Here
34
rreccom
34
rreccom
35
rpstr
35
rpstr
36
)
36
)
37
    
37
38
install(TARGETS puma LIBRARY DESTINATION lib)
(-)cuneiform_src/Kern/puma/c/initdone.cpp (-4 / +1 lines)
Lines 189-198 Link Here
189
	}
189
	}
190
	else
190
	else
191
	{
191
	{
192
		char szRec6AllFilename[260];
192
		if(!ROUT_LoadRec6List("rec6all.dat"))
193
		//strcpy(szRec6AllFilename,GetModulePath()); JussiP: disabled this old path function thingy.
194
		strcpy(szRec6AllFilename,"rec6all.dat");
195
		if(!ROUT_LoadRec6List(szRec6AllFilename))
196
		{
193
		{
197
			SetReturnCode_puma(ROUT_GetReturnCode());
194
			SetReturnCode_puma(ROUT_GetReturnCode());
198
			goto lError;
195
			goto lError;
(-)cuneiform_src/Kern/r35/CMakeLists.txt (-1 / +3 lines)
Lines 1-4 Link Here
1
add_library(r35 ${LIBTYPE}
1
add_library(r35 ${LIBTYPE}
2
src/r35.c)
2
src/r35.c)
3
3
4
target_link_libraries(r35 mmx std32 windummy)
4
target_link_libraries(r35 mmx std32 windummy)
5
6
install(TARGETS r35 LIBRARY DESTINATION lib)
(-)cuneiform_src/Kern/rbal/CMakeLists.txt (-1 / +3 lines)
Lines 11-14 Link Here
11
src/statsearchbl.cpp
11
src/statsearchbl.cpp
12
)
12
)
13
13
14
target_link_libraries(rbal cstr evn32)
14
target_link_libraries(rbal cstr evn32)
15
16
install(TARGETS rbal LIBRARY DESTINATION lib)
(-)cuneiform_src/Kern/rblock/CMakeLists.txt (-1 / +3 lines)
Lines 50-53 Link Here
50
sources/c/sevbreak.c
50
sources/c/sevbreak.c
51
)
51
)
52
52
53
target_link_libraries(rblock cpage loc exc cstr cline rstr)
53
target_link_libraries(rblock cpage loc exc cstr cline rstr)
54
55
install(TARGETS rblock LIBRARY DESTINATION lib)
(-)cuneiform_src/Kern/rcorrkegl/CMakeLists.txt (-1 / +3 lines)
Lines 7-10 Link Here
7
src/cpp/stdafx.cpp
7
src/cpp/stdafx.cpp
8
)
8
)
9
9
10
target_link_libraries(rcorrkegl cstr cpage)
10
target_link_libraries(rcorrkegl cstr cpage)
11
12
install(TARGETS rcorrkegl LIBRARY DESTINATION lib)
(-)cuneiform_src/Kern/rcutp/CMakeLists.txt (-1 / +3 lines)
Lines 10-13 Link Here
10
sources/main/rcutp_mainfunc.cpp
10
sources/main/rcutp_mainfunc.cpp
11
)
11
)
12
12
13
target_link_libraries(rcutp ccom windummy)
13
target_link_libraries(rcutp ccom windummy)
14
15
install(TARGETS rcutp LIBRARY DESTINATION lib)
(-)cuneiform_src/Kern/rdib/CMakeLists.txt (-1 / +3 lines)
Lines 1-3 Link Here
1
include_directories(BEFORE sources)
1
include_directories(BEFORE sources)
2
2
3
add_library(rdib ${LIBTYPE} sources/cpp/CTDIB.cpp)
3
add_library(rdib ${LIBTYPE} sources/cpp/CTDIB.cpp)
4
5
install(TARGETS rdib LIBRARY DESTINATION lib)
(-)cuneiform_src/Kern/rfrmt/CMakeLists.txt (-1 / +3 lines)
Lines 28-31 Link Here
28
rimage
28
rimage
29
cline
29
cline
30
cstr
30
cstr
31
)    
31
)
32
33
install(TARGETS rfrmt LIBRARY DESTINATION lib)
(-)cuneiform_src/Kern/rimage/CMakeLists.txt (-1 / +3 lines)
Lines 21-24 Link Here
21
cfio
21
cfio
22
cimage
22
cimage
23
rdib
23
rdib
24
)
24
)
25
26
install(TARGETS rimage LIBRARY DESTINATION lib)
(-)cuneiform_src/Kern/rline/CMakeLists.txt (-1 / +3 lines)
Lines 12-15 Link Here
12
cpage
12
cpage
13
lns32
13
lns32
14
rshelllines
14
rshelllines
15
)    
15
)
16
17
install(TARGETS rline LIBRARY DESTINATION lib)
(-)cuneiform_src/Kern/rling/CMakeLists.txt (-1 / +3 lines)
Lines 38-41 Link Here
38
sources/c/udictuti.c
38
sources/c/udictuti.c
39
)
39
)
40
40
41
target_link_libraries(rling cstr rlings)
41
target_link_libraries(rling cstr rlings)
42
43
install(TARGETS rling LIBRARY DESTINATION lib)
(-)cuneiform_src/Kern/rling/sources/CMakeLists.txt (-1 / +3 lines)
Lines 32-35 Link Here
32
c/udictuti.c
32
c/udictuti.c
33
)
33
)
34
34
35
target_link_libraries(rlings cstr windummy)
35
target_link_libraries(rlings cstr windummy)
36
37
install(TARGETS rlings LIBRARY DESTINATION lib)
(-)cuneiform_src/Kern/rling/sources/c/rling_ma.c (-1 / +1 lines)
Lines 313-319 Link Here
313
        {
313
        {
314
                if (file_handle[fn]==-1)
314
                if (file_handle[fn]==-1)
315
                {
315
                {
316
                        i = open (Wname, Type, SubType);
316
                        i = open_data_file(Name, Type); /*, SubType); */
317
317
318
                        if (i < 0)
318
                        if (i < 0)
319
                                return -1;
319
                                return -1;
(-)cuneiform_src/Kern/rmarker/CMakeLists.txt (-1 / +3 lines)
Lines 23-26 Link Here
23
rneg
23
rneg
24
rpic
24
rpic
25
rselstr
25
rselstr
26
)
26
)
27
28
install(TARGETS rmarker LIBRARY DESTINATION lib)
(-)cuneiform_src/Kern/rneg/CMakeLists.txt (-1 / +3 lines)
Lines 18-21 Link Here
18
rselstr
18
rselstr
19
exc
19
exc
20
rstr
20
rstr
21
)
21
)
22
23
install(TARGETS rneg LIBRARY DESTINATION lib)
(-)cuneiform_src/Kern/rout/CMakeLists.txt (-1 / +3 lines)
Lines 14-17 Link Here
14
src/words.cpp
14
src/words.cpp
15
)
15
)
16
16
17
target_link_libraries(rout ced cfio)
17
target_link_libraries(rout ced cfio)
18
19
install(TARGETS rout LIBRARY DESTINATION lib)
(-)cuneiform_src/Kern/rout/src/rout.cpp (-15 / +14 lines)
Lines 65-70 Link Here
65
// By Eugene Pliskin pliskin@cs.isa.ac.ru
65
// By Eugene Pliskin pliskin@cs.isa.ac.ru
66
//********************************************************************
66
//********************************************************************
67
67
68
#include <fcntl.h>
68
#include <string.h>
69
#include <string.h>
69
#include "stdafx.h"
70
#include "stdafx.h"
70
#include "rout_own.h"
71
#include "rout_own.h"
Lines 895-912 Link Here
895
896
896
	ClearError();
897
	ClearError();
897
898
898
	// Ñïèñîê ôàéëîâ èç rec6all.dat
899
	char drive[_MAX_DRIVE],dir[_MAX_PATH],
900
		 name[_MAX_PATH],ext[_MAX_EXT];
901
902
	// Ðàçëîæèòü ïóòü íà ñîñòàâëÿþùèå
903
	_splitpath(rec6AllFilename,drive,dir,name,ext);
904
905
	// Îòêðûòü ôàéë ñî ñïèñêîì òàáëèö
899
	// Îòêðûòü ôàéë ñî ñïèñêîì òàáëèö
906
	FILE *f = NULL;
900
	FILE *f = NULL;
907
	char buf[256] = "";
901
	char buf[256] = "";
902
	int fd;
908
903
909
	f = fopen(rec6AllFilename,"rt");
904
	fd = open_data_file(rec6AllFilename, O_RDONLY); // Was "rt".
905
	if(fd == -1) {
906
	    ERR_LOAD_REC6LIST;
907
	    return FALSE;
908
	}
909
	f = fdopen(fd, "rt");
910
	if (!f)
910
	if (!f)
911
		{
911
		{
912
		ERR_LOAD_REC6LIST;
912
		ERR_LOAD_REC6LIST;
Lines 917-923 Link Here
917
		{
917
		{
918
		long language=-1;
918
		long language=-1;
919
		char theName[_MAX_PATH] = "";
919
		char theName[_MAX_PATH] = "";
920
		char rec6xxxFilename[_MAX_PATH] = "";
921
920
922
		// Ïóñòûå ñòðîêè è ñòðîêè êîììåíòàðèåâ,
921
		// Ïóñòûå ñòðîêè è ñòðîêè êîììåíòàðèåâ,
923
		// íà÷èíàþùèåñÿ ñ òî÷êè ñ çàïÿòîé, ïðîïóñêàòü
922
		// íà÷èíàþùèåñÿ ñ òî÷êè ñ çàïÿòîé, ïðîïóñêàòü
Lines 931-943 Link Here
931
		// Íîìåð ÿçûêà è èìÿ òàáëèöû rec6xxx.dat
931
		// Íîìåð ÿçûêà è èìÿ òàáëèöû rec6xxx.dat
932
		sscanf(buf,"%d%s", &language, &theName[0]);
932
		sscanf(buf,"%d%s", &language, &theName[0]);
933
933
934
		// Ïîëíûé ïóòü
935
		sprintf(rec6xxxFilename, "%s%s%s",
936
				drive,dir,theName);
937
938
		if (language <0 || language >= LANG_TOTAL ||
934
		if (language <0 || language >= LANG_TOTAL ||
939
			!theName[0] ||
935
			!theName[0] ||
940
			!LoadAlphabet(language,rec6xxxFilename)
936
			!LoadAlphabet(language, theName)
941
			)
937
			)
942
			{
938
			{
943
			fclose(f);
939
			fclose(f);
Lines 957-962 Link Here
957
{
952
{
958
// Çàãðóçêà ôàéëà REC6.DAT
953
// Çàãðóçêà ôàéëà REC6.DAT
959
	FILE *f = NULL;
954
	FILE *f = NULL;
955
	int fd;
960
	char buf[256] = "";
956
	char buf[256] = "";
961
#ifdef WIN32
957
#ifdef WIN32
962
	const char line_end = '\n';
958
	const char line_end = '\n';
Lines 968-974 Link Here
968
964
969
	long sizeAlphabet = 0;
965
	long sizeAlphabet = 0;
970
966
971
	f = fopen(rec6xxxFilename,"rt");
967
	fd = open_data_file(rec6xxxFilename, O_RDONLY);
968
	if(fd == -1)
969
	    return FALSE;
970
	f = fdopen(fd, "rt");
972
	if (!f)
971
	if (!f)
973
		return FALSE;
972
		return FALSE;
974
973
(-)cuneiform_src/Kern/rpic/CMakeLists.txt (-1 / +3 lines)
Lines 13-16 Link Here
13
sources/rpic.cpp
13
sources/rpic.cpp
14
)
14
)
15
15
16
target_link_libraries(rpic cpage ccom rstr)
16
target_link_libraries(rpic cpage ccom rstr)
17
18
install(TARGETS rpic LIBRARY DESTINATION lib)
(-)cuneiform_src/Kern/rpstr/CMakeLists.txt (-1 / +3 lines)
Lines 15-18 Link Here
15
rling
15
rling
16
rstr
16
rstr
17
std32
17
std32
18
)
18
)
19
20
install(TARGETS rpstr LIBRARY DESTINATION lib)
(-)cuneiform_src/Kern/rreccom/CMakeLists.txt (-1 / +3 lines)
Lines 6-9 Link Here
6
src/cpp/rreccom.cpp
6
src/cpp/rreccom.cpp
7
)
7
)
8
8
9
target_link_libraries(rreccom ccom evn32 windummy)
9
target_link_libraries(rreccom ccom evn32 windummy)
10
11
install(TARGETS rreccom LIBRARY DESTINATION lib)
(-)cuneiform_src/Kern/rreccom/src/cpp/alphabet.cpp (-17 / +17 lines)
Lines 696-717 Link Here
696
"rec2blt.dat",      // LANG_ESTONIAN	26
696
"rec2blt.dat",      // LANG_ESTONIAN	26
697
"rec2tur.dat"       // LANG_TURKISH		27
697
"rec2tur.dat"       // LANG_TURKISH		27
698
};
698
};
699
Bool16 rec_load_tables(Word8 language)
699
700
{
700
Bool16 rec_load_tables(Word8 language) {
701
if( language>=LANG_TOTAL )
701
    if (language >= LANG_TOTAL)
702
    return FALSE;
702
        return FALSE;
703
if( !EVNInitLanguage( tabevn1[language], tabevn2[language], language) )
703
    if (!EVNInitLanguage(tabevn1[language], tabevn2[language], language))
704
    return FALSE;
704
        return FALSE;
705
return TRUE;
705
    return TRUE;
706
}
706
}
707
Bool16    rec_is_language(Word8 language)
707
708
{
708
Bool16 rec_is_language(Word8 language) {
709
if( language<LANG_ENGLISH || language>=LANG_TOTAL )
709
    if (language < LANG_ENGLISH || language >= LANG_TOTAL)
710
    return FALSE;
710
        return FALSE;
711
if( _access(tabevn1[language],0)==-1 )
711
    if (data_file_exists(tabevn1[language]) == -1)
712
    return FALSE;
712
        return FALSE;
713
if( _access(tabevn2[language],0)==-1 )
713
    if (data_file_exists(tabevn2[language]) == -1)
714
    return FALSE;
714
        return FALSE;
715
715
716
return TRUE;
716
    return TRUE;
717
}
717
}
(-)cuneiform_src/Kern/rsadd/CMakeLists.txt (-1 / +3 lines)
Lines 2-5 Link Here
2
2
3
add_library(rsadd ${LIBTYPE} src/rsadd.c)
3
add_library(rsadd ${LIBTYPE} src/rsadd.c)
4
4
5
target_link_libraries(rsadd cstr)
5
target_link_libraries(rsadd cstr)
6
7
install(TARGETS rsadd LIBRARY DESTINATION lib)
(-)cuneiform_src/Kern/rselstr/CMakeLists.txt (-1 / +3 lines)
Lines 50-53 Link Here
50
cline
50
cline
51
cstr
51
cstr
52
rcutp
52
rcutp
53
)
53
)
54
55
install(TARGETS rselstr LIBRARY DESTINATION lib)
(-)cuneiform_src/Kern/rshelllines/CMakeLists.txt (-1 / +3 lines)
Lines 15-18 Link Here
15
cimage
15
cimage
16
cpage
16
cpage
17
rverline
17
rverline
18
)
18
)
19
20
install(TARGETS rshelllines LIBRARY DESTINATION lib)
(-)cuneiform_src/Kern/rstr/CMakeLists.txt (-1 / +3 lines)
Lines 105-108 Link Here
105
rsadd
105
rsadd
106
std32
106
std32
107
leo
107
leo
108
)
108
)
109
110
install(TARGETS rstr LIBRARY DESTINATION lib)
(-)cuneiform_src/Kern/rstr/src/rcm.c (-9 / +11 lines)
Lines 89-94 Link Here
89
//#include "LineDefs.h"
89
//#include "LineDefs.h"
90
#include "cline.h"
90
#include "cline.h"
91
91
92
#include "compat_defs.h"
93
92
#define LOCAL_GREY_CTB "page6666"
94
#define LOCAL_GREY_CTB "page6666"
93
#define LOCAL_CTB_NAME "ct666666"
95
#define LOCAL_CTB_NAME "ct666666"
94
unsigned char    alpha_used_mode=0;
96
unsigned char    alpha_used_mode=0;
Lines 401-407 Link Here
401
#define O_BINARY 0
403
#define O_BINARY 0
402
#endif
404
#endif
403
405
404
 h=open (tab3x5[lang],O_RDONLY|O_BINARY);
406
 h=open_data_file(tab3x5[lang], O_RDONLY|O_BINARY);
405
 if (h==-1)
407
 if (h==-1)
406
        {
408
        {
407
        return FALSE;
409
        return FALSE;
Lines 461-476 Link Here
461
463
462
RSTR_FUNC(Bool32) RSTR_IsLanguage(Word8 language)
464
RSTR_FUNC(Bool32) RSTR_IsLanguage(Word8 language)
463
{
465
{
464
if( language<LANG_ENGLISH || language>=LANG_TOTAL )
466
if(language<LANG_ENGLISH || language>=LANG_TOTAL )
465
    return FALSE;
467
    return FALSE;
466
chdir(lnOcrPath);
468
chdir(lnOcrPath);
467
if( _access(tabevn1[language],0)==-1 )
469
if(data_file_exists(tabevn1[language])==-1 )
468
    return FALSE;
470
    return FALSE;
469
if( _access(tabevn2[language],0)==-1 )
471
if(data_file_exists(tabevn2[language])==-1 )
470
    return FALSE;
472
    return FALSE;
471
if( _access(tab3x5[language],0)==-1 )
473
if(data_file_exists(tab3x5[language])==-1 )
472
    return FALSE;
474
    return FALSE;
473
if( language==LANG_RUSSIAN || language==LANG_RUSENG )
475
if(language==LANG_RUSSIAN || language==LANG_RUSENG )
474
    {
476
    {
475
    if( 0 )
477
    if( 0 )
476
        return FALSE;
478
        return FALSE;
(-)cuneiform_src/Kern/rstuff/CMakeLists.txt (-1 / +3 lines)
Lines 36-39 Link Here
36
smetric
36
smetric
37
rreccom
37
rreccom
38
exc
38
exc
39
)
39
)
40
41
install(TARGETS rstuff LIBRARY DESTINATION lib)
(-)cuneiform_src/Kern/rverline/CMakeLists.txt (-1 / +3 lines)
Lines 18-21 Link Here
18
cpage
18
cpage
19
cline
19
cline
20
ccom
20
ccom
21
)
21
)
22
23
install(TARGETS rverline LIBRARY DESTINATION lib)
(-)cuneiform_src/Kern/smetric/CMakeLists.txt (-1 / +3 lines)
Lines 11-14 Link Here
11
../usage/un_buff.cpp
11
../usage/un_buff.cpp
12
)
12
)
13
13
14
target_link_libraries(smetric windummy)
14
target_link_libraries(smetric windummy)
15
16
install(TARGETS smetric LIBRARY DESTINATION lib)
(-)cuneiform_src/Kern/std/CMakeLists.txt (-1 / +3 lines)
Lines 18-21 Link Here
18
src/stdwapi.cpp
18
src/stdwapi.cpp
19
)
19
)
20
20
21
target_link_libraries(std32 windummy)
21
target_link_libraries(std32 windummy)
22
23
install(TARGETS std32 LIBRARY DESTINATION lib)
(-)cuneiform_src/Kern/windummy.c (+67 lines)
Lines 43-48 Link Here
43
43
44
44
45
#include "compat_defs.h"
45
#include "compat_defs.h"
46
#include "config.h"
46
47
47
int HFILE_ERROR;
48
int HFILE_ERROR;
48
49
Lines 525-527 Link Here
525
char* _strupr(char*s) {
526
char* _strupr(char*s) {
526
  return s;
527
  return s;
527
}
528
}
529
530
/* General helper functions. */
531
532
/* We try to locate data files in two locations:
533
 *
534
 * 1. At the directory pointed to by environment variable CF_DATADIR
535
 * 2. At install prefix.
536
 *
537
 * Caller's responsibility is to ensure *e1 and *e2 are large enough.
538
 *
539
 * Porting note: on Windows it probably makes sense to use the function
540
 * that tells the current code module's path and go from there.
541
 *
542
 * The same probably goes for OS X, if you want to go the GUI route.
543
 *
544
 */
545
546
static void build_name_estimates(const char *base_name, char *env_name, char *prefix_name) {
547
    const char *separator = "/"; /* Change to backslash on Windows. */
548
    const char *env_prefix;
549
    const char *varname = "CF_DATADIR";
550
    int len = 0;
551
552
    env_name[0] = '\0';
553
    prefix_name[0] = '\0';
554
555
    env_prefix = getenv(varname);
556
    if(env_prefix)
557
        len = strlen(env_prefix);
558
    if(len > 0) {
559
        strcat(env_name, env_prefix);
560
        if(strcmp(env_prefix + len-1, separator) != 0) {
561
            strcat(env_name, separator);
562
        }
563
        strcat(env_name, base_name);
564
    }
565
566
    len = strlen(INSTALL_DATADIR);
567
    if(len > 0) {
568
        strcat(prefix_name, INSTALL_DATADIR);
569
        strcat(prefix_name, separator);
570
        strcat(prefix_name, base_name);
571
    }
572
}
573
574
int open_data_file(const char *basename, int mode) {
575
    char ename[1024];
576
    char pname[1024];
577
    int i;
578
579
    build_name_estimates(basename, ename, pname);
580
    i = open(ename, mode);
581
    if(i != -1)
582
        return i;
583
    return open(pname, mode);
584
}
585
586
int data_file_exists(const char *basename) {
587
    char ename[1024];
588
    char pname[1024];
589
590
    build_name_estimates(basename, ename, pname);
591
    if(_access(ename, 0) == 0)
592
        return 0;
593
    return _access(pname, 0);
594
}
(-)datafiles/CMakeLists.txt (-1 / +1 lines)
Lines 3-7 Link Here
3
file(GLOB datfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.dat)
3
file(GLOB datfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.dat)
4
4
5
foreach(i ${datfiles})
5
foreach(i ${datfiles})
6
    configure_file(${CMAKE_CURRENT_SOURCE_DIR}/${i} ${PROJECT_BINARY_DIR} COPYONLY)
6
    install(FILES ${i} DESTINATION ${RELATIVE_DATADIR}) 
7
endforeach()
7
endforeach()
(-)readme.txt (-6 / +15 lines)
Lines 34-46 Link Here
34
cd builddir
34
cd builddir
35
cmake -DCMAKE_BUILD_TYPE=debug ..
35
cmake -DCMAKE_BUILD_TYPE=debug ..
36
make
36
make
37
37
make install 
38
39
By default Cuneiform installs to /usr/local. You can specify a different prefix
40
by giving a command line switch "-DCMAKE_INSTALL_PREFIX=/what/ever/you/want"
41
to CMake.
42
43
If you have ImageMagick++ on your system, Cuneiform autodetects and builds
44
against it. Then Cuneiform can process any image that ImageMagick knows how
45
to open. Otherwise it can only read uncompressed BMP images.
38
46
39
Running
47
Running
40
48
41
You MUST be in the root of the build directory. Then just do
49
After install you simply run.
42
50
43
./cuneiform [-l language -o result_file] <image_file>
51
cuneiform [-l language -o result_file] <image_file>
44
52
45
Output is written to pumaout.txt. Cuneiform assumes that your image contains
53
Output is written to pumaout.txt. Cuneiform assumes that your image contains
46
only a single column of text.
54
only a single column of text.
Lines 52-60 Link Here
52
If you do not define an output file with the -o switch, Cuneiform
60
If you do not define an output file with the -o switch, Cuneiform
53
writes the result to a file "cuneiform-out.txt".
61
writes the result to a file "cuneiform-out.txt".
54
62
55
If you have ImageMagick++ on your system, Cuneiform autodetects and builds
63
If you want to run Cuneiform without installing it on your system, you
56
against it. Then Cuneiform can process any image that ImageMagick knows how
64
have to point the CF_DATADIR environment variable to a directory
57
to open. Otherwise it can only read uncompressed BMP images.
65
containing the .dat files. These can be found in the "datafiles"
66
directory of the source package.
58
67
59
Contact information
68
Contact information
60
69

Return to bug 234824