File: common-cpp.ads

package info (click to toggle)
libtexttools 2.0.3-4
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 1,188 kB
  • ctags: 635
  • sloc: ada: 13,120; cpp: 1,679; ansic: 777; makefile: 156; sh: 2
file content (215 lines) | stat: -rw-r--r-- 10,892 bytes parent folder | download | duplicates (2)
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
------------------------------------------------------------------------------
-- COMMON (C++ Interface)                                                   --
--                                                                          --
-- Part of TextTools                                                        --
-- Designed and Programmed by Ken O. Burtch                                 --
--                                                                          --
------------------------------------------------------------------------------
--                                                                          --
--                 Copyright (C) 1999-2003 Ken O. Burtch                    --
--                                                                          --
-- This is free software;  you can  redistribute it  and/or modify it under --
-- terms of the  GNU General Public License as published  by the Free Soft- --
-- ware  Foundation;  either version 2,  or (at your option) any later ver- --
-- sion.  This is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY;  without even the  implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License --
-- for  more details.  You should have  received  a copy of the GNU General --
-- Public License  distributed with this;  see file COPYING.  If not, write --
-- to  the Free Software Foundation,  59 Temple Place - Suite 330,  Boston, --
-- MA 02111-1307, USA.                                                      --
--                                                                          --
-- As a special exception,  if other files  instantiate  generics from this --
-- unit, or you link  this unit with other files  to produce an executable, --
-- this  unit  does not  by itself cause  the resulting  executable  to  be --
-- covered  by the  GNU  General  Public  License.  This exception does not --
-- however invalidate  any other reasons why  the executable file  might be --
-- covered by the  GNU Public License.                                      --
--                                                                          --
-- This is maintained at http://www.vaxxine.com/pegasoft                    --
--                                                                          --
------------------------------------------------------------------------------
--with Gen_List;
--  pragma Elaborate( Gen_List ); -- remind Ada to elaborate generics first
--with Ada; use Ada;
--with Ada.Strings; use Ada.Strings; -- overrides our "strings" package
--with Ada.Strings.Bounded;
--with Ada.Strings.Maps;
--
--with Interfaces.C;
--use  Interfaces.C;
-- C language support

package Common.CPP is

--type C_String is new char_array(0..255 );
-- C-style string for C language support

-- Str255 Bounded String: C++ wrapper functions

type Str255List_List is record
     list : Str255List.List;
end record;
pragma export( CPP, Str255List_List, "str255list_list" );

-- procedure Str255List_Init( TheList : in out Str255List_List );
-- pragma export( CPP, Str255List_Init, "str255list_init" );

procedure Str255List_GetAllocation( allocation : out Str255List.AListIndex );
pragma export( CPP, Str255List_GetAllocation, "str255list_get_allocation" );

function Str255List_MemoryLeak( allocation : in Str255List.AListIndex ) return boolean;
pragma export( CPP, Str255List_MemoryLeak, "str255list_memory_leak" );

procedure Str255List_Compact( TheList : in out Str255List_List );
pragma export( CPP, Str255List_Compact, "str255list_compact" );

procedure Str255List_Clear( TheList : in out Str255List_List );
pragma export( CPP, Str255List_Clear, "str255list_clear" );

procedure Str255List_Copy( FromList, ToList : in out Str255List_List );
pragma export( CPP, Str255List_Copy, "str255list_copy" );

procedure Str255List_Copy2( FromList, ToList1, ToList2 : in out Str255List_List );
pragma export( CPP, Str255List_Copy2, "str255list_copy2" );

procedure Str255List_Move( FromList, ToList : in out Str255List_List );
pragma export( CPP, Str255List_Move, "str255list_move" );

procedure Str255List_Swap( List1, List2 : in out Str255List_List );
pragma export( CPP, Str255List_Swap, "str255list_swap" );

procedure Str255List_Push( TheList : in out Str255List_List; NewData : Str255 );
pragma export( CPP, Str255List_Push, "str255list_push" );

procedure Str255List_Queue( TheList : in out Str255List_List ; Data : Str255 );
pragma export( CPP, Str255List_Queue, "str255list_queue" );

procedure Str255List_Insert( TheList : in out Str255List_List ; Data : Str255 );
pragma export( CPP, Str255List_Insert, "str255list_insert" );

procedure Str255List_Insert2( TheList : in out Str255List_List ; atIndex : Str255List.AListIndex; Data : Str255 );
pragma export( CPP, Str255List_Insert2, "str255list_insert2" );

procedure Str255List_Pull( TheList : in out Str255List_List ; data : in out Str255 );
pragma export( CPP, Str255List_Pull, "str255list_pull" );

procedure Str255List_Discard( TheList : in out Str255List_List );
pragma export( CPP, Str255List_discard, "str255list_discard" );

procedure Str255List_Cut( TheList : in out Str255List_List; atIndex : Str255List.AListIndex;
   data : in out Str255 );
pragma export( CPP, Str255List_cut, "str255list_cut" );

procedure Str255List_ClearItem( TheList : in out Str255List_List ; atIndex : Str255List.AListIndex );
pragma export( CPP, Str255List_clearitem, "str255list_clearitem" );

procedure Str255List_Replace( TheList : in out Str255List_List; atIndex : Str255List.AListIndex; data : Str255 );
pragma export( CPP, Str255List_replace, "str255list_replace" );

procedure Str255List_Find( TheList : in out Str255List_List ; atIndex : Str255List.AListIndex ;
          data : in out Str255 );
pragma export( CPP, Str255List_find, "str255list_find" );

procedure Str255List_Lookup( TheList : in out Str255List_List ; data : Str255;
          start : Str255List.AListIndex; FoundAt : in out Str255List.AListIndex );
pragma export( CPP, Str255List_lookup, "str255list_lookup" );

function Str255List_Length( TheList : in Str255List_List ) return Str255List.AListIndex;
pragma export( CPP, Str255List_length, "str255list_length" );

function Str255List_IsEmpty( TheList : in Str255List_List ) return boolean;
pragma export( CPP, Str255List_IsEmpty, "str255list_is_empty" );

procedure Str255List_SubList( TheList : in out Str255List_List; index, len : Str255List.AListIndex; Result : in out Str255List_List );
pragma export( CPP, Str255List_SubList, "str255list_sublist" );

procedure Str255List_Concat( List1, List2 : Str255List_List; Result : in out Str255List_List );
pragma export( CPP, Str255List_Concat, "str255list_concat" );

--procedure Startup_Common( theProgramName, theShortProgramName : C_string );
--pragma export( C, Startup_Common, "startup_common" );


-- Boolean List: C++ wrapper functions

type BooleanList_List is record
     list : BooleanList.List;
end record;
pragma export( CPP, BooleanList_List, "booleanlist_list" );

-- procedure BooleanList_Init( TheList : in out BooleanList_List );
-- pragma export( CPP, BooleanList_Init, "booleanlist_init" );

procedure BooleanList_GetAllocation( allocation : out BooleanList.AListIndex );
pragma export( CPP, BooleanList_GetAllocation, "booleanlist_get_allocation" );

function BooleanList_MemoryLeak( allocation : in BooleanList.AListIndex ) return boolean;
pragma export( CPP, BooleanList_MemoryLeak, "booleanlist_memory_leak" );

procedure BooleanList_Compact( TheList : in out BooleanList_List );
pragma export( CPP, BooleanList_Compact, "booleanlist_compact" );

procedure BooleanList_Clear( TheList : in out BooleanList_List );
pragma export( CPP, BooleanList_Clear, "booleanlist_clear" );

procedure BooleanList_Copy( FromList, ToList : in out BooleanList_List );
pragma export( CPP, BooleanList_Copy, "booleanlist_copy" );

procedure BooleanList_Copy2( FromList, ToList1, ToList2 : in out BooleanList_List );
pragma export( CPP, BooleanList_Copy2, "booleanlist_copy2" );

procedure BooleanList_Move( FromList, ToList : in out BooleanList_List );
pragma export( CPP, BooleanList_Move, "booleanlist_move" );

procedure BooleanList_Swap( List1, List2 : in out BooleanList_List );
pragma export( CPP, BooleanList_Swap, "booleanlist_swap" );

procedure BooleanList_Push( TheList : in out BooleanList_List; NewData : boolean );
pragma export( CPP, BooleanList_Push, "booleanlist_push" );

procedure BooleanList_Queue( TheList : in out BooleanList_List ; Data : boolean );
pragma export( CPP, BooleanList_Queue, "booleanlist_queue" );

procedure BooleanList_Insert( TheList : in out BooleanList_List ; Data : boolean );
pragma export( CPP, BooleanList_Insert, "booleanlist_insert" );

procedure BooleanList_Insert2( TheList : in out BooleanList_List ; atIndex : BooleanList.AListIndex; Data : boolean );
pragma export( CPP, BooleanList_Insert2, "booleanlist_insert2" );

procedure BooleanList_Pull( TheList : in out BooleanList_List ; data : in out boolean );
pragma export( CPP, BooleanList_Pull, "booleanlist_pull" );

procedure BooleanList_Discard( TheList : in out BooleanList_List );
pragma export( CPP, BooleanList_discard, "booleanlist_discard" );

procedure BooleanList_Cut( TheList : in out BooleanList_List; atIndex : BooleanList.AListIndex; data : in out boolean );
pragma export( CPP, BooleanList_cut, "booleanlist_cut" );

procedure BooleanList_ClearItem( TheList : in out BooleanList_List ; atIndex : BooleanList.AListIndex );
pragma export( CPP, BooleanList_clearitem, "booleanlist_clearitem" );

procedure BooleanList_Replace( TheList : in out BooleanList_List; atIndex : BooleanList.AListIndex; data : boolean );
pragma export( CPP, BooleanList_replace, "booleanlist_replace" );

procedure BooleanList_Find( TheList : in out BooleanList_List ; atIndex : BooleanList.AListIndex ; data : in out boolean );
pragma export( CPP, BooleanList_find, "booleanlist_find" );

procedure BooleanList_Lookup( TheList : in out BooleanList_List ; data : boolean;
          start : BooleanList.AListIndex; FoundAt : in out BooleanList.AListIndex );
pragma export( CPP, BooleanList_lookup, "booleanlist_lookup" );

function BooleanList_Length( TheList : in BooleanList_List ) return BooleanList.AListIndex;
pragma export( CPP, BooleanList_length, "booleanlist_length" );

function BooleanList_IsEmpty( TheList : in BooleanList_List ) return boolean;
pragma export( CPP, BooleanList_IsEmpty, "booleanlist_is_empty" );

procedure BooleanList_SubList( TheList : in out BooleanList_List; index, len : BooleanList.AListIndex; Result : in out BooleanList_List );
pragma export( CPP, BooleanList_SubList, "booleanlist_sublist" );

procedure BooleanList_Concat( List1, List2 : BooleanList_List; Result : in out BooleanList_List );
pragma export( CPP, BooleanList_Concat, "booleanlist_concat" );

end Common.CPP;