Tesseract  3.02
tesseract-ocr/cutil/structures.h
Go to the documentation of this file.
00001 /* -*-C-*-
00002  ********************************************************************************
00003  *
00004  * File:        structures.h  (Formerly structures.h)
00005  * Description:  Allocate all the different types of structures.
00006  * Author:       Mark Seaman, OCR Technology
00007  * Created:      Wed May 30 10:12:12 1990
00008  * Modified:     Tue May 21 11:07:47 1991 (Mark Seaman) marks@hpgrlt
00009  * Language:     C
00010  * Package:      N/A
00011  * Status:       Experimental (Do Not Distribute)
00012  *
00013  * (c) Copyright 1990, Hewlett-Packard Company.
00014  ** Licensed under the Apache License, Version 2.0 (the "License");
00015  ** you may not use this file except in compliance with the License.
00016  ** You may obtain a copy of the License at
00017  ** http://www.apache.org/licenses/LICENSE-2.0
00018  ** Unless required by applicable law or agreed to in writing, software
00019  ** distributed under the License is distributed on an "AS IS" BASIS,
00020  ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00021  ** See the License for the specific language governing permissions and
00022  ** limitations under the License.
00023  *
00024  *********************************************************************************/
00025 #ifndef STRUCTURES_H
00026 #define STRUCTURES_H
00027 
00028 /*----------------------------------------------------------------------
00029               I n c l u d e s
00030 ----------------------------------------------------------------------*/
00031 #include "oldlist.h"
00032 #include "freelist.h"
00033 #include "danerror.h"
00034 
00035 /*----------------------------------------------------------------------
00036               M a c r o s
00037 ----------------------------------------------------------------------*/
00038 /**********************************************************************
00039  * makestructure
00040  *
00041  * Allocate a chunk of memory for a particular data type.  This macro
00042  * defines an allocation, deallocation, and status printing function
00043  * for each new data type.
00044  **********************************************************************/
00045 
00046 #define makestructure(newfunc, old, type)                \
00047 type *newfunc()                                                                  \
00048 {                                                                            \
00049         return new type; \
00050 }                                                                            \
00051                                                                                                                                                                                                         \
00052                                                                                                                                                                                                         \
00053                                                                                                                                                                                                         \
00054 void old(type* deadelement)                                                       \
00055 {                                                                            \
00056         delete deadelement; \
00057 }                                                                            \
00058 
00059 /*----------------------------------------------------------------------
00060               F u n c t i o n s
00061 ----------------------------------------------------------------------*/
00062 extern LIST new_cell();
00063 extern void free_cell(LIST);
00064 #endif