mirror of
https://github.com/tesseract-ocr/tesseract.git
synced 2024-11-28 05:39:35 +08:00
Merge pull request #551 from amitdo/del-unused-listio
Remove unused code
This commit is contained in:
commit
0c7ada4e11
@ -7,7 +7,7 @@ endif
|
||||
|
||||
noinst_HEADERS = \
|
||||
bitvec.h callcpp.h const.h cutil.h cutil_class.h danerror.h efio.h \
|
||||
emalloc.h freelist.h globals.h listio.h \
|
||||
emalloc.h freelist.h globals.h \
|
||||
oldlist.h structures.h
|
||||
|
||||
if !USING_MULTIPLELIBS
|
||||
@ -22,7 +22,7 @@ endif
|
||||
|
||||
libtesseract_cutil_la_SOURCES = \
|
||||
bitvec.cpp callcpp.cpp cutil.cpp cutil_class.cpp danerror.cpp efio.cpp \
|
||||
emalloc.cpp freelist.cpp listio.cpp \
|
||||
emalloc.cpp freelist.cpp \
|
||||
oldlist.cpp structures.cpp
|
||||
|
||||
|
||||
|
@ -92,26 +92,6 @@ typedef void (*void_dest) (void *);
|
||||
#define print_string(str) \
|
||||
printf ("%s\n", str)
|
||||
|
||||
/**********************************************************************
|
||||
* strfree
|
||||
*
|
||||
* Free the memory which was reserved by strsave.
|
||||
**********************************************************************/
|
||||
|
||||
#define strfree(s) (free_string(s))
|
||||
|
||||
/**********************************************************************
|
||||
* strsave
|
||||
*
|
||||
* Reserve a spot in memory for the string to be stored. Copy the string
|
||||
* to it and return the result.
|
||||
**********************************************************************/
|
||||
|
||||
#define strsave(s) \
|
||||
((s) != NULL ? \
|
||||
((char*) strcpy (alloc_string(strlen(s)+1), s)) : \
|
||||
(NULL))
|
||||
|
||||
/*----------------------------------------------------------------------
|
||||
F u n c t i o n s
|
||||
----------------------------------------------------------------------*/
|
||||
|
@ -1,67 +0,0 @@
|
||||
/* -*-C-*-
|
||||
################################################################################
|
||||
#
|
||||
# File: listio.c
|
||||
# Description: List I/O processing procedures.
|
||||
# Author: Mark Seaman, Software Productivity
|
||||
# Created: Thu Jul 23 13:24:09 1987
|
||||
# Modified: Fri May 17 17:33:30 1991 (Mark Seaman) marks@hpgrlt
|
||||
# Language: C
|
||||
# Package: N/A
|
||||
# Status: Reusable Software Component
|
||||
#
|
||||
# (c) Copyright 1987, Hewlett-Packard Company.
|
||||
** Licensed under the Apache License, Version 2.0 (the "License");
|
||||
** you may not use this file except in compliance with the License.
|
||||
** You may obtain a copy of the License at
|
||||
** http://www.apache.org/licenses/LICENSE-2.0
|
||||
** Unless required by applicable law or agreed to in writing, software
|
||||
** distributed under the License is distributed on an "AS IS" BASIS,
|
||||
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
** See the License for the specific language governing permissions and
|
||||
** limitations under the License.
|
||||
#
|
||||
################################################################################
|
||||
|
||||
This file contains the implementations of a set of general purpose
|
||||
list I/O routines. For the interface definitions look in the file
|
||||
"listio.h".
|
||||
---------------------------------------------------------------------------*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include "listio.h"
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
Public Function Code
|
||||
---------------------------------------------------------------------------*/
|
||||
/*************************************************************************
|
||||
* R E A D L I S T
|
||||
*
|
||||
* Read a list of strings from a file. Return the string list to the
|
||||
* caller.
|
||||
*************************************************************************/
|
||||
LIST read_list(const char *filename) {
|
||||
FILE *infile;
|
||||
char s[CHARS_PER_LINE];
|
||||
LIST list;
|
||||
|
||||
if ((infile = open_file (filename, "r")) == NULL)
|
||||
return (NIL_LIST);
|
||||
|
||||
list = NIL_LIST;
|
||||
while (fgets (s, CHARS_PER_LINE, infile) != NULL) {
|
||||
s[CHARS_PER_LINE - 1] = '\0';
|
||||
if (strlen (s) > 0) {
|
||||
if (s[strlen (s) - 1] == '\n')
|
||||
s[strlen (s) - 1] = '\0';
|
||||
if (strlen (s) > 0) {
|
||||
list = push (list, (LIST) strsave (s));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fclose(infile);
|
||||
return (reverse_d (list));
|
||||
}
|
@ -1,43 +0,0 @@
|
||||
/* -*-C-*-
|
||||
################################################################################
|
||||
#
|
||||
# File: listio.h
|
||||
# Description: List I/O processing procedures.
|
||||
# Author: Mark Seaman, Software Productivity
|
||||
# Created: Thu Jul 23 13:24:09 1987
|
||||
# Modified: Mon Oct 16 11:38:52 1989 (Mark Seaman) marks@hpgrlt
|
||||
# Language: C
|
||||
# Package: N/A
|
||||
# Status: Reusable Software Component
|
||||
#
|
||||
# (c) Copyright 1987, Hewlett-Packard Company.
|
||||
** Licensed under the Apache License, Version 2.0 (the "License");
|
||||
** you may not use this file except in compliance with the License.
|
||||
** You may obtain a copy of the License at
|
||||
** http://www.apache.org/licenses/LICENSE-2.0
|
||||
** Unless required by applicable law or agreed to in writing, software
|
||||
** distributed under the License is distributed on an "AS IS" BASIS,
|
||||
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
** See the License for the specific language governing permissions and
|
||||
** limitations under the License.
|
||||
#
|
||||
################################################################################
|
||||
* Revision 1.5 89/06/27 11:56:00 11:56:00 marks (Mark Seaman)
|
||||
* Fixed MAC_OR_DOS bug
|
||||
*
|
||||
|
||||
This file contains the interface definitions to a set of general purpose
|
||||
list I/O routines.
|
||||
|
||||
***********************************************************************/
|
||||
#ifndef LISTIO_H
|
||||
#define LISTIO_H
|
||||
|
||||
#include <stdio.h>
|
||||
#include "oldlist.h"
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
Public Function Prototypes
|
||||
--------------------------------------------------------------------------*/
|
||||
LIST read_list(const char *filename);
|
||||
#endif
|
@ -448,7 +448,6 @@ copy "$(TargetDir)$(TargetName).lib" ..\..\..\lib
|
||||
<ClCompile Include="..\..\wordrec\language_model.cpp" />
|
||||
<ClCompile Include="..\..\textord\linefind.cpp" />
|
||||
<ClCompile Include="..\..\ccstruct\linlsq.cpp" />
|
||||
<ClCompile Include="..\..\cutil\listio.cpp" />
|
||||
<ClCompile Include="..\..\ccmain\ltrresultiterator.cpp" />
|
||||
<ClCompile Include="..\..\ccutil\mainblk.cpp" />
|
||||
<ClCompile Include="..\..\textord\makerow.cpp" />
|
||||
@ -716,7 +715,6 @@ copy "$(TargetDir)$(TargetName).lib" ..\..\..\lib
|
||||
<ClInclude Include="..\..\wordrec\language_model.h" />
|
||||
<ClInclude Include="..\..\textord\linefind.h" />
|
||||
<ClInclude Include="..\..\ccstruct\linlsq.h" />
|
||||
<ClInclude Include="..\..\cutil\listio.h" />
|
||||
<ClInclude Include="..\..\ccutil\lsterr.h" />
|
||||
<ClInclude Include="..\..\ccmain\ltrresultiterator.h" />
|
||||
<ClInclude Include="..\..\textord\makerow.h" />
|
||||
@ -867,4 +865,4 @@ copy "$(TargetDir)$(TargetName).lib" ..\..\..\lib
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
||||
</Project>
|
||||
|
@ -361,9 +361,6 @@
|
||||
<ClCompile Include="..\..\textord\linefind.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\cutil\listio.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\wordrec\lm_consistency.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
@ -1170,9 +1167,6 @@
|
||||
<ClInclude Include="..\..\ccstruct\linlsq.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\cutil\listio.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\wordrec\lm_consistency.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
@ -1610,4 +1604,4 @@
|
||||
<Filter>Resource Files</Filter>
|
||||
</ResourceCompile>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
</Project>
|
||||
|
Loading…
Reference in New Issue
Block a user