tesseract  4.0.0-1-g2a2b
structures.h
Go to the documentation of this file.
1 /* -*-C-*-
2  ********************************************************************************
3  *
4  * File: structures.h
5  * Description: Allocate all the different types of structures.
6  * Author: Mark Seaman, OCR Technology
7  *
8  * (c) Copyright 1990, Hewlett-Packard Company.
9  ** Licensed under the Apache License, Version 2.0 (the "License");
10  ** you may not use this file except in compliance with the License.
11  ** You may obtain a copy of the License at
12  ** http://www.apache.org/licenses/LICENSE-2.0
13  ** Unless required by applicable law or agreed to in writing, software
14  ** distributed under the License is distributed on an "AS IS" BASIS,
15  ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  ** See the License for the specific language governing permissions and
17  ** limitations under the License.
18  *
19  *********************************************************************************/
20 #ifndef STRUCTURES_H
21 #define STRUCTURES_H
22 
23 /*----------------------------------------------------------------------
24  I n c l u d e s
25 ----------------------------------------------------------------------*/
26 #include "oldlist.h"
27 
28 /*----------------------------------------------------------------------
29  M a c r o s
30 ----------------------------------------------------------------------*/
31 /**********************************************************************
32  * makestructure
33  *
34  * Allocate a chunk of memory for a particular data type. This macro
35  * defines an allocation, deallocation, and status printing function
36  * for each new data type.
37  **********************************************************************/
38 
39 #define makestructure(newfunc, old, type) \
40  type* newfunc() { return new type; } \
41  \
42  void old(type* deadelement) { delete deadelement; }
43 
44 /*----------------------------------------------------------------------
45  F u n c t i o n s
46 ----------------------------------------------------------------------*/
47 extern LIST new_cell();
48 extern void free_cell(LIST);
49 #endif
void free_cell(LIST)
LIST new_cell()