hexsha
stringlengths
40
40
size
int64
3
1.05M
ext
stringclasses
163 values
lang
stringclasses
53 values
max_stars_repo_path
stringlengths
3
945
max_stars_repo_name
stringlengths
4
112
max_stars_repo_head_hexsha
stringlengths
40
78
max_stars_repo_licenses
sequencelengths
1
10
max_stars_count
float64
1
191k
max_stars_repo_stars_event_min_datetime
stringlengths
24
24
max_stars_repo_stars_event_max_datetime
stringlengths
24
24
max_issues_repo_path
stringlengths
3
945
max_issues_repo_name
stringlengths
4
113
max_issues_repo_head_hexsha
stringlengths
40
78
max_issues_repo_licenses
sequencelengths
1
10
max_issues_count
float64
1
116k
max_issues_repo_issues_event_min_datetime
stringlengths
24
24
max_issues_repo_issues_event_max_datetime
stringlengths
24
24
max_forks_repo_path
stringlengths
3
945
max_forks_repo_name
stringlengths
4
113
max_forks_repo_head_hexsha
stringlengths
40
78
max_forks_repo_licenses
sequencelengths
1
10
max_forks_count
float64
1
105k
max_forks_repo_forks_event_min_datetime
stringlengths
24
24
max_forks_repo_forks_event_max_datetime
stringlengths
24
24
content
stringlengths
3
1.05M
avg_line_length
float64
1
966k
max_line_length
int64
1
977k
alphanum_fraction
float64
0
1
29a3c4287c68bbe868b59a9d9ba497a6b0703b97
2,940
ads
Ada
src/base/events/util-events-channels.ads
yrashk/ada-util
2aaa1d87e92a7137e1c63dce90f0722c549dfafd
[ "Apache-2.0" ]
60
2015-01-18T23:05:34.000Z
2022-03-20T18:56:30.000Z
src/base/events/util-events-channels.ads
yrashk/ada-util
2aaa1d87e92a7137e1c63dce90f0722c549dfafd
[ "Apache-2.0" ]
20
2016-09-15T16:41:30.000Z
2022-03-29T22:02:32.000Z
src/base/events/util-events-channels.ads
yrashk/ada-util
2aaa1d87e92a7137e1c63dce90f0722c549dfafd
[ "Apache-2.0" ]
10
2015-02-13T04:00:45.000Z
2022-03-20T18:57:54.000Z
----------------------------------------------------------------------- -- util-events-channel -- Event Channels -- Copyright (C) 2001, 2002, 2003, 2009, 2010, 2018 Stephane Carrez -- Written by Stephane Carrez ([email protected]) -- -- 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. ----------------------------------------------------------------------- with Ada.Strings.Unbounded; with Ada.Containers.Doubly_Linked_Lists; -- The <b>Util.Events.Channels</b> package implements a publish/subscribe event -- channel. It is inspired from Event pattern and CosEvent service. package Util.Events.Channels is type Subscriber is limited interface; type Subscriber_Access is access all Subscriber'Class; procedure Receive_Event (Sub : in out Subscriber; Item : in Event'Class) is abstract; ---------------------- -- Event Channel ---------------------- -- Channel on which events are pushed. type Channel is tagged limited private; type Channel_Access is access all Channel'Class; -- Get the name of this event channel. function Get_Name (C : Channel) return String; -- Post an event (may be asynchronous) procedure Post (To : in out Channel; Item : in Event'Class); -- Subscribe to events sent on the event channel. procedure Subscribe (To : in out Channel; Client : in Subscriber_Access); -- Unsubscribe to events sent on the event channel. procedure Unsubscribe (To : in out Channel; Client : in Subscriber_Access); type Channel_Creator is access function (Name : String) return Channel_Access; -- Create an event channel with the given name. The type of channel -- is controlled by <b>Kind</b>. function Create (Name : String; Kind : String) return Channel_Access; -- Create an event channel that post the event immediately. -- This is similar to calling <b>Create</b> with <b>"direct"</b> as kind. function Create_Direct_Channel (Name : String) return Channel_Access; private package Containers is new Ada.Containers.Doubly_Linked_Lists (Element_Type => Subscriber_Access); subtype List is Containers.List; type Channel is tagged limited record Name : Ada.Strings.Unbounded.Unbounded_String; Clients : List; end record; end Util.Events.Channels;
37.21519
80
0.647279
3db2d8e1a97ed5a582d5773c6f7623c46c691883
148,216
ads
Ada
include/gl.ads
docandrew/troodon
9240611708f92ffb5491fa677bffb6ecac58a51e
[ "MIT" ]
5
2021-11-03T04:34:16.000Z
2021-11-10T23:06:30.000Z
include/gl.ads
docandrew/troodon
9240611708f92ffb5491fa677bffb6ecac58a51e
[ "MIT" ]
null
null
null
include/gl.ads
docandrew/troodon
9240611708f92ffb5491fa677bffb6ecac58a51e
[ "MIT" ]
null
null
null
pragma Ada_2012; pragma Style_Checks (Off); with Interfaces.C; use Interfaces.C; with Interfaces.C.Strings; use Interfaces.C.Strings; with System; limited with glext; package gl is -- unsupported macro: GLAPI __attribute__((visibility("default"))) -- unsupported macro: APIENTRY GLAPIENTRY -- unsupported macro: APIENTRYP APIENTRY * -- unsupported macro: GLAPIENTRYP GLAPIENTRY * GL_VERSION_1_1 : constant := 1; -- gl.h:107 GL_VERSION_1_2 : constant := 1; -- gl.h:108 GL_VERSION_1_3 : constant := 1; -- gl.h:109 GL_ARB_imaging : constant := 1; -- gl.h:110 GL_FALSE : constant := 0; -- gl.h:139 GL_TRUE : constant := 1; -- gl.h:140 GL_BYTE : constant := 16#1400#; -- gl.h:143 GL_UNSIGNED_BYTE : constant := 16#1401#; -- gl.h:144 GL_SHORT : constant := 16#1402#; -- gl.h:145 GL_UNSIGNED_SHORT : constant := 16#1403#; -- gl.h:146 GL_INT : constant := 16#1404#; -- gl.h:147 GL_UNSIGNED_INT : constant := 16#1405#; -- gl.h:148 GL_FLOAT : constant := 16#1406#; -- gl.h:149 GL_2_BYTES : constant := 16#1407#; -- gl.h:150 GL_3_BYTES : constant := 16#1408#; -- gl.h:151 GL_4_BYTES : constant := 16#1409#; -- gl.h:152 GL_DOUBLE : constant := 16#140A#; -- gl.h:153 GL_POINTS : constant := 16#0000#; -- gl.h:156 GL_LINES : constant := 16#0001#; -- gl.h:157 GL_LINE_LOOP : constant := 16#0002#; -- gl.h:158 GL_LINE_STRIP : constant := 16#0003#; -- gl.h:159 GL_TRIANGLES : constant := 16#0004#; -- gl.h:160 GL_TRIANGLE_STRIP : constant := 16#0005#; -- gl.h:161 GL_TRIANGLE_FAN : constant := 16#0006#; -- gl.h:162 GL_QUADS : constant := 16#0007#; -- gl.h:163 GL_QUAD_STRIP : constant := 16#0008#; -- gl.h:164 GL_POLYGON : constant := 16#0009#; -- gl.h:165 GL_VERTEX_ARRAY : constant := 16#8074#; -- gl.h:168 GL_NORMAL_ARRAY : constant := 16#8075#; -- gl.h:169 GL_COLOR_ARRAY : constant := 16#8076#; -- gl.h:170 GL_INDEX_ARRAY : constant := 16#8077#; -- gl.h:171 GL_TEXTURE_COORD_ARRAY : constant := 16#8078#; -- gl.h:172 GL_EDGE_FLAG_ARRAY : constant := 16#8079#; -- gl.h:173 GL_VERTEX_ARRAY_SIZE : constant := 16#807A#; -- gl.h:174 GL_VERTEX_ARRAY_TYPE : constant := 16#807B#; -- gl.h:175 GL_VERTEX_ARRAY_STRIDE : constant := 16#807C#; -- gl.h:176 GL_NORMAL_ARRAY_TYPE : constant := 16#807E#; -- gl.h:177 GL_NORMAL_ARRAY_STRIDE : constant := 16#807F#; -- gl.h:178 GL_COLOR_ARRAY_SIZE : constant := 16#8081#; -- gl.h:179 GL_COLOR_ARRAY_TYPE : constant := 16#8082#; -- gl.h:180 GL_COLOR_ARRAY_STRIDE : constant := 16#8083#; -- gl.h:181 GL_INDEX_ARRAY_TYPE : constant := 16#8085#; -- gl.h:182 GL_INDEX_ARRAY_STRIDE : constant := 16#8086#; -- gl.h:183 GL_TEXTURE_COORD_ARRAY_SIZE : constant := 16#8088#; -- gl.h:184 GL_TEXTURE_COORD_ARRAY_TYPE : constant := 16#8089#; -- gl.h:185 GL_TEXTURE_COORD_ARRAY_STRIDE : constant := 16#808A#; -- gl.h:186 GL_EDGE_FLAG_ARRAY_STRIDE : constant := 16#808C#; -- gl.h:187 GL_VERTEX_ARRAY_POINTER : constant := 16#808E#; -- gl.h:188 GL_NORMAL_ARRAY_POINTER : constant := 16#808F#; -- gl.h:189 GL_COLOR_ARRAY_POINTER : constant := 16#8090#; -- gl.h:190 GL_INDEX_ARRAY_POINTER : constant := 16#8091#; -- gl.h:191 GL_TEXTURE_COORD_ARRAY_POINTER : constant := 16#8092#; -- gl.h:192 GL_EDGE_FLAG_ARRAY_POINTER : constant := 16#8093#; -- gl.h:193 GL_V2F : constant := 16#2A20#; -- gl.h:194 GL_V3F : constant := 16#2A21#; -- gl.h:195 GL_C4UB_V2F : constant := 16#2A22#; -- gl.h:196 GL_C4UB_V3F : constant := 16#2A23#; -- gl.h:197 GL_C3F_V3F : constant := 16#2A24#; -- gl.h:198 GL_N3F_V3F : constant := 16#2A25#; -- gl.h:199 GL_C4F_N3F_V3F : constant := 16#2A26#; -- gl.h:200 GL_T2F_V3F : constant := 16#2A27#; -- gl.h:201 GL_T4F_V4F : constant := 16#2A28#; -- gl.h:202 GL_T2F_C4UB_V3F : constant := 16#2A29#; -- gl.h:203 GL_T2F_C3F_V3F : constant := 16#2A2A#; -- gl.h:204 GL_T2F_N3F_V3F : constant := 16#2A2B#; -- gl.h:205 GL_T2F_C4F_N3F_V3F : constant := 16#2A2C#; -- gl.h:206 GL_T4F_C4F_N3F_V4F : constant := 16#2A2D#; -- gl.h:207 GL_MATRIX_MODE : constant := 16#0BA0#; -- gl.h:210 GL_MODELVIEW : constant := 16#1700#; -- gl.h:211 GL_PROJECTION : constant := 16#1701#; -- gl.h:212 GL_TEXTURE : constant := 16#1702#; -- gl.h:213 GL_POINT_SMOOTH : constant := 16#0B10#; -- gl.h:216 GL_POINT_SIZE : constant := 16#0B11#; -- gl.h:217 GL_POINT_SIZE_GRANULARITY : constant := 16#0B13#; -- gl.h:218 GL_POINT_SIZE_RANGE : constant := 16#0B12#; -- gl.h:219 GL_LINE_SMOOTH : constant := 16#0B20#; -- gl.h:222 GL_LINE_STIPPLE : constant := 16#0B24#; -- gl.h:223 GL_LINE_STIPPLE_PATTERN : constant := 16#0B25#; -- gl.h:224 GL_LINE_STIPPLE_REPEAT : constant := 16#0B26#; -- gl.h:225 GL_LINE_WIDTH : constant := 16#0B21#; -- gl.h:226 GL_LINE_WIDTH_GRANULARITY : constant := 16#0B23#; -- gl.h:227 GL_LINE_WIDTH_RANGE : constant := 16#0B22#; -- gl.h:228 GL_POINT : constant := 16#1B00#; -- gl.h:231 GL_LINE : constant := 16#1B01#; -- gl.h:232 GL_FILL : constant := 16#1B02#; -- gl.h:233 GL_CW : constant := 16#0900#; -- gl.h:234 GL_CCW : constant := 16#0901#; -- gl.h:235 GL_FRONT : constant := 16#0404#; -- gl.h:236 GL_BACK : constant := 16#0405#; -- gl.h:237 GL_POLYGON_MODE : constant := 16#0B40#; -- gl.h:238 GL_POLYGON_SMOOTH : constant := 16#0B41#; -- gl.h:239 GL_POLYGON_STIPPLE : constant := 16#0B42#; -- gl.h:240 GL_EDGE_FLAG : constant := 16#0B43#; -- gl.h:241 GL_CULL_FACE : constant := 16#0B44#; -- gl.h:242 GL_CULL_FACE_MODE : constant := 16#0B45#; -- gl.h:243 GL_FRONT_FACE : constant := 16#0B46#; -- gl.h:244 GL_POLYGON_OFFSET_FACTOR : constant := 16#8038#; -- gl.h:245 GL_POLYGON_OFFSET_UNITS : constant := 16#2A00#; -- gl.h:246 GL_POLYGON_OFFSET_POINT : constant := 16#2A01#; -- gl.h:247 GL_POLYGON_OFFSET_LINE : constant := 16#2A02#; -- gl.h:248 GL_POLYGON_OFFSET_FILL : constant := 16#8037#; -- gl.h:249 GL_COMPILE : constant := 16#1300#; -- gl.h:252 GL_COMPILE_AND_EXECUTE : constant := 16#1301#; -- gl.h:253 GL_LIST_BASE : constant := 16#0B32#; -- gl.h:254 GL_LIST_INDEX : constant := 16#0B33#; -- gl.h:255 GL_LIST_MODE : constant := 16#0B30#; -- gl.h:256 GL_NEVER : constant := 16#0200#; -- gl.h:259 GL_LESS : constant := 16#0201#; -- gl.h:260 GL_EQUAL : constant := 16#0202#; -- gl.h:261 GL_LEQUAL : constant := 16#0203#; -- gl.h:262 GL_GREATER : constant := 16#0204#; -- gl.h:263 GL_NOTEQUAL : constant := 16#0205#; -- gl.h:264 GL_GEQUAL : constant := 16#0206#; -- gl.h:265 GL_ALWAYS : constant := 16#0207#; -- gl.h:266 GL_DEPTH_TEST : constant := 16#0B71#; -- gl.h:267 GL_DEPTH_BITS : constant := 16#0D56#; -- gl.h:268 GL_DEPTH_CLEAR_VALUE : constant := 16#0B73#; -- gl.h:269 GL_DEPTH_FUNC : constant := 16#0B74#; -- gl.h:270 GL_DEPTH_RANGE : constant := 16#0B70#; -- gl.h:271 GL_DEPTH_WRITEMASK : constant := 16#0B72#; -- gl.h:272 GL_DEPTH_COMPONENT : constant := 16#1902#; -- gl.h:273 GL_LIGHTING : constant := 16#0B50#; -- gl.h:276 GL_LIGHT0 : constant := 16#4000#; -- gl.h:277 GL_LIGHT1 : constant := 16#4001#; -- gl.h:278 GL_LIGHT2 : constant := 16#4002#; -- gl.h:279 GL_LIGHT3 : constant := 16#4003#; -- gl.h:280 GL_LIGHT4 : constant := 16#4004#; -- gl.h:281 GL_LIGHT5 : constant := 16#4005#; -- gl.h:282 GL_LIGHT6 : constant := 16#4006#; -- gl.h:283 GL_LIGHT7 : constant := 16#4007#; -- gl.h:284 GL_SPOT_EXPONENT : constant := 16#1205#; -- gl.h:285 GL_SPOT_CUTOFF : constant := 16#1206#; -- gl.h:286 GL_CONSTANT_ATTENUATION : constant := 16#1207#; -- gl.h:287 GL_LINEAR_ATTENUATION : constant := 16#1208#; -- gl.h:288 GL_QUADRATIC_ATTENUATION : constant := 16#1209#; -- gl.h:289 GL_AMBIENT : constant := 16#1200#; -- gl.h:290 GL_DIFFUSE : constant := 16#1201#; -- gl.h:291 GL_SPECULAR : constant := 16#1202#; -- gl.h:292 GL_SHININESS : constant := 16#1601#; -- gl.h:293 GL_EMISSION : constant := 16#1600#; -- gl.h:294 GL_POSITION : constant := 16#1203#; -- gl.h:295 GL_SPOT_DIRECTION : constant := 16#1204#; -- gl.h:296 GL_AMBIENT_AND_DIFFUSE : constant := 16#1602#; -- gl.h:297 GL_COLOR_INDEXES : constant := 16#1603#; -- gl.h:298 GL_LIGHT_MODEL_TWO_SIDE : constant := 16#0B52#; -- gl.h:299 GL_LIGHT_MODEL_LOCAL_VIEWER : constant := 16#0B51#; -- gl.h:300 GL_LIGHT_MODEL_AMBIENT : constant := 16#0B53#; -- gl.h:301 GL_FRONT_AND_BACK : constant := 16#0408#; -- gl.h:302 GL_SHADE_MODEL : constant := 16#0B54#; -- gl.h:303 GL_FLAT : constant := 16#1D00#; -- gl.h:304 GL_SMOOTH : constant := 16#1D01#; -- gl.h:305 GL_COLOR_MATERIAL : constant := 16#0B57#; -- gl.h:306 GL_COLOR_MATERIAL_FACE : constant := 16#0B55#; -- gl.h:307 GL_COLOR_MATERIAL_PARAMETER : constant := 16#0B56#; -- gl.h:308 GL_NORMALIZE : constant := 16#0BA1#; -- gl.h:309 GL_CLIP_PLANE0 : constant := 16#3000#; -- gl.h:312 GL_CLIP_PLANE1 : constant := 16#3001#; -- gl.h:313 GL_CLIP_PLANE2 : constant := 16#3002#; -- gl.h:314 GL_CLIP_PLANE3 : constant := 16#3003#; -- gl.h:315 GL_CLIP_PLANE4 : constant := 16#3004#; -- gl.h:316 GL_CLIP_PLANE5 : constant := 16#3005#; -- gl.h:317 GL_ACCUM_RED_BITS : constant := 16#0D58#; -- gl.h:320 GL_ACCUM_GREEN_BITS : constant := 16#0D59#; -- gl.h:321 GL_ACCUM_BLUE_BITS : constant := 16#0D5A#; -- gl.h:322 GL_ACCUM_ALPHA_BITS : constant := 16#0D5B#; -- gl.h:323 GL_ACCUM_CLEAR_VALUE : constant := 16#0B80#; -- gl.h:324 GL_ACCUM : constant := 16#0100#; -- gl.h:325 GL_ADD : constant := 16#0104#; -- gl.h:326 GL_LOAD : constant := 16#0101#; -- gl.h:327 GL_MULT : constant := 16#0103#; -- gl.h:328 GL_RETURN : constant := 16#0102#; -- gl.h:329 GL_ALPHA_TEST : constant := 16#0BC0#; -- gl.h:332 GL_ALPHA_TEST_REF : constant := 16#0BC2#; -- gl.h:333 GL_ALPHA_TEST_FUNC : constant := 16#0BC1#; -- gl.h:334 GL_BLEND : constant := 16#0BE2#; -- gl.h:337 GL_BLEND_SRC : constant := 16#0BE1#; -- gl.h:338 GL_BLEND_DST : constant := 16#0BE0#; -- gl.h:339 GL_ZERO : constant := 0; -- gl.h:340 GL_ONE : constant := 1; -- gl.h:341 GL_SRC_COLOR : constant := 16#0300#; -- gl.h:342 GL_ONE_MINUS_SRC_COLOR : constant := 16#0301#; -- gl.h:343 GL_SRC_ALPHA : constant := 16#0302#; -- gl.h:344 GL_ONE_MINUS_SRC_ALPHA : constant := 16#0303#; -- gl.h:345 GL_DST_ALPHA : constant := 16#0304#; -- gl.h:346 GL_ONE_MINUS_DST_ALPHA : constant := 16#0305#; -- gl.h:347 GL_DST_COLOR : constant := 16#0306#; -- gl.h:348 GL_ONE_MINUS_DST_COLOR : constant := 16#0307#; -- gl.h:349 GL_SRC_ALPHA_SATURATE : constant := 16#0308#; -- gl.h:350 GL_FEEDBACK : constant := 16#1C01#; -- gl.h:353 GL_RENDER : constant := 16#1C00#; -- gl.h:354 GL_SELECT : constant := 16#1C02#; -- gl.h:355 GL_2D : constant := 16#0600#; -- gl.h:358 GL_3D : constant := 16#0601#; -- gl.h:359 GL_3D_COLOR : constant := 16#0602#; -- gl.h:360 GL_3D_COLOR_TEXTURE : constant := 16#0603#; -- gl.h:361 GL_4D_COLOR_TEXTURE : constant := 16#0604#; -- gl.h:362 GL_POINT_TOKEN : constant := 16#0701#; -- gl.h:363 GL_LINE_TOKEN : constant := 16#0702#; -- gl.h:364 GL_LINE_RESET_TOKEN : constant := 16#0707#; -- gl.h:365 GL_POLYGON_TOKEN : constant := 16#0703#; -- gl.h:366 GL_BITMAP_TOKEN : constant := 16#0704#; -- gl.h:367 GL_DRAW_PIXEL_TOKEN : constant := 16#0705#; -- gl.h:368 GL_COPY_PIXEL_TOKEN : constant := 16#0706#; -- gl.h:369 GL_PASS_THROUGH_TOKEN : constant := 16#0700#; -- gl.h:370 GL_FEEDBACK_BUFFER_POINTER : constant := 16#0DF0#; -- gl.h:371 GL_FEEDBACK_BUFFER_SIZE : constant := 16#0DF1#; -- gl.h:372 GL_FEEDBACK_BUFFER_TYPE : constant := 16#0DF2#; -- gl.h:373 GL_SELECTION_BUFFER_POINTER : constant := 16#0DF3#; -- gl.h:376 GL_SELECTION_BUFFER_SIZE : constant := 16#0DF4#; -- gl.h:377 GL_FOG : constant := 16#0B60#; -- gl.h:380 GL_FOG_MODE : constant := 16#0B65#; -- gl.h:381 GL_FOG_DENSITY : constant := 16#0B62#; -- gl.h:382 GL_FOG_COLOR : constant := 16#0B66#; -- gl.h:383 GL_FOG_INDEX : constant := 16#0B61#; -- gl.h:384 GL_FOG_START : constant := 16#0B63#; -- gl.h:385 GL_FOG_END : constant := 16#0B64#; -- gl.h:386 GL_LINEAR : constant := 16#2601#; -- gl.h:387 GL_EXP : constant := 16#0800#; -- gl.h:388 GL_EXP2 : constant := 16#0801#; -- gl.h:389 GL_LOGIC_OP : constant := 16#0BF1#; -- gl.h:392 GL_INDEX_LOGIC_OP : constant := 16#0BF1#; -- gl.h:393 GL_COLOR_LOGIC_OP : constant := 16#0BF2#; -- gl.h:394 GL_LOGIC_OP_MODE : constant := 16#0BF0#; -- gl.h:395 GL_CLEAR : constant := 16#1500#; -- gl.h:396 GL_SET : constant := 16#150F#; -- gl.h:397 GL_COPY : constant := 16#1503#; -- gl.h:398 GL_COPY_INVERTED : constant := 16#150C#; -- gl.h:399 GL_NOOP : constant := 16#1505#; -- gl.h:400 GL_INVERT : constant := 16#150A#; -- gl.h:401 GL_AND : constant := 16#1501#; -- gl.h:402 GL_NAND : constant := 16#150E#; -- gl.h:403 GL_OR : constant := 16#1507#; -- gl.h:404 GL_NOR : constant := 16#1508#; -- gl.h:405 GL_XOR : constant := 16#1506#; -- gl.h:406 GL_EQUIV : constant := 16#1509#; -- gl.h:407 GL_AND_REVERSE : constant := 16#1502#; -- gl.h:408 GL_AND_INVERTED : constant := 16#1504#; -- gl.h:409 GL_OR_REVERSE : constant := 16#150B#; -- gl.h:410 GL_OR_INVERTED : constant := 16#150D#; -- gl.h:411 GL_STENCIL_BITS : constant := 16#0D57#; -- gl.h:414 GL_STENCIL_TEST : constant := 16#0B90#; -- gl.h:415 GL_STENCIL_CLEAR_VALUE : constant := 16#0B91#; -- gl.h:416 GL_STENCIL_FUNC : constant := 16#0B92#; -- gl.h:417 GL_STENCIL_VALUE_MASK : constant := 16#0B93#; -- gl.h:418 GL_STENCIL_FAIL : constant := 16#0B94#; -- gl.h:419 GL_STENCIL_PASS_DEPTH_FAIL : constant := 16#0B95#; -- gl.h:420 GL_STENCIL_PASS_DEPTH_PASS : constant := 16#0B96#; -- gl.h:421 GL_STENCIL_REF : constant := 16#0B97#; -- gl.h:422 GL_STENCIL_WRITEMASK : constant := 16#0B98#; -- gl.h:423 GL_STENCIL_INDEX : constant := 16#1901#; -- gl.h:424 GL_KEEP : constant := 16#1E00#; -- gl.h:425 GL_REPLACE : constant := 16#1E01#; -- gl.h:426 GL_INCR : constant := 16#1E02#; -- gl.h:427 GL_DECR : constant := 16#1E03#; -- gl.h:428 GL_NONE : constant := 0; -- gl.h:431 GL_LEFT : constant := 16#0406#; -- gl.h:432 GL_RIGHT : constant := 16#0407#; -- gl.h:433 GL_FRONT_LEFT : constant := 16#0400#; -- gl.h:437 GL_FRONT_RIGHT : constant := 16#0401#; -- gl.h:438 GL_BACK_LEFT : constant := 16#0402#; -- gl.h:439 GL_BACK_RIGHT : constant := 16#0403#; -- gl.h:440 GL_AUX0 : constant := 16#0409#; -- gl.h:441 GL_AUX1 : constant := 16#040A#; -- gl.h:442 GL_AUX2 : constant := 16#040B#; -- gl.h:443 GL_AUX3 : constant := 16#040C#; -- gl.h:444 GL_COLOR_INDEX : constant := 16#1900#; -- gl.h:445 GL_RED : constant := 16#1903#; -- gl.h:446 GL_GREEN : constant := 16#1904#; -- gl.h:447 GL_BLUE : constant := 16#1905#; -- gl.h:448 GL_ALPHA : constant := 16#1906#; -- gl.h:449 GL_LUMINANCE : constant := 16#1909#; -- gl.h:450 GL_LUMINANCE_ALPHA : constant := 16#190A#; -- gl.h:451 GL_ALPHA_BITS : constant := 16#0D55#; -- gl.h:452 GL_RED_BITS : constant := 16#0D52#; -- gl.h:453 GL_GREEN_BITS : constant := 16#0D53#; -- gl.h:454 GL_BLUE_BITS : constant := 16#0D54#; -- gl.h:455 GL_INDEX_BITS : constant := 16#0D51#; -- gl.h:456 GL_SUBPIXEL_BITS : constant := 16#0D50#; -- gl.h:457 GL_AUX_BUFFERS : constant := 16#0C00#; -- gl.h:458 GL_READ_BUFFER : constant := 16#0C02#; -- gl.h:459 GL_DRAW_BUFFER : constant := 16#0C01#; -- gl.h:460 GL_DOUBLEBUFFER : constant := 16#0C32#; -- gl.h:461 GL_STEREO : constant := 16#0C33#; -- gl.h:462 GL_BITMAP : constant := 16#1A00#; -- gl.h:463 GL_COLOR : constant := 16#1800#; -- gl.h:464 GL_DEPTH : constant := 16#1801#; -- gl.h:465 GL_STENCIL : constant := 16#1802#; -- gl.h:466 GL_DITHER : constant := 16#0BD0#; -- gl.h:467 GL_RGB : constant := 16#1907#; -- gl.h:468 GL_RGBA : constant := 16#1908#; -- gl.h:469 GL_MAX_LIST_NESTING : constant := 16#0B31#; -- gl.h:472 GL_MAX_EVAL_ORDER : constant := 16#0D30#; -- gl.h:473 GL_MAX_LIGHTS : constant := 16#0D31#; -- gl.h:474 GL_MAX_CLIP_PLANES : constant := 16#0D32#; -- gl.h:475 GL_MAX_TEXTURE_SIZE : constant := 16#0D33#; -- gl.h:476 GL_MAX_PIXEL_MAP_TABLE : constant := 16#0D34#; -- gl.h:477 GL_MAX_ATTRIB_STACK_DEPTH : constant := 16#0D35#; -- gl.h:478 GL_MAX_MODELVIEW_STACK_DEPTH : constant := 16#0D36#; -- gl.h:479 GL_MAX_NAME_STACK_DEPTH : constant := 16#0D37#; -- gl.h:480 GL_MAX_PROJECTION_STACK_DEPTH : constant := 16#0D38#; -- gl.h:481 GL_MAX_TEXTURE_STACK_DEPTH : constant := 16#0D39#; -- gl.h:482 GL_MAX_VIEWPORT_DIMS : constant := 16#0D3A#; -- gl.h:483 GL_MAX_CLIENT_ATTRIB_STACK_DEPTH : constant := 16#0D3B#; -- gl.h:484 GL_ATTRIB_STACK_DEPTH : constant := 16#0BB0#; -- gl.h:487 GL_CLIENT_ATTRIB_STACK_DEPTH : constant := 16#0BB1#; -- gl.h:488 GL_COLOR_CLEAR_VALUE : constant := 16#0C22#; -- gl.h:489 GL_COLOR_WRITEMASK : constant := 16#0C23#; -- gl.h:490 GL_CURRENT_INDEX : constant := 16#0B01#; -- gl.h:491 GL_CURRENT_COLOR : constant := 16#0B00#; -- gl.h:492 GL_CURRENT_NORMAL : constant := 16#0B02#; -- gl.h:493 GL_CURRENT_RASTER_COLOR : constant := 16#0B04#; -- gl.h:494 GL_CURRENT_RASTER_DISTANCE : constant := 16#0B09#; -- gl.h:495 GL_CURRENT_RASTER_INDEX : constant := 16#0B05#; -- gl.h:496 GL_CURRENT_RASTER_POSITION : constant := 16#0B07#; -- gl.h:497 GL_CURRENT_RASTER_TEXTURE_COORDS : constant := 16#0B06#; -- gl.h:498 GL_CURRENT_RASTER_POSITION_VALID : constant := 16#0B08#; -- gl.h:499 GL_CURRENT_TEXTURE_COORDS : constant := 16#0B03#; -- gl.h:500 GL_INDEX_CLEAR_VALUE : constant := 16#0C20#; -- gl.h:501 GL_INDEX_MODE : constant := 16#0C30#; -- gl.h:502 GL_INDEX_WRITEMASK : constant := 16#0C21#; -- gl.h:503 GL_MODELVIEW_MATRIX : constant := 16#0BA6#; -- gl.h:504 GL_MODELVIEW_STACK_DEPTH : constant := 16#0BA3#; -- gl.h:505 GL_NAME_STACK_DEPTH : constant := 16#0D70#; -- gl.h:506 GL_PROJECTION_MATRIX : constant := 16#0BA7#; -- gl.h:507 GL_PROJECTION_STACK_DEPTH : constant := 16#0BA4#; -- gl.h:508 GL_RENDER_MODE : constant := 16#0C40#; -- gl.h:509 GL_RGBA_MODE : constant := 16#0C31#; -- gl.h:510 GL_TEXTURE_MATRIX : constant := 16#0BA8#; -- gl.h:511 GL_TEXTURE_STACK_DEPTH : constant := 16#0BA5#; -- gl.h:512 GL_VIEWPORT : constant := 16#0BA2#; -- gl.h:513 GL_AUTO_NORMAL : constant := 16#0D80#; -- gl.h:516 GL_MAP1_COLOR_4 : constant := 16#0D90#; -- gl.h:517 GL_MAP1_INDEX : constant := 16#0D91#; -- gl.h:518 GL_MAP1_NORMAL : constant := 16#0D92#; -- gl.h:519 GL_MAP1_TEXTURE_COORD_1 : constant := 16#0D93#; -- gl.h:520 GL_MAP1_TEXTURE_COORD_2 : constant := 16#0D94#; -- gl.h:521 GL_MAP1_TEXTURE_COORD_3 : constant := 16#0D95#; -- gl.h:522 GL_MAP1_TEXTURE_COORD_4 : constant := 16#0D96#; -- gl.h:523 GL_MAP1_VERTEX_3 : constant := 16#0D97#; -- gl.h:524 GL_MAP1_VERTEX_4 : constant := 16#0D98#; -- gl.h:525 GL_MAP2_COLOR_4 : constant := 16#0DB0#; -- gl.h:526 GL_MAP2_INDEX : constant := 16#0DB1#; -- gl.h:527 GL_MAP2_NORMAL : constant := 16#0DB2#; -- gl.h:528 GL_MAP2_TEXTURE_COORD_1 : constant := 16#0DB3#; -- gl.h:529 GL_MAP2_TEXTURE_COORD_2 : constant := 16#0DB4#; -- gl.h:530 GL_MAP2_TEXTURE_COORD_3 : constant := 16#0DB5#; -- gl.h:531 GL_MAP2_TEXTURE_COORD_4 : constant := 16#0DB6#; -- gl.h:532 GL_MAP2_VERTEX_3 : constant := 16#0DB7#; -- gl.h:533 GL_MAP2_VERTEX_4 : constant := 16#0DB8#; -- gl.h:534 GL_MAP1_GRID_DOMAIN : constant := 16#0DD0#; -- gl.h:535 GL_MAP1_GRID_SEGMENTS : constant := 16#0DD1#; -- gl.h:536 GL_MAP2_GRID_DOMAIN : constant := 16#0DD2#; -- gl.h:537 GL_MAP2_GRID_SEGMENTS : constant := 16#0DD3#; -- gl.h:538 GL_COEFF : constant := 16#0A00#; -- gl.h:539 GL_ORDER : constant := 16#0A01#; -- gl.h:540 GL_DOMAIN : constant := 16#0A02#; -- gl.h:541 GL_PERSPECTIVE_CORRECTION_HINT : constant := 16#0C50#; -- gl.h:544 GL_POINT_SMOOTH_HINT : constant := 16#0C51#; -- gl.h:545 GL_LINE_SMOOTH_HINT : constant := 16#0C52#; -- gl.h:546 GL_POLYGON_SMOOTH_HINT : constant := 16#0C53#; -- gl.h:547 GL_FOG_HINT : constant := 16#0C54#; -- gl.h:548 GL_DONT_CARE : constant := 16#1100#; -- gl.h:549 GL_FASTEST : constant := 16#1101#; -- gl.h:550 GL_NICEST : constant := 16#1102#; -- gl.h:551 GL_SCISSOR_BOX : constant := 16#0C10#; -- gl.h:554 GL_SCISSOR_TEST : constant := 16#0C11#; -- gl.h:555 GL_MAP_COLOR : constant := 16#0D10#; -- gl.h:558 GL_MAP_STENCIL : constant := 16#0D11#; -- gl.h:559 GL_INDEX_SHIFT : constant := 16#0D12#; -- gl.h:560 GL_INDEX_OFFSET : constant := 16#0D13#; -- gl.h:561 GL_RED_SCALE : constant := 16#0D14#; -- gl.h:562 GL_RED_BIAS : constant := 16#0D15#; -- gl.h:563 GL_GREEN_SCALE : constant := 16#0D18#; -- gl.h:564 GL_GREEN_BIAS : constant := 16#0D19#; -- gl.h:565 GL_BLUE_SCALE : constant := 16#0D1A#; -- gl.h:566 GL_BLUE_BIAS : constant := 16#0D1B#; -- gl.h:567 GL_ALPHA_SCALE : constant := 16#0D1C#; -- gl.h:568 GL_ALPHA_BIAS : constant := 16#0D1D#; -- gl.h:569 GL_DEPTH_SCALE : constant := 16#0D1E#; -- gl.h:570 GL_DEPTH_BIAS : constant := 16#0D1F#; -- gl.h:571 GL_PIXEL_MAP_S_TO_S_SIZE : constant := 16#0CB1#; -- gl.h:572 GL_PIXEL_MAP_I_TO_I_SIZE : constant := 16#0CB0#; -- gl.h:573 GL_PIXEL_MAP_I_TO_R_SIZE : constant := 16#0CB2#; -- gl.h:574 GL_PIXEL_MAP_I_TO_G_SIZE : constant := 16#0CB3#; -- gl.h:575 GL_PIXEL_MAP_I_TO_B_SIZE : constant := 16#0CB4#; -- gl.h:576 GL_PIXEL_MAP_I_TO_A_SIZE : constant := 16#0CB5#; -- gl.h:577 GL_PIXEL_MAP_R_TO_R_SIZE : constant := 16#0CB6#; -- gl.h:578 GL_PIXEL_MAP_G_TO_G_SIZE : constant := 16#0CB7#; -- gl.h:579 GL_PIXEL_MAP_B_TO_B_SIZE : constant := 16#0CB8#; -- gl.h:580 GL_PIXEL_MAP_A_TO_A_SIZE : constant := 16#0CB9#; -- gl.h:581 GL_PIXEL_MAP_S_TO_S : constant := 16#0C71#; -- gl.h:582 GL_PIXEL_MAP_I_TO_I : constant := 16#0C70#; -- gl.h:583 GL_PIXEL_MAP_I_TO_R : constant := 16#0C72#; -- gl.h:584 GL_PIXEL_MAP_I_TO_G : constant := 16#0C73#; -- gl.h:585 GL_PIXEL_MAP_I_TO_B : constant := 16#0C74#; -- gl.h:586 GL_PIXEL_MAP_I_TO_A : constant := 16#0C75#; -- gl.h:587 GL_PIXEL_MAP_R_TO_R : constant := 16#0C76#; -- gl.h:588 GL_PIXEL_MAP_G_TO_G : constant := 16#0C77#; -- gl.h:589 GL_PIXEL_MAP_B_TO_B : constant := 16#0C78#; -- gl.h:590 GL_PIXEL_MAP_A_TO_A : constant := 16#0C79#; -- gl.h:591 GL_PACK_ALIGNMENT : constant := 16#0D05#; -- gl.h:592 GL_PACK_LSB_FIRST : constant := 16#0D01#; -- gl.h:593 GL_PACK_ROW_LENGTH : constant := 16#0D02#; -- gl.h:594 GL_PACK_SKIP_PIXELS : constant := 16#0D04#; -- gl.h:595 GL_PACK_SKIP_ROWS : constant := 16#0D03#; -- gl.h:596 GL_PACK_SWAP_BYTES : constant := 16#0D00#; -- gl.h:597 GL_UNPACK_ALIGNMENT : constant := 16#0CF5#; -- gl.h:598 GL_UNPACK_LSB_FIRST : constant := 16#0CF1#; -- gl.h:599 GL_UNPACK_ROW_LENGTH : constant := 16#0CF2#; -- gl.h:600 GL_UNPACK_SKIP_PIXELS : constant := 16#0CF4#; -- gl.h:601 GL_UNPACK_SKIP_ROWS : constant := 16#0CF3#; -- gl.h:602 GL_UNPACK_SWAP_BYTES : constant := 16#0CF0#; -- gl.h:603 GL_ZOOM_X : constant := 16#0D16#; -- gl.h:604 GL_ZOOM_Y : constant := 16#0D17#; -- gl.h:605 GL_TEXTURE_ENV : constant := 16#2300#; -- gl.h:608 GL_TEXTURE_ENV_MODE : constant := 16#2200#; -- gl.h:609 GL_TEXTURE_1D : constant := 16#0DE0#; -- gl.h:610 GL_TEXTURE_2D : constant := 16#0DE1#; -- gl.h:611 GL_TEXTURE_WRAP_S : constant := 16#2802#; -- gl.h:612 GL_TEXTURE_WRAP_T : constant := 16#2803#; -- gl.h:613 GL_TEXTURE_MAG_FILTER : constant := 16#2800#; -- gl.h:614 GL_TEXTURE_MIN_FILTER : constant := 16#2801#; -- gl.h:615 GL_TEXTURE_ENV_COLOR : constant := 16#2201#; -- gl.h:616 GL_TEXTURE_GEN_S : constant := 16#0C60#; -- gl.h:617 GL_TEXTURE_GEN_T : constant := 16#0C61#; -- gl.h:618 GL_TEXTURE_GEN_R : constant := 16#0C62#; -- gl.h:619 GL_TEXTURE_GEN_Q : constant := 16#0C63#; -- gl.h:620 GL_TEXTURE_GEN_MODE : constant := 16#2500#; -- gl.h:621 GL_TEXTURE_BORDER_COLOR : constant := 16#1004#; -- gl.h:622 GL_TEXTURE_WIDTH : constant := 16#1000#; -- gl.h:623 GL_TEXTURE_HEIGHT : constant := 16#1001#; -- gl.h:624 GL_TEXTURE_BORDER : constant := 16#1005#; -- gl.h:625 GL_TEXTURE_COMPONENTS : constant := 16#1003#; -- gl.h:626 GL_TEXTURE_RED_SIZE : constant := 16#805C#; -- gl.h:627 GL_TEXTURE_GREEN_SIZE : constant := 16#805D#; -- gl.h:628 GL_TEXTURE_BLUE_SIZE : constant := 16#805E#; -- gl.h:629 GL_TEXTURE_ALPHA_SIZE : constant := 16#805F#; -- gl.h:630 GL_TEXTURE_LUMINANCE_SIZE : constant := 16#8060#; -- gl.h:631 GL_TEXTURE_INTENSITY_SIZE : constant := 16#8061#; -- gl.h:632 GL_NEAREST_MIPMAP_NEAREST : constant := 16#2700#; -- gl.h:633 GL_NEAREST_MIPMAP_LINEAR : constant := 16#2702#; -- gl.h:634 GL_LINEAR_MIPMAP_NEAREST : constant := 16#2701#; -- gl.h:635 GL_LINEAR_MIPMAP_LINEAR : constant := 16#2703#; -- gl.h:636 GL_OBJECT_LINEAR : constant := 16#2401#; -- gl.h:637 GL_OBJECT_PLANE : constant := 16#2501#; -- gl.h:638 GL_EYE_LINEAR : constant := 16#2400#; -- gl.h:639 GL_EYE_PLANE : constant := 16#2502#; -- gl.h:640 GL_SPHERE_MAP : constant := 16#2402#; -- gl.h:641 GL_DECAL : constant := 16#2101#; -- gl.h:642 GL_MODULATE : constant := 16#2100#; -- gl.h:643 GL_NEAREST : constant := 16#2600#; -- gl.h:644 GL_REPEAT : constant := 16#2901#; -- gl.h:645 GL_CLAMP : constant := 16#2900#; -- gl.h:646 GL_S : constant := 16#2000#; -- gl.h:647 GL_T : constant := 16#2001#; -- gl.h:648 GL_R : constant := 16#2002#; -- gl.h:649 GL_Q : constant := 16#2003#; -- gl.h:650 GL_VENDOR : constant := 16#1F00#; -- gl.h:653 GL_RENDERER : constant := 16#1F01#; -- gl.h:654 GL_VERSION : constant := 16#1F02#; -- gl.h:655 GL_EXTENSIONS : constant := 16#1F03#; -- gl.h:656 GL_NO_ERROR : constant := 0; -- gl.h:659 GL_INVALID_ENUM : constant := 16#0500#; -- gl.h:660 GL_INVALID_VALUE : constant := 16#0501#; -- gl.h:661 GL_INVALID_OPERATION : constant := 16#0502#; -- gl.h:662 GL_STACK_OVERFLOW : constant := 16#0503#; -- gl.h:663 GL_STACK_UNDERFLOW : constant := 16#0504#; -- gl.h:664 GL_OUT_OF_MEMORY : constant := 16#0505#; -- gl.h:665 GL_CURRENT_BIT : constant := 16#00000001#; -- gl.h:668 GL_POINT_BIT : constant := 16#00000002#; -- gl.h:669 GL_LINE_BIT : constant := 16#00000004#; -- gl.h:670 GL_POLYGON_BIT : constant := 16#00000008#; -- gl.h:671 GL_POLYGON_STIPPLE_BIT : constant := 16#00000010#; -- gl.h:672 GL_PIXEL_MODE_BIT : constant := 16#00000020#; -- gl.h:673 GL_LIGHTING_BIT : constant := 16#00000040#; -- gl.h:674 GL_FOG_BIT : constant := 16#00000080#; -- gl.h:675 GL_DEPTH_BUFFER_BIT : constant := 16#00000100#; -- gl.h:676 GL_ACCUM_BUFFER_BIT : constant := 16#00000200#; -- gl.h:677 GL_STENCIL_BUFFER_BIT : constant := 16#00000400#; -- gl.h:678 GL_VIEWPORT_BIT : constant := 16#00000800#; -- gl.h:679 GL_TRANSFORM_BIT : constant := 16#00001000#; -- gl.h:680 GL_ENABLE_BIT : constant := 16#00002000#; -- gl.h:681 GL_COLOR_BUFFER_BIT : constant := 16#00004000#; -- gl.h:682 GL_HINT_BIT : constant := 16#00008000#; -- gl.h:683 GL_EVAL_BIT : constant := 16#00010000#; -- gl.h:684 GL_LIST_BIT : constant := 16#00020000#; -- gl.h:685 GL_TEXTURE_BIT : constant := 16#00040000#; -- gl.h:686 GL_SCISSOR_BIT : constant := 16#00080000#; -- gl.h:687 GL_ALL_ATTRIB_BITS : constant := 16#FFFFFFFF#; -- gl.h:688 GL_PROXY_TEXTURE_1D : constant := 16#8063#; -- gl.h:692 GL_PROXY_TEXTURE_2D : constant := 16#8064#; -- gl.h:693 GL_TEXTURE_PRIORITY : constant := 16#8066#; -- gl.h:694 GL_TEXTURE_RESIDENT : constant := 16#8067#; -- gl.h:695 GL_TEXTURE_BINDING_1D : constant := 16#8068#; -- gl.h:696 GL_TEXTURE_BINDING_2D : constant := 16#8069#; -- gl.h:697 GL_TEXTURE_INTERNAL_FORMAT : constant := 16#1003#; -- gl.h:698 GL_ALPHA4 : constant := 16#803B#; -- gl.h:699 GL_ALPHA8 : constant := 16#803C#; -- gl.h:700 GL_ALPHA12 : constant := 16#803D#; -- gl.h:701 GL_ALPHA16 : constant := 16#803E#; -- gl.h:702 GL_LUMINANCE4 : constant := 16#803F#; -- gl.h:703 GL_LUMINANCE8 : constant := 16#8040#; -- gl.h:704 GL_LUMINANCE12 : constant := 16#8041#; -- gl.h:705 GL_LUMINANCE16 : constant := 16#8042#; -- gl.h:706 GL_LUMINANCE4_ALPHA4 : constant := 16#8043#; -- gl.h:707 GL_LUMINANCE6_ALPHA2 : constant := 16#8044#; -- gl.h:708 GL_LUMINANCE8_ALPHA8 : constant := 16#8045#; -- gl.h:709 GL_LUMINANCE12_ALPHA4 : constant := 16#8046#; -- gl.h:710 GL_LUMINANCE12_ALPHA12 : constant := 16#8047#; -- gl.h:711 GL_LUMINANCE16_ALPHA16 : constant := 16#8048#; -- gl.h:712 GL_INTENSITY : constant := 16#8049#; -- gl.h:713 GL_INTENSITY4 : constant := 16#804A#; -- gl.h:714 GL_INTENSITY8 : constant := 16#804B#; -- gl.h:715 GL_INTENSITY12 : constant := 16#804C#; -- gl.h:716 GL_INTENSITY16 : constant := 16#804D#; -- gl.h:717 GL_R3_G3_B2 : constant := 16#2A10#; -- gl.h:718 GL_RGB4 : constant := 16#804F#; -- gl.h:719 GL_RGB5 : constant := 16#8050#; -- gl.h:720 GL_RGB8 : constant := 16#8051#; -- gl.h:721 GL_RGB10 : constant := 16#8052#; -- gl.h:722 GL_RGB12 : constant := 16#8053#; -- gl.h:723 GL_RGB16 : constant := 16#8054#; -- gl.h:724 GL_RGBA2 : constant := 16#8055#; -- gl.h:725 GL_RGBA4 : constant := 16#8056#; -- gl.h:726 GL_RGB5_A1 : constant := 16#8057#; -- gl.h:727 GL_RGBA8 : constant := 16#8058#; -- gl.h:728 GL_RGB10_A2 : constant := 16#8059#; -- gl.h:729 GL_RGBA12 : constant := 16#805A#; -- gl.h:730 GL_RGBA16 : constant := 16#805B#; -- gl.h:731 GL_CLIENT_PIXEL_STORE_BIT : constant := 16#00000001#; -- gl.h:732 GL_CLIENT_VERTEX_ARRAY_BIT : constant := 16#00000002#; -- gl.h:733 GL_ALL_CLIENT_ATTRIB_BITS : constant := 16#FFFFFFFF#; -- gl.h:734 GL_CLIENT_ALL_ATTRIB_BITS : constant := 16#FFFFFFFF#; -- gl.h:735 GL_RESCALE_NORMAL : constant := 16#803A#; -- gl.h:1446 GL_CLAMP_TO_EDGE : constant := 16#812F#; -- gl.h:1447 GL_MAX_ELEMENTS_VERTICES : constant := 16#80E8#; -- gl.h:1448 GL_MAX_ELEMENTS_INDICES : constant := 16#80E9#; -- gl.h:1449 GL_BGR : constant := 16#80E0#; -- gl.h:1450 GL_BGRA : constant := 16#80E1#; -- gl.h:1451 GL_UNSIGNED_BYTE_3_3_2 : constant := 16#8032#; -- gl.h:1452 GL_UNSIGNED_BYTE_2_3_3_REV : constant := 16#8362#; -- gl.h:1453 GL_UNSIGNED_SHORT_5_6_5 : constant := 16#8363#; -- gl.h:1454 GL_UNSIGNED_SHORT_5_6_5_REV : constant := 16#8364#; -- gl.h:1455 GL_UNSIGNED_SHORT_4_4_4_4 : constant := 16#8033#; -- gl.h:1456 GL_UNSIGNED_SHORT_4_4_4_4_REV : constant := 16#8365#; -- gl.h:1457 GL_UNSIGNED_SHORT_5_5_5_1 : constant := 16#8034#; -- gl.h:1458 GL_UNSIGNED_SHORT_1_5_5_5_REV : constant := 16#8366#; -- gl.h:1459 GL_UNSIGNED_INT_8_8_8_8 : constant := 16#8035#; -- gl.h:1460 GL_UNSIGNED_INT_8_8_8_8_REV : constant := 16#8367#; -- gl.h:1461 GL_UNSIGNED_INT_10_10_10_2 : constant := 16#8036#; -- gl.h:1462 GL_UNSIGNED_INT_2_10_10_10_REV : constant := 16#8368#; -- gl.h:1463 GL_LIGHT_MODEL_COLOR_CONTROL : constant := 16#81F8#; -- gl.h:1464 GL_SINGLE_COLOR : constant := 16#81F9#; -- gl.h:1465 GL_SEPARATE_SPECULAR_COLOR : constant := 16#81FA#; -- gl.h:1466 GL_TEXTURE_MIN_LOD : constant := 16#813A#; -- gl.h:1467 GL_TEXTURE_MAX_LOD : constant := 16#813B#; -- gl.h:1468 GL_TEXTURE_BASE_LEVEL : constant := 16#813C#; -- gl.h:1469 GL_TEXTURE_MAX_LEVEL : constant := 16#813D#; -- gl.h:1470 GL_SMOOTH_POINT_SIZE_RANGE : constant := 16#0B12#; -- gl.h:1471 GL_SMOOTH_POINT_SIZE_GRANULARITY : constant := 16#0B13#; -- gl.h:1472 GL_SMOOTH_LINE_WIDTH_RANGE : constant := 16#0B22#; -- gl.h:1473 GL_SMOOTH_LINE_WIDTH_GRANULARITY : constant := 16#0B23#; -- gl.h:1474 GL_ALIASED_POINT_SIZE_RANGE : constant := 16#846D#; -- gl.h:1475 GL_ALIASED_LINE_WIDTH_RANGE : constant := 16#846E#; -- gl.h:1476 GL_PACK_SKIP_IMAGES : constant := 16#806B#; -- gl.h:1477 GL_PACK_IMAGE_HEIGHT : constant := 16#806C#; -- gl.h:1478 GL_UNPACK_SKIP_IMAGES : constant := 16#806D#; -- gl.h:1479 GL_UNPACK_IMAGE_HEIGHT : constant := 16#806E#; -- gl.h:1480 GL_TEXTURE_3D : constant := 16#806F#; -- gl.h:1481 GL_PROXY_TEXTURE_3D : constant := 16#8070#; -- gl.h:1482 GL_TEXTURE_DEPTH : constant := 16#8071#; -- gl.h:1483 GL_TEXTURE_WRAP_R : constant := 16#8072#; -- gl.h:1484 GL_MAX_3D_TEXTURE_SIZE : constant := 16#8073#; -- gl.h:1485 GL_TEXTURE_BINDING_3D : constant := 16#806A#; -- gl.h:1486 GL_COLOR_TABLE : constant := 16#80D0#; -- gl.h:1525 GL_POST_CONVOLUTION_COLOR_TABLE : constant := 16#80D1#; -- gl.h:1526 GL_POST_COLOR_MATRIX_COLOR_TABLE : constant := 16#80D2#; -- gl.h:1527 GL_PROXY_COLOR_TABLE : constant := 16#80D3#; -- gl.h:1528 GL_PROXY_POST_CONVOLUTION_COLOR_TABLE : constant := 16#80D4#; -- gl.h:1529 GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE : constant := 16#80D5#; -- gl.h:1530 GL_COLOR_TABLE_SCALE : constant := 16#80D6#; -- gl.h:1531 GL_COLOR_TABLE_BIAS : constant := 16#80D7#; -- gl.h:1532 GL_COLOR_TABLE_FORMAT : constant := 16#80D8#; -- gl.h:1533 GL_COLOR_TABLE_WIDTH : constant := 16#80D9#; -- gl.h:1534 GL_COLOR_TABLE_RED_SIZE : constant := 16#80DA#; -- gl.h:1535 GL_COLOR_TABLE_GREEN_SIZE : constant := 16#80DB#; -- gl.h:1536 GL_COLOR_TABLE_BLUE_SIZE : constant := 16#80DC#; -- gl.h:1537 GL_COLOR_TABLE_ALPHA_SIZE : constant := 16#80DD#; -- gl.h:1538 GL_COLOR_TABLE_LUMINANCE_SIZE : constant := 16#80DE#; -- gl.h:1539 GL_COLOR_TABLE_INTENSITY_SIZE : constant := 16#80DF#; -- gl.h:1540 GL_CONVOLUTION_1D : constant := 16#8010#; -- gl.h:1541 GL_CONVOLUTION_2D : constant := 16#8011#; -- gl.h:1542 GL_SEPARABLE_2D : constant := 16#8012#; -- gl.h:1543 GL_CONVOLUTION_BORDER_MODE : constant := 16#8013#; -- gl.h:1544 GL_CONVOLUTION_FILTER_SCALE : constant := 16#8014#; -- gl.h:1545 GL_CONVOLUTION_FILTER_BIAS : constant := 16#8015#; -- gl.h:1546 GL_REDUCE : constant := 16#8016#; -- gl.h:1547 GL_CONVOLUTION_FORMAT : constant := 16#8017#; -- gl.h:1548 GL_CONVOLUTION_WIDTH : constant := 16#8018#; -- gl.h:1549 GL_CONVOLUTION_HEIGHT : constant := 16#8019#; -- gl.h:1550 GL_MAX_CONVOLUTION_WIDTH : constant := 16#801A#; -- gl.h:1551 GL_MAX_CONVOLUTION_HEIGHT : constant := 16#801B#; -- gl.h:1552 GL_POST_CONVOLUTION_RED_SCALE : constant := 16#801C#; -- gl.h:1553 GL_POST_CONVOLUTION_GREEN_SCALE : constant := 16#801D#; -- gl.h:1554 GL_POST_CONVOLUTION_BLUE_SCALE : constant := 16#801E#; -- gl.h:1555 GL_POST_CONVOLUTION_ALPHA_SCALE : constant := 16#801F#; -- gl.h:1556 GL_POST_CONVOLUTION_RED_BIAS : constant := 16#8020#; -- gl.h:1557 GL_POST_CONVOLUTION_GREEN_BIAS : constant := 16#8021#; -- gl.h:1558 GL_POST_CONVOLUTION_BLUE_BIAS : constant := 16#8022#; -- gl.h:1559 GL_POST_CONVOLUTION_ALPHA_BIAS : constant := 16#8023#; -- gl.h:1560 GL_CONSTANT_BORDER : constant := 16#8151#; -- gl.h:1561 GL_REPLICATE_BORDER : constant := 16#8153#; -- gl.h:1562 GL_CONVOLUTION_BORDER_COLOR : constant := 16#8154#; -- gl.h:1563 GL_COLOR_MATRIX : constant := 16#80B1#; -- gl.h:1564 GL_COLOR_MATRIX_STACK_DEPTH : constant := 16#80B2#; -- gl.h:1565 GL_MAX_COLOR_MATRIX_STACK_DEPTH : constant := 16#80B3#; -- gl.h:1566 GL_POST_COLOR_MATRIX_RED_SCALE : constant := 16#80B4#; -- gl.h:1567 GL_POST_COLOR_MATRIX_GREEN_SCALE : constant := 16#80B5#; -- gl.h:1568 GL_POST_COLOR_MATRIX_BLUE_SCALE : constant := 16#80B6#; -- gl.h:1569 GL_POST_COLOR_MATRIX_ALPHA_SCALE : constant := 16#80B7#; -- gl.h:1570 GL_POST_COLOR_MATRIX_RED_BIAS : constant := 16#80B8#; -- gl.h:1571 GL_POST_COLOR_MATRIX_GREEN_BIAS : constant := 16#80B9#; -- gl.h:1572 GL_POST_COLOR_MATRIX_BLUE_BIAS : constant := 16#80BA#; -- gl.h:1573 GL_POST_COLOR_MATRIX_ALPHA_BIAS : constant := 16#80BB#; -- gl.h:1574 GL_HISTOGRAM : constant := 16#8024#; -- gl.h:1575 GL_PROXY_HISTOGRAM : constant := 16#8025#; -- gl.h:1576 GL_HISTOGRAM_WIDTH : constant := 16#8026#; -- gl.h:1577 GL_HISTOGRAM_FORMAT : constant := 16#8027#; -- gl.h:1578 GL_HISTOGRAM_RED_SIZE : constant := 16#8028#; -- gl.h:1579 GL_HISTOGRAM_GREEN_SIZE : constant := 16#8029#; -- gl.h:1580 GL_HISTOGRAM_BLUE_SIZE : constant := 16#802A#; -- gl.h:1581 GL_HISTOGRAM_ALPHA_SIZE : constant := 16#802B#; -- gl.h:1582 GL_HISTOGRAM_LUMINANCE_SIZE : constant := 16#802C#; -- gl.h:1583 GL_HISTOGRAM_SINK : constant := 16#802D#; -- gl.h:1584 GL_MINMAX : constant := 16#802E#; -- gl.h:1585 GL_MINMAX_FORMAT : constant := 16#802F#; -- gl.h:1586 GL_MINMAX_SINK : constant := 16#8030#; -- gl.h:1587 GL_TABLE_TOO_LARGE : constant := 16#8031#; -- gl.h:1588 GL_TEXTURE0 : constant := 16#84C0#; -- gl.h:1714 GL_TEXTURE1 : constant := 16#84C1#; -- gl.h:1715 GL_TEXTURE2 : constant := 16#84C2#; -- gl.h:1716 GL_TEXTURE3 : constant := 16#84C3#; -- gl.h:1717 GL_TEXTURE4 : constant := 16#84C4#; -- gl.h:1718 GL_TEXTURE5 : constant := 16#84C5#; -- gl.h:1719 GL_TEXTURE6 : constant := 16#84C6#; -- gl.h:1720 GL_TEXTURE7 : constant := 16#84C7#; -- gl.h:1721 GL_TEXTURE8 : constant := 16#84C8#; -- gl.h:1722 GL_TEXTURE9 : constant := 16#84C9#; -- gl.h:1723 GL_TEXTURE10 : constant := 16#84CA#; -- gl.h:1724 GL_TEXTURE11 : constant := 16#84CB#; -- gl.h:1725 GL_TEXTURE12 : constant := 16#84CC#; -- gl.h:1726 GL_TEXTURE13 : constant := 16#84CD#; -- gl.h:1727 GL_TEXTURE14 : constant := 16#84CE#; -- gl.h:1728 GL_TEXTURE15 : constant := 16#84CF#; -- gl.h:1729 GL_TEXTURE16 : constant := 16#84D0#; -- gl.h:1730 GL_TEXTURE17 : constant := 16#84D1#; -- gl.h:1731 GL_TEXTURE18 : constant := 16#84D2#; -- gl.h:1732 GL_TEXTURE19 : constant := 16#84D3#; -- gl.h:1733 GL_TEXTURE20 : constant := 16#84D4#; -- gl.h:1734 GL_TEXTURE21 : constant := 16#84D5#; -- gl.h:1735 GL_TEXTURE22 : constant := 16#84D6#; -- gl.h:1736 GL_TEXTURE23 : constant := 16#84D7#; -- gl.h:1737 GL_TEXTURE24 : constant := 16#84D8#; -- gl.h:1738 GL_TEXTURE25 : constant := 16#84D9#; -- gl.h:1739 GL_TEXTURE26 : constant := 16#84DA#; -- gl.h:1740 GL_TEXTURE27 : constant := 16#84DB#; -- gl.h:1741 GL_TEXTURE28 : constant := 16#84DC#; -- gl.h:1742 GL_TEXTURE29 : constant := 16#84DD#; -- gl.h:1743 GL_TEXTURE30 : constant := 16#84DE#; -- gl.h:1744 GL_TEXTURE31 : constant := 16#84DF#; -- gl.h:1745 GL_ACTIVE_TEXTURE : constant := 16#84E0#; -- gl.h:1746 GL_CLIENT_ACTIVE_TEXTURE : constant := 16#84E1#; -- gl.h:1747 GL_MAX_TEXTURE_UNITS : constant := 16#84E2#; -- gl.h:1748 GL_NORMAL_MAP : constant := 16#8511#; -- gl.h:1750 GL_REFLECTION_MAP : constant := 16#8512#; -- gl.h:1751 GL_TEXTURE_CUBE_MAP : constant := 16#8513#; -- gl.h:1752 GL_TEXTURE_BINDING_CUBE_MAP : constant := 16#8514#; -- gl.h:1753 GL_TEXTURE_CUBE_MAP_POSITIVE_X : constant := 16#8515#; -- gl.h:1754 GL_TEXTURE_CUBE_MAP_NEGATIVE_X : constant := 16#8516#; -- gl.h:1755 GL_TEXTURE_CUBE_MAP_POSITIVE_Y : constant := 16#8517#; -- gl.h:1756 GL_TEXTURE_CUBE_MAP_NEGATIVE_Y : constant := 16#8518#; -- gl.h:1757 GL_TEXTURE_CUBE_MAP_POSITIVE_Z : constant := 16#8519#; -- gl.h:1758 GL_TEXTURE_CUBE_MAP_NEGATIVE_Z : constant := 16#851A#; -- gl.h:1759 GL_PROXY_TEXTURE_CUBE_MAP : constant := 16#851B#; -- gl.h:1760 GL_MAX_CUBE_MAP_TEXTURE_SIZE : constant := 16#851C#; -- gl.h:1761 GL_COMPRESSED_ALPHA : constant := 16#84E9#; -- gl.h:1763 GL_COMPRESSED_LUMINANCE : constant := 16#84EA#; -- gl.h:1764 GL_COMPRESSED_LUMINANCE_ALPHA : constant := 16#84EB#; -- gl.h:1765 GL_COMPRESSED_INTENSITY : constant := 16#84EC#; -- gl.h:1766 GL_COMPRESSED_RGB : constant := 16#84ED#; -- gl.h:1767 GL_COMPRESSED_RGBA : constant := 16#84EE#; -- gl.h:1768 GL_TEXTURE_COMPRESSION_HINT : constant := 16#84EF#; -- gl.h:1769 GL_TEXTURE_COMPRESSED_IMAGE_SIZE : constant := 16#86A0#; -- gl.h:1770 GL_TEXTURE_COMPRESSED : constant := 16#86A1#; -- gl.h:1771 GL_NUM_COMPRESSED_TEXTURE_FORMATS : constant := 16#86A2#; -- gl.h:1772 GL_COMPRESSED_TEXTURE_FORMATS : constant := 16#86A3#; -- gl.h:1773 GL_MULTISAMPLE : constant := 16#809D#; -- gl.h:1775 GL_SAMPLE_ALPHA_TO_COVERAGE : constant := 16#809E#; -- gl.h:1776 GL_SAMPLE_ALPHA_TO_ONE : constant := 16#809F#; -- gl.h:1777 GL_SAMPLE_COVERAGE : constant := 16#80A0#; -- gl.h:1778 GL_SAMPLE_BUFFERS : constant := 16#80A8#; -- gl.h:1779 GL_SAMPLES : constant := 16#80A9#; -- gl.h:1780 GL_SAMPLE_COVERAGE_VALUE : constant := 16#80AA#; -- gl.h:1781 GL_SAMPLE_COVERAGE_INVERT : constant := 16#80AB#; -- gl.h:1782 GL_MULTISAMPLE_BIT : constant := 16#20000000#; -- gl.h:1783 GL_TRANSPOSE_MODELVIEW_MATRIX : constant := 16#84E3#; -- gl.h:1785 GL_TRANSPOSE_PROJECTION_MATRIX : constant := 16#84E4#; -- gl.h:1786 GL_TRANSPOSE_TEXTURE_MATRIX : constant := 16#84E5#; -- gl.h:1787 GL_TRANSPOSE_COLOR_MATRIX : constant := 16#84E6#; -- gl.h:1788 GL_COMBINE : constant := 16#8570#; -- gl.h:1790 GL_COMBINE_RGB : constant := 16#8571#; -- gl.h:1791 GL_COMBINE_ALPHA : constant := 16#8572#; -- gl.h:1792 GL_SOURCE0_RGB : constant := 16#8580#; -- gl.h:1793 GL_SOURCE1_RGB : constant := 16#8581#; -- gl.h:1794 GL_SOURCE2_RGB : constant := 16#8582#; -- gl.h:1795 GL_SOURCE0_ALPHA : constant := 16#8588#; -- gl.h:1796 GL_SOURCE1_ALPHA : constant := 16#8589#; -- gl.h:1797 GL_SOURCE2_ALPHA : constant := 16#858A#; -- gl.h:1798 GL_OPERAND0_RGB : constant := 16#8590#; -- gl.h:1799 GL_OPERAND1_RGB : constant := 16#8591#; -- gl.h:1800 GL_OPERAND2_RGB : constant := 16#8592#; -- gl.h:1801 GL_OPERAND0_ALPHA : constant := 16#8598#; -- gl.h:1802 GL_OPERAND1_ALPHA : constant := 16#8599#; -- gl.h:1803 GL_OPERAND2_ALPHA : constant := 16#859A#; -- gl.h:1804 GL_RGB_SCALE : constant := 16#8573#; -- gl.h:1805 GL_ADD_SIGNED : constant := 16#8574#; -- gl.h:1806 GL_INTERPOLATE : constant := 16#8575#; -- gl.h:1807 GL_SUBTRACT : constant := 16#84E7#; -- gl.h:1808 GL_CONSTANT : constant := 16#8576#; -- gl.h:1809 GL_PRIMARY_COLOR : constant := 16#8577#; -- gl.h:1810 GL_PREVIOUS : constant := 16#8578#; -- gl.h:1811 GL_DOT3_RGB : constant := 16#86AE#; -- gl.h:1813 GL_DOT3_RGBA : constant := 16#86AF#; -- gl.h:1814 GL_CLAMP_TO_BORDER : constant := 16#812D#; -- gl.h:1816 GL_ARB_multitexture : constant := 1; -- gl.h:1928 GL_TEXTURE0_ARB : constant := 16#84C0#; -- gl.h:1930 GL_TEXTURE1_ARB : constant := 16#84C1#; -- gl.h:1931 GL_TEXTURE2_ARB : constant := 16#84C2#; -- gl.h:1932 GL_TEXTURE3_ARB : constant := 16#84C3#; -- gl.h:1933 GL_TEXTURE4_ARB : constant := 16#84C4#; -- gl.h:1934 GL_TEXTURE5_ARB : constant := 16#84C5#; -- gl.h:1935 GL_TEXTURE6_ARB : constant := 16#84C6#; -- gl.h:1936 GL_TEXTURE7_ARB : constant := 16#84C7#; -- gl.h:1937 GL_TEXTURE8_ARB : constant := 16#84C8#; -- gl.h:1938 GL_TEXTURE9_ARB : constant := 16#84C9#; -- gl.h:1939 GL_TEXTURE10_ARB : constant := 16#84CA#; -- gl.h:1940 GL_TEXTURE11_ARB : constant := 16#84CB#; -- gl.h:1941 GL_TEXTURE12_ARB : constant := 16#84CC#; -- gl.h:1942 GL_TEXTURE13_ARB : constant := 16#84CD#; -- gl.h:1943 GL_TEXTURE14_ARB : constant := 16#84CE#; -- gl.h:1944 GL_TEXTURE15_ARB : constant := 16#84CF#; -- gl.h:1945 GL_TEXTURE16_ARB : constant := 16#84D0#; -- gl.h:1946 GL_TEXTURE17_ARB : constant := 16#84D1#; -- gl.h:1947 GL_TEXTURE18_ARB : constant := 16#84D2#; -- gl.h:1948 GL_TEXTURE19_ARB : constant := 16#84D3#; -- gl.h:1949 GL_TEXTURE20_ARB : constant := 16#84D4#; -- gl.h:1950 GL_TEXTURE21_ARB : constant := 16#84D5#; -- gl.h:1951 GL_TEXTURE22_ARB : constant := 16#84D6#; -- gl.h:1952 GL_TEXTURE23_ARB : constant := 16#84D7#; -- gl.h:1953 GL_TEXTURE24_ARB : constant := 16#84D8#; -- gl.h:1954 GL_TEXTURE25_ARB : constant := 16#84D9#; -- gl.h:1955 GL_TEXTURE26_ARB : constant := 16#84DA#; -- gl.h:1956 GL_TEXTURE27_ARB : constant := 16#84DB#; -- gl.h:1957 GL_TEXTURE28_ARB : constant := 16#84DC#; -- gl.h:1958 GL_TEXTURE29_ARB : constant := 16#84DD#; -- gl.h:1959 GL_TEXTURE30_ARB : constant := 16#84DE#; -- gl.h:1960 GL_TEXTURE31_ARB : constant := 16#84DF#; -- gl.h:1961 GL_ACTIVE_TEXTURE_ARB : constant := 16#84E0#; -- gl.h:1962 GL_CLIENT_ACTIVE_TEXTURE_ARB : constant := 16#84E1#; -- gl.h:1963 GL_MAX_TEXTURE_UNITS_ARB : constant := 16#84E2#; -- gl.h:1964 GL_MESA_packed_depth_stencil : constant := 1; -- gl.h:2061 GL_DEPTH_STENCIL_MESA : constant := 16#8750#; -- gl.h:2063 GL_UNSIGNED_INT_24_8_MESA : constant := 16#8751#; -- gl.h:2064 GL_UNSIGNED_INT_8_24_REV_MESA : constant := 16#8752#; -- gl.h:2065 GL_UNSIGNED_SHORT_15_1_MESA : constant := 16#8753#; -- gl.h:2066 GL_UNSIGNED_SHORT_1_15_REV_MESA : constant := 16#8754#; -- gl.h:2067 GL_ATI_blend_equation_separate : constant := 1; -- gl.h:2073 GL_ALPHA_BLEND_EQUATION_ATI : constant := 16#883D#; -- gl.h:2075 GL_OES_EGL_image : constant := 1; -- gl.h:2089 -- * Mesa 3-D graphics library -- * -- * Copyright (C) 1999-2006 Brian Paul All Rights Reserved. -- * Copyright (C) 2009 VMware, Inc. All Rights Reserved. -- * -- * Permission is hereby granted, free of charge, to any person obtaining a -- * copy of this software and associated documentation files (the "Software"), -- * to deal in the Software without restriction, including without limitation -- * the rights to use, copy, modify, merge, publish, distribute, sublicense, -- * and/or sell copies of the Software, and to permit persons to whom the -- * Software is furnished to do so, subject to the following conditions: -- * -- * The above copyright notice and this permission notice shall be included -- * in all copies or substantial portions of the Software. -- * -- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR -- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -- * OTHER DEALINGS IN THE SOFTWARE. -- --********************************************************************* -- * Begin system-specific stuff. -- -- * WINDOWS: Include windows.h here to define APIENTRY. -- * It is also useful when applications include this file by -- * including only glut.h, since glut.h depends on windows.h. -- * Applications needing to include windows.h with parms other -- * than "WIN32_LEAN_AND_MEAN" may include windows.h before -- * glut.h or gl.h. -- -- "P" suffix to be used for a pointer to a function -- * End system-specific stuff. -- ********************************************************************* -- * Datatypes -- subtype GLenum is unsigned; -- gl.h:116 subtype GLboolean is unsigned_char; -- gl.h:117 subtype GLbitfield is unsigned; -- gl.h:118 subtype GLvoid is System.Address; -- gl.h:119 -- 1-byte signed subtype GLbyte is signed_char; -- gl.h:120 -- 2-byte signed subtype GLshort is short; -- gl.h:121 -- 4-byte signed subtype GLint is int; -- gl.h:122 -- 1-byte unsigned subtype GLubyte is unsigned_char; -- gl.h:123 -- 2-byte unsigned subtype GLushort is unsigned_short; -- gl.h:124 -- 4-byte unsigned subtype GLuint is unsigned; -- gl.h:125 -- 4-byte signed subtype GLsizei is int; -- gl.h:126 -- single precision float subtype GLfloat is float; -- gl.h:127 -- single precision float in [0,1] subtype GLclampf is float; -- gl.h:128 -- double precision float subtype GLdouble is double; -- gl.h:129 -- double precision float in [0,1] subtype GLclampd is double; -- gl.h:130 -- * Constants -- -- Boolean values -- Data types -- Primitives -- Vertex Arrays -- Matrix Mode -- Points -- Lines -- Polygons -- Display Lists -- Depth buffer -- Lighting -- User clipping planes -- Accumulation buffer -- Alpha testing -- Blending -- Render Mode -- Feedback -- Selection -- Fog -- Logic Ops -- Stencil -- Buffers, Pixel Drawing/Reading --GL_FRONT 0x0404 --GL_BACK 0x0405 --GL_FRONT_AND_BACK 0x0408 -- Implementation limits -- Gets -- Evaluators -- Hints -- Scissor box -- Pixel Mode / Transfer -- Texture mapping -- Utility -- Errors -- glPush/PopAttrib bits -- OpenGL 1.1 -- * Miscellaneous -- procedure glClearIndex (c : GLfloat) -- gl.h:743 with Import => True, Convention => C, External_Name => "glClearIndex"; procedure glClearColor (red : GLclampf; green : GLclampf; blue : GLclampf; alpha : GLclampf) -- gl.h:745 with Import => True, Convention => C, External_Name => "glClearColor"; procedure glClear (mask : GLbitfield) -- gl.h:747 with Import => True, Convention => C, External_Name => "glClear"; procedure glIndexMask (mask : GLuint) -- gl.h:749 with Import => True, Convention => C, External_Name => "glIndexMask"; procedure glColorMask (red : GLboolean; green : GLboolean; blue : GLboolean; alpha : GLboolean) -- gl.h:751 with Import => True, Convention => C, External_Name => "glColorMask"; procedure glAlphaFunc (func : GLenum; ref : GLclampf) -- gl.h:753 with Import => True, Convention => C, External_Name => "glAlphaFunc"; procedure glBlendFunc (sfactor : GLenum; dfactor : GLenum) -- gl.h:755 with Import => True, Convention => C, External_Name => "glBlendFunc"; procedure glLogicOp (opcode : GLenum) -- gl.h:757 with Import => True, Convention => C, External_Name => "glLogicOp"; procedure glCullFace (mode : GLenum) -- gl.h:759 with Import => True, Convention => C, External_Name => "glCullFace"; procedure glFrontFace (mode : GLenum) -- gl.h:761 with Import => True, Convention => C, External_Name => "glFrontFace"; procedure glPointSize (size : GLfloat) -- gl.h:763 with Import => True, Convention => C, External_Name => "glPointSize"; procedure glLineWidth (width : GLfloat) -- gl.h:765 with Import => True, Convention => C, External_Name => "glLineWidth"; procedure glLineStipple (factor : GLint; pattern : GLushort) -- gl.h:767 with Import => True, Convention => C, External_Name => "glLineStipple"; procedure glPolygonMode (face : GLenum; mode : GLenum) -- gl.h:769 with Import => True, Convention => C, External_Name => "glPolygonMode"; procedure glPolygonOffset (factor : GLfloat; units : GLfloat) -- gl.h:771 with Import => True, Convention => C, External_Name => "glPolygonOffset"; procedure glPolygonStipple (mask : access GLubyte) -- gl.h:773 with Import => True, Convention => C, External_Name => "glPolygonStipple"; procedure glGetPolygonStipple (mask : access GLubyte) -- gl.h:775 with Import => True, Convention => C, External_Name => "glGetPolygonStipple"; procedure glEdgeFlag (flag : GLboolean) -- gl.h:777 with Import => True, Convention => C, External_Name => "glEdgeFlag"; procedure glEdgeFlagv (flag : access GLboolean) -- gl.h:779 with Import => True, Convention => C, External_Name => "glEdgeFlagv"; procedure glScissor (x : GLint; y : GLint; width : GLsizei; height : GLsizei) -- gl.h:781 with Import => True, Convention => C, External_Name => "glScissor"; procedure glClipPlane (plane : GLenum; equation : access GLdouble) -- gl.h:783 with Import => True, Convention => C, External_Name => "glClipPlane"; procedure glGetClipPlane (plane : GLenum; equation : access GLdouble) -- gl.h:785 with Import => True, Convention => C, External_Name => "glGetClipPlane"; procedure glDrawBuffer (mode : GLenum) -- gl.h:787 with Import => True, Convention => C, External_Name => "glDrawBuffer"; procedure glReadBuffer (mode : GLenum) -- gl.h:789 with Import => True, Convention => C, External_Name => "glReadBuffer"; procedure glEnable (cap : GLenum) -- gl.h:791 with Import => True, Convention => C, External_Name => "glEnable"; procedure glDisable (cap : GLenum) -- gl.h:793 with Import => True, Convention => C, External_Name => "glDisable"; function glIsEnabled (cap : GLenum) return GLboolean -- gl.h:795 with Import => True, Convention => C, External_Name => "glIsEnabled"; -- 1.1 procedure glEnableClientState (cap : GLenum) -- gl.h:798 with Import => True, Convention => C, External_Name => "glEnableClientState"; -- 1.1 procedure glDisableClientState (cap : GLenum) -- gl.h:800 with Import => True, Convention => C, External_Name => "glDisableClientState"; procedure glGetBooleanv (pname : GLenum; params : access GLboolean) -- gl.h:803 with Import => True, Convention => C, External_Name => "glGetBooleanv"; procedure glGetDoublev (pname : GLenum; params : access GLdouble) -- gl.h:805 with Import => True, Convention => C, External_Name => "glGetDoublev"; procedure glGetFloatv (pname : GLenum; params : access GLfloat) -- gl.h:807 with Import => True, Convention => C, External_Name => "glGetFloatv"; procedure glGetIntegerv (pname : GLenum; params : access GLint) -- gl.h:809 with Import => True, Convention => C, External_Name => "glGetIntegerv"; procedure glPushAttrib (mask : GLbitfield) -- gl.h:812 with Import => True, Convention => C, External_Name => "glPushAttrib"; procedure glPopAttrib -- gl.h:814 with Import => True, Convention => C, External_Name => "glPopAttrib"; -- 1.1 procedure glPushClientAttrib (mask : GLbitfield) -- gl.h:817 with Import => True, Convention => C, External_Name => "glPushClientAttrib"; -- 1.1 procedure glPopClientAttrib -- gl.h:819 with Import => True, Convention => C, External_Name => "glPopClientAttrib"; function glRenderMode (mode : GLenum) return GLint -- gl.h:822 with Import => True, Convention => C, External_Name => "glRenderMode"; function glGetError return GLenum -- gl.h:824 with Import => True, Convention => C, External_Name => "glGetError"; -- Troodon: changed return type from access GLubyte function glGetString (name : GLenum) return Interfaces.C.Strings.chars_ptr -- gl.h:826 with Import => True, Convention => C, External_Name => "glGetString"; procedure glFinish -- gl.h:828 with Import => True, Convention => C, External_Name => "glFinish"; procedure glFlush -- gl.h:830 with Import => True, Convention => C, External_Name => "glFlush"; procedure glHint (target : GLenum; mode : GLenum) -- gl.h:832 with Import => True, Convention => C, External_Name => "glHint"; -- * Depth Buffer -- procedure glClearDepth (depth : GLclampd) -- gl.h:839 with Import => True, Convention => C, External_Name => "glClearDepth"; procedure glDepthFunc (func : GLenum) -- gl.h:841 with Import => True, Convention => C, External_Name => "glDepthFunc"; procedure glDepthMask (flag : GLboolean) -- gl.h:843 with Import => True, Convention => C, External_Name => "glDepthMask"; procedure glDepthRange (near_val : GLclampd; far_val : GLclampd) -- gl.h:845 with Import => True, Convention => C, External_Name => "glDepthRange"; -- * Accumulation Buffer -- procedure glClearAccum (red : GLfloat; green : GLfloat; blue : GLfloat; alpha : GLfloat) -- gl.h:852 with Import => True, Convention => C, External_Name => "glClearAccum"; procedure glAccum (op : GLenum; value : GLfloat) -- gl.h:854 with Import => True, Convention => C, External_Name => "glAccum"; -- * Transformation -- procedure glMatrixMode (mode : GLenum) -- gl.h:861 with Import => True, Convention => C, External_Name => "glMatrixMode"; procedure glOrtho (left : GLdouble; right : GLdouble; bottom : GLdouble; top : GLdouble; near_val : GLdouble; far_val : GLdouble) -- gl.h:863 with Import => True, Convention => C, External_Name => "glOrtho"; procedure glFrustum (left : GLdouble; right : GLdouble; bottom : GLdouble; top : GLdouble; near_val : GLdouble; far_val : GLdouble) -- gl.h:867 with Import => True, Convention => C, External_Name => "glFrustum"; procedure glViewport (x : GLint; y : GLint; width : GLsizei; height : GLsizei) -- gl.h:871 with Import => True, Convention => C, External_Name => "glViewport"; procedure glPushMatrix -- gl.h:874 with Import => True, Convention => C, External_Name => "glPushMatrix"; procedure glPopMatrix -- gl.h:876 with Import => True, Convention => C, External_Name => "glPopMatrix"; procedure glLoadIdentity -- gl.h:878 with Import => True, Convention => C, External_Name => "glLoadIdentity"; procedure glLoadMatrixd (m : access GLdouble) -- gl.h:880 with Import => True, Convention => C, External_Name => "glLoadMatrixd"; procedure glLoadMatrixf (m : access GLfloat) -- gl.h:881 with Import => True, Convention => C, External_Name => "glLoadMatrixf"; procedure glMultMatrixd (m : access GLdouble) -- gl.h:883 with Import => True, Convention => C, External_Name => "glMultMatrixd"; procedure glMultMatrixf (m : access GLfloat) -- gl.h:884 with Import => True, Convention => C, External_Name => "glMultMatrixf"; procedure glRotated (angle : GLdouble; x : GLdouble; y : GLdouble; z : GLdouble) -- gl.h:886 with Import => True, Convention => C, External_Name => "glRotated"; procedure glRotatef (angle : GLfloat; x : GLfloat; y : GLfloat; z : GLfloat) -- gl.h:888 with Import => True, Convention => C, External_Name => "glRotatef"; procedure glScaled (x : GLdouble; y : GLdouble; z : GLdouble) -- gl.h:891 with Import => True, Convention => C, External_Name => "glScaled"; procedure glScalef (x : GLfloat; y : GLfloat; z : GLfloat) -- gl.h:892 with Import => True, Convention => C, External_Name => "glScalef"; procedure glTranslated (x : GLdouble; y : GLdouble; z : GLdouble) -- gl.h:894 with Import => True, Convention => C, External_Name => "glTranslated"; procedure glTranslatef (x : GLfloat; y : GLfloat; z : GLfloat) -- gl.h:895 with Import => True, Convention => C, External_Name => "glTranslatef"; -- * Display Lists -- function glIsList (list : GLuint) return GLboolean -- gl.h:902 with Import => True, Convention => C, External_Name => "glIsList"; procedure glDeleteLists (list : GLuint; c_range : GLsizei) -- gl.h:904 with Import => True, Convention => C, External_Name => "glDeleteLists"; function glGenLists (c_range : GLsizei) return GLuint -- gl.h:906 with Import => True, Convention => C, External_Name => "glGenLists"; procedure glNewList (list : GLuint; mode : GLenum) -- gl.h:908 with Import => True, Convention => C, External_Name => "glNewList"; procedure glEndList -- gl.h:910 with Import => True, Convention => C, External_Name => "glEndList"; procedure glCallList (list : GLuint) -- gl.h:912 with Import => True, Convention => C, External_Name => "glCallList"; procedure glCallLists (n : GLsizei; c_type : GLenum; lists : System.Address) -- gl.h:914 with Import => True, Convention => C, External_Name => "glCallLists"; procedure glListBase (base : GLuint) -- gl.h:917 with Import => True, Convention => C, External_Name => "glListBase"; -- * Drawing Functions -- procedure glBegin (mode : GLenum) -- gl.h:924 with Import => True, Convention => C, External_Name => "glBegin"; procedure glEnd -- gl.h:926 with Import => True, Convention => C, External_Name => "glEnd"; procedure glVertex2d (x : GLdouble; y : GLdouble) -- gl.h:929 with Import => True, Convention => C, External_Name => "glVertex2d"; procedure glVertex2f (x : GLfloat; y : GLfloat) -- gl.h:930 with Import => True, Convention => C, External_Name => "glVertex2f"; procedure glVertex2i (x : GLint; y : GLint) -- gl.h:931 with Import => True, Convention => C, External_Name => "glVertex2i"; procedure glVertex2s (x : GLshort; y : GLshort) -- gl.h:932 with Import => True, Convention => C, External_Name => "glVertex2s"; procedure glVertex3d (x : GLdouble; y : GLdouble; z : GLdouble) -- gl.h:934 with Import => True, Convention => C, External_Name => "glVertex3d"; procedure glVertex3f (x : GLfloat; y : GLfloat; z : GLfloat) -- gl.h:935 with Import => True, Convention => C, External_Name => "glVertex3f"; procedure glVertex3i (x : GLint; y : GLint; z : GLint) -- gl.h:936 with Import => True, Convention => C, External_Name => "glVertex3i"; procedure glVertex3s (x : GLshort; y : GLshort; z : GLshort) -- gl.h:937 with Import => True, Convention => C, External_Name => "glVertex3s"; procedure glVertex4d (x : GLdouble; y : GLdouble; z : GLdouble; w : GLdouble) -- gl.h:939 with Import => True, Convention => C, External_Name => "glVertex4d"; procedure glVertex4f (x : GLfloat; y : GLfloat; z : GLfloat; w : GLfloat) -- gl.h:940 with Import => True, Convention => C, External_Name => "glVertex4f"; procedure glVertex4i (x : GLint; y : GLint; z : GLint; w : GLint) -- gl.h:941 with Import => True, Convention => C, External_Name => "glVertex4i"; procedure glVertex4s (x : GLshort; y : GLshort; z : GLshort; w : GLshort) -- gl.h:942 with Import => True, Convention => C, External_Name => "glVertex4s"; procedure glVertex2dv (v : access GLdouble) -- gl.h:944 with Import => True, Convention => C, External_Name => "glVertex2dv"; procedure glVertex2fv (v : access GLfloat) -- gl.h:945 with Import => True, Convention => C, External_Name => "glVertex2fv"; procedure glVertex2iv (v : access GLint) -- gl.h:946 with Import => True, Convention => C, External_Name => "glVertex2iv"; procedure glVertex2sv (v : access GLshort) -- gl.h:947 with Import => True, Convention => C, External_Name => "glVertex2sv"; procedure glVertex3dv (v : access GLdouble) -- gl.h:949 with Import => True, Convention => C, External_Name => "glVertex3dv"; procedure glVertex3fv (v : access GLfloat) -- gl.h:950 with Import => True, Convention => C, External_Name => "glVertex3fv"; procedure glVertex3iv (v : access GLint) -- gl.h:951 with Import => True, Convention => C, External_Name => "glVertex3iv"; procedure glVertex3sv (v : access GLshort) -- gl.h:952 with Import => True, Convention => C, External_Name => "glVertex3sv"; procedure glVertex4dv (v : access GLdouble) -- gl.h:954 with Import => True, Convention => C, External_Name => "glVertex4dv"; procedure glVertex4fv (v : access GLfloat) -- gl.h:955 with Import => True, Convention => C, External_Name => "glVertex4fv"; procedure glVertex4iv (v : access GLint) -- gl.h:956 with Import => True, Convention => C, External_Name => "glVertex4iv"; procedure glVertex4sv (v : access GLshort) -- gl.h:957 with Import => True, Convention => C, External_Name => "glVertex4sv"; procedure glNormal3b (nx : GLbyte; ny : GLbyte; nz : GLbyte) -- gl.h:960 with Import => True, Convention => C, External_Name => "glNormal3b"; procedure glNormal3d (nx : GLdouble; ny : GLdouble; nz : GLdouble) -- gl.h:961 with Import => True, Convention => C, External_Name => "glNormal3d"; procedure glNormal3f (nx : GLfloat; ny : GLfloat; nz : GLfloat) -- gl.h:962 with Import => True, Convention => C, External_Name => "glNormal3f"; procedure glNormal3i (nx : GLint; ny : GLint; nz : GLint) -- gl.h:963 with Import => True, Convention => C, External_Name => "glNormal3i"; procedure glNormal3s (nx : GLshort; ny : GLshort; nz : GLshort) -- gl.h:964 with Import => True, Convention => C, External_Name => "glNormal3s"; procedure glNormal3bv (v : access GLbyte) -- gl.h:966 with Import => True, Convention => C, External_Name => "glNormal3bv"; procedure glNormal3dv (v : access GLdouble) -- gl.h:967 with Import => True, Convention => C, External_Name => "glNormal3dv"; procedure glNormal3fv (v : access GLfloat) -- gl.h:968 with Import => True, Convention => C, External_Name => "glNormal3fv"; procedure glNormal3iv (v : access GLint) -- gl.h:969 with Import => True, Convention => C, External_Name => "glNormal3iv"; procedure glNormal3sv (v : access GLshort) -- gl.h:970 with Import => True, Convention => C, External_Name => "glNormal3sv"; procedure glIndexd (c : GLdouble) -- gl.h:973 with Import => True, Convention => C, External_Name => "glIndexd"; procedure glIndexf (c : GLfloat) -- gl.h:974 with Import => True, Convention => C, External_Name => "glIndexf"; procedure glIndexi (c : GLint) -- gl.h:975 with Import => True, Convention => C, External_Name => "glIndexi"; procedure glIndexs (c : GLshort) -- gl.h:976 with Import => True, Convention => C, External_Name => "glIndexs"; -- 1.1 procedure glIndexub (c : GLubyte) -- gl.h:977 with Import => True, Convention => C, External_Name => "glIndexub"; procedure glIndexdv (c : access GLdouble) -- gl.h:979 with Import => True, Convention => C, External_Name => "glIndexdv"; procedure glIndexfv (c : access GLfloat) -- gl.h:980 with Import => True, Convention => C, External_Name => "glIndexfv"; procedure glIndexiv (c : access GLint) -- gl.h:981 with Import => True, Convention => C, External_Name => "glIndexiv"; procedure glIndexsv (c : access GLshort) -- gl.h:982 with Import => True, Convention => C, External_Name => "glIndexsv"; -- 1.1 procedure glIndexubv (c : access GLubyte) -- gl.h:983 with Import => True, Convention => C, External_Name => "glIndexubv"; procedure glColor3b (red : GLbyte; green : GLbyte; blue : GLbyte) -- gl.h:985 with Import => True, Convention => C, External_Name => "glColor3b"; procedure glColor3d (red : GLdouble; green : GLdouble; blue : GLdouble) -- gl.h:986 with Import => True, Convention => C, External_Name => "glColor3d"; procedure glColor3f (red : GLfloat; green : GLfloat; blue : GLfloat) -- gl.h:987 with Import => True, Convention => C, External_Name => "glColor3f"; procedure glColor3i (red : GLint; green : GLint; blue : GLint) -- gl.h:988 with Import => True, Convention => C, External_Name => "glColor3i"; procedure glColor3s (red : GLshort; green : GLshort; blue : GLshort) -- gl.h:989 with Import => True, Convention => C, External_Name => "glColor3s"; procedure glColor3ub (red : GLubyte; green : GLubyte; blue : GLubyte) -- gl.h:990 with Import => True, Convention => C, External_Name => "glColor3ub"; procedure glColor3ui (red : GLuint; green : GLuint; blue : GLuint) -- gl.h:991 with Import => True, Convention => C, External_Name => "glColor3ui"; procedure glColor3us (red : GLushort; green : GLushort; blue : GLushort) -- gl.h:992 with Import => True, Convention => C, External_Name => "glColor3us"; procedure glColor4b (red : GLbyte; green : GLbyte; blue : GLbyte; alpha : GLbyte) -- gl.h:994 with Import => True, Convention => C, External_Name => "glColor4b"; procedure glColor4d (red : GLdouble; green : GLdouble; blue : GLdouble; alpha : GLdouble) -- gl.h:996 with Import => True, Convention => C, External_Name => "glColor4d"; procedure glColor4f (red : GLfloat; green : GLfloat; blue : GLfloat; alpha : GLfloat) -- gl.h:998 with Import => True, Convention => C, External_Name => "glColor4f"; procedure glColor4i (red : GLint; green : GLint; blue : GLint; alpha : GLint) -- gl.h:1000 with Import => True, Convention => C, External_Name => "glColor4i"; procedure glColor4s (red : GLshort; green : GLshort; blue : GLshort; alpha : GLshort) -- gl.h:1002 with Import => True, Convention => C, External_Name => "glColor4s"; procedure glColor4ub (red : GLubyte; green : GLubyte; blue : GLubyte; alpha : GLubyte) -- gl.h:1004 with Import => True, Convention => C, External_Name => "glColor4ub"; procedure glColor4ui (red : GLuint; green : GLuint; blue : GLuint; alpha : GLuint) -- gl.h:1006 with Import => True, Convention => C, External_Name => "glColor4ui"; procedure glColor4us (red : GLushort; green : GLushort; blue : GLushort; alpha : GLushort) -- gl.h:1008 with Import => True, Convention => C, External_Name => "glColor4us"; procedure glColor3bv (v : access GLbyte) -- gl.h:1012 with Import => True, Convention => C, External_Name => "glColor3bv"; procedure glColor3dv (v : access GLdouble) -- gl.h:1013 with Import => True, Convention => C, External_Name => "glColor3dv"; procedure glColor3fv (v : access GLfloat) -- gl.h:1014 with Import => True, Convention => C, External_Name => "glColor3fv"; procedure glColor3iv (v : access GLint) -- gl.h:1015 with Import => True, Convention => C, External_Name => "glColor3iv"; procedure glColor3sv (v : access GLshort) -- gl.h:1016 with Import => True, Convention => C, External_Name => "glColor3sv"; procedure glColor3ubv (v : access GLubyte) -- gl.h:1017 with Import => True, Convention => C, External_Name => "glColor3ubv"; procedure glColor3uiv (v : access GLuint) -- gl.h:1018 with Import => True, Convention => C, External_Name => "glColor3uiv"; procedure glColor3usv (v : access GLushort) -- gl.h:1019 with Import => True, Convention => C, External_Name => "glColor3usv"; procedure glColor4bv (v : access GLbyte) -- gl.h:1021 with Import => True, Convention => C, External_Name => "glColor4bv"; procedure glColor4dv (v : access GLdouble) -- gl.h:1022 with Import => True, Convention => C, External_Name => "glColor4dv"; procedure glColor4fv (v : access GLfloat) -- gl.h:1023 with Import => True, Convention => C, External_Name => "glColor4fv"; procedure glColor4iv (v : access GLint) -- gl.h:1024 with Import => True, Convention => C, External_Name => "glColor4iv"; procedure glColor4sv (v : access GLshort) -- gl.h:1025 with Import => True, Convention => C, External_Name => "glColor4sv"; procedure glColor4ubv (v : access GLubyte) -- gl.h:1026 with Import => True, Convention => C, External_Name => "glColor4ubv"; procedure glColor4uiv (v : access GLuint) -- gl.h:1027 with Import => True, Convention => C, External_Name => "glColor4uiv"; procedure glColor4usv (v : access GLushort) -- gl.h:1028 with Import => True, Convention => C, External_Name => "glColor4usv"; procedure glTexCoord1d (s : GLdouble) -- gl.h:1031 with Import => True, Convention => C, External_Name => "glTexCoord1d"; procedure glTexCoord1f (s : GLfloat) -- gl.h:1032 with Import => True, Convention => C, External_Name => "glTexCoord1f"; procedure glTexCoord1i (s : GLint) -- gl.h:1033 with Import => True, Convention => C, External_Name => "glTexCoord1i"; procedure glTexCoord1s (s : GLshort) -- gl.h:1034 with Import => True, Convention => C, External_Name => "glTexCoord1s"; procedure glTexCoord2d (s : GLdouble; t : GLdouble) -- gl.h:1036 with Import => True, Convention => C, External_Name => "glTexCoord2d"; procedure glTexCoord2f (s : GLfloat; t : GLfloat) -- gl.h:1037 with Import => True, Convention => C, External_Name => "glTexCoord2f"; procedure glTexCoord2i (s : GLint; t : GLint) -- gl.h:1038 with Import => True, Convention => C, External_Name => "glTexCoord2i"; procedure glTexCoord2s (s : GLshort; t : GLshort) -- gl.h:1039 with Import => True, Convention => C, External_Name => "glTexCoord2s"; procedure glTexCoord3d (s : GLdouble; t : GLdouble; r : GLdouble) -- gl.h:1041 with Import => True, Convention => C, External_Name => "glTexCoord3d"; procedure glTexCoord3f (s : GLfloat; t : GLfloat; r : GLfloat) -- gl.h:1042 with Import => True, Convention => C, External_Name => "glTexCoord3f"; procedure glTexCoord3i (s : GLint; t : GLint; r : GLint) -- gl.h:1043 with Import => True, Convention => C, External_Name => "glTexCoord3i"; procedure glTexCoord3s (s : GLshort; t : GLshort; r : GLshort) -- gl.h:1044 with Import => True, Convention => C, External_Name => "glTexCoord3s"; procedure glTexCoord4d (s : GLdouble; t : GLdouble; r : GLdouble; q : GLdouble) -- gl.h:1046 with Import => True, Convention => C, External_Name => "glTexCoord4d"; procedure glTexCoord4f (s : GLfloat; t : GLfloat; r : GLfloat; q : GLfloat) -- gl.h:1047 with Import => True, Convention => C, External_Name => "glTexCoord4f"; procedure glTexCoord4i (s : GLint; t : GLint; r : GLint; q : GLint) -- gl.h:1048 with Import => True, Convention => C, External_Name => "glTexCoord4i"; procedure glTexCoord4s (s : GLshort; t : GLshort; r : GLshort; q : GLshort) -- gl.h:1049 with Import => True, Convention => C, External_Name => "glTexCoord4s"; procedure glTexCoord1dv (v : access GLdouble) -- gl.h:1051 with Import => True, Convention => C, External_Name => "glTexCoord1dv"; procedure glTexCoord1fv (v : access GLfloat) -- gl.h:1052 with Import => True, Convention => C, External_Name => "glTexCoord1fv"; procedure glTexCoord1iv (v : access GLint) -- gl.h:1053 with Import => True, Convention => C, External_Name => "glTexCoord1iv"; procedure glTexCoord1sv (v : access GLshort) -- gl.h:1054 with Import => True, Convention => C, External_Name => "glTexCoord1sv"; procedure glTexCoord2dv (v : access GLdouble) -- gl.h:1056 with Import => True, Convention => C, External_Name => "glTexCoord2dv"; procedure glTexCoord2fv (v : access GLfloat) -- gl.h:1057 with Import => True, Convention => C, External_Name => "glTexCoord2fv"; procedure glTexCoord2iv (v : access GLint) -- gl.h:1058 with Import => True, Convention => C, External_Name => "glTexCoord2iv"; procedure glTexCoord2sv (v : access GLshort) -- gl.h:1059 with Import => True, Convention => C, External_Name => "glTexCoord2sv"; procedure glTexCoord3dv (v : access GLdouble) -- gl.h:1061 with Import => True, Convention => C, External_Name => "glTexCoord3dv"; procedure glTexCoord3fv (v : access GLfloat) -- gl.h:1062 with Import => True, Convention => C, External_Name => "glTexCoord3fv"; procedure glTexCoord3iv (v : access GLint) -- gl.h:1063 with Import => True, Convention => C, External_Name => "glTexCoord3iv"; procedure glTexCoord3sv (v : access GLshort) -- gl.h:1064 with Import => True, Convention => C, External_Name => "glTexCoord3sv"; procedure glTexCoord4dv (v : access GLdouble) -- gl.h:1066 with Import => True, Convention => C, External_Name => "glTexCoord4dv"; procedure glTexCoord4fv (v : access GLfloat) -- gl.h:1067 with Import => True, Convention => C, External_Name => "glTexCoord4fv"; procedure glTexCoord4iv (v : access GLint) -- gl.h:1068 with Import => True, Convention => C, External_Name => "glTexCoord4iv"; procedure glTexCoord4sv (v : access GLshort) -- gl.h:1069 with Import => True, Convention => C, External_Name => "glTexCoord4sv"; procedure glRasterPos2d (x : GLdouble; y : GLdouble) -- gl.h:1072 with Import => True, Convention => C, External_Name => "glRasterPos2d"; procedure glRasterPos2f (x : GLfloat; y : GLfloat) -- gl.h:1073 with Import => True, Convention => C, External_Name => "glRasterPos2f"; procedure glRasterPos2i (x : GLint; y : GLint) -- gl.h:1074 with Import => True, Convention => C, External_Name => "glRasterPos2i"; procedure glRasterPos2s (x : GLshort; y : GLshort) -- gl.h:1075 with Import => True, Convention => C, External_Name => "glRasterPos2s"; procedure glRasterPos3d (x : GLdouble; y : GLdouble; z : GLdouble) -- gl.h:1077 with Import => True, Convention => C, External_Name => "glRasterPos3d"; procedure glRasterPos3f (x : GLfloat; y : GLfloat; z : GLfloat) -- gl.h:1078 with Import => True, Convention => C, External_Name => "glRasterPos3f"; procedure glRasterPos3i (x : GLint; y : GLint; z : GLint) -- gl.h:1079 with Import => True, Convention => C, External_Name => "glRasterPos3i"; procedure glRasterPos3s (x : GLshort; y : GLshort; z : GLshort) -- gl.h:1080 with Import => True, Convention => C, External_Name => "glRasterPos3s"; procedure glRasterPos4d (x : GLdouble; y : GLdouble; z : GLdouble; w : GLdouble) -- gl.h:1082 with Import => True, Convention => C, External_Name => "glRasterPos4d"; procedure glRasterPos4f (x : GLfloat; y : GLfloat; z : GLfloat; w : GLfloat) -- gl.h:1083 with Import => True, Convention => C, External_Name => "glRasterPos4f"; procedure glRasterPos4i (x : GLint; y : GLint; z : GLint; w : GLint) -- gl.h:1084 with Import => True, Convention => C, External_Name => "glRasterPos4i"; procedure glRasterPos4s (x : GLshort; y : GLshort; z : GLshort; w : GLshort) -- gl.h:1085 with Import => True, Convention => C, External_Name => "glRasterPos4s"; procedure glRasterPos2dv (v : access GLdouble) -- gl.h:1087 with Import => True, Convention => C, External_Name => "glRasterPos2dv"; procedure glRasterPos2fv (v : access GLfloat) -- gl.h:1088 with Import => True, Convention => C, External_Name => "glRasterPos2fv"; procedure glRasterPos2iv (v : access GLint) -- gl.h:1089 with Import => True, Convention => C, External_Name => "glRasterPos2iv"; procedure glRasterPos2sv (v : access GLshort) -- gl.h:1090 with Import => True, Convention => C, External_Name => "glRasterPos2sv"; procedure glRasterPos3dv (v : access GLdouble) -- gl.h:1092 with Import => True, Convention => C, External_Name => "glRasterPos3dv"; procedure glRasterPos3fv (v : access GLfloat) -- gl.h:1093 with Import => True, Convention => C, External_Name => "glRasterPos3fv"; procedure glRasterPos3iv (v : access GLint) -- gl.h:1094 with Import => True, Convention => C, External_Name => "glRasterPos3iv"; procedure glRasterPos3sv (v : access GLshort) -- gl.h:1095 with Import => True, Convention => C, External_Name => "glRasterPos3sv"; procedure glRasterPos4dv (v : access GLdouble) -- gl.h:1097 with Import => True, Convention => C, External_Name => "glRasterPos4dv"; procedure glRasterPos4fv (v : access GLfloat) -- gl.h:1098 with Import => True, Convention => C, External_Name => "glRasterPos4fv"; procedure glRasterPos4iv (v : access GLint) -- gl.h:1099 with Import => True, Convention => C, External_Name => "glRasterPos4iv"; procedure glRasterPos4sv (v : access GLshort) -- gl.h:1100 with Import => True, Convention => C, External_Name => "glRasterPos4sv"; procedure glRectd (x1 : GLdouble; y1 : GLdouble; x2 : GLdouble; y2 : GLdouble) -- gl.h:1103 with Import => True, Convention => C, External_Name => "glRectd"; procedure glRectf (x1 : GLfloat; y1 : GLfloat; x2 : GLfloat; y2 : GLfloat) -- gl.h:1104 with Import => True, Convention => C, External_Name => "glRectf"; procedure glRecti (x1 : GLint; y1 : GLint; x2 : GLint; y2 : GLint) -- gl.h:1105 with Import => True, Convention => C, External_Name => "glRecti"; procedure glRects (x1 : GLshort; y1 : GLshort; x2 : GLshort; y2 : GLshort) -- gl.h:1106 with Import => True, Convention => C, External_Name => "glRects"; procedure glRectdv (v1 : access GLdouble; v2 : access GLdouble) -- gl.h:1109 with Import => True, Convention => C, External_Name => "glRectdv"; procedure glRectfv (v1 : access GLfloat; v2 : access GLfloat) -- gl.h:1110 with Import => True, Convention => C, External_Name => "glRectfv"; procedure glRectiv (v1 : access GLint; v2 : access GLint) -- gl.h:1111 with Import => True, Convention => C, External_Name => "glRectiv"; procedure glRectsv (v1 : access GLshort; v2 : access GLshort) -- gl.h:1112 with Import => True, Convention => C, External_Name => "glRectsv"; -- * Vertex Arrays (1.1) -- procedure glVertexPointer (size : GLint; c_type : GLenum; stride : GLsizei; ptr : System.Address) -- gl.h:1119 with Import => True, Convention => C, External_Name => "glVertexPointer"; procedure glNormalPointer (c_type : GLenum; stride : GLsizei; ptr : System.Address) -- gl.h:1122 with Import => True, Convention => C, External_Name => "glNormalPointer"; procedure glColorPointer (size : GLint; c_type : GLenum; stride : GLsizei; ptr : System.Address) -- gl.h:1125 with Import => True, Convention => C, External_Name => "glColorPointer"; procedure glIndexPointer (c_type : GLenum; stride : GLsizei; ptr : System.Address) -- gl.h:1128 with Import => True, Convention => C, External_Name => "glIndexPointer"; procedure glTexCoordPointer (size : GLint; c_type : GLenum; stride : GLsizei; ptr : System.Address) -- gl.h:1131 with Import => True, Convention => C, External_Name => "glTexCoordPointer"; procedure glEdgeFlagPointer (stride : GLsizei; ptr : System.Address) -- gl.h:1134 with Import => True, Convention => C, External_Name => "glEdgeFlagPointer"; procedure glGetPointerv (pname : GLenum; params : System.Address) -- gl.h:1136 with Import => True, Convention => C, External_Name => "glGetPointerv"; procedure glArrayElement (i : GLint) -- gl.h:1138 with Import => True, Convention => C, External_Name => "glArrayElement"; procedure glDrawArrays (mode : GLenum; first : GLint; count : GLsizei) -- gl.h:1140 with Import => True, Convention => C, External_Name => "glDrawArrays"; procedure glDrawElements (mode : GLenum; count : GLsizei; c_type : GLenum; indices : System.Address) -- gl.h:1142 with Import => True, Convention => C, External_Name => "glDrawElements"; procedure glInterleavedArrays (format : GLenum; stride : GLsizei; pointer : System.Address) -- gl.h:1145 with Import => True, Convention => C, External_Name => "glInterleavedArrays"; -- * Lighting -- procedure glShadeModel (mode : GLenum) -- gl.h:1152 with Import => True, Convention => C, External_Name => "glShadeModel"; procedure glLightf (light : GLenum; pname : GLenum; param : GLfloat) -- gl.h:1154 with Import => True, Convention => C, External_Name => "glLightf"; procedure glLighti (light : GLenum; pname : GLenum; param : GLint) -- gl.h:1155 with Import => True, Convention => C, External_Name => "glLighti"; procedure glLightfv (light : GLenum; pname : GLenum; params : access GLfloat) -- gl.h:1156 with Import => True, Convention => C, External_Name => "glLightfv"; procedure glLightiv (light : GLenum; pname : GLenum; params : access GLint) -- gl.h:1158 with Import => True, Convention => C, External_Name => "glLightiv"; procedure glGetLightfv (light : GLenum; pname : GLenum; params : access GLfloat) -- gl.h:1161 with Import => True, Convention => C, External_Name => "glGetLightfv"; procedure glGetLightiv (light : GLenum; pname : GLenum; params : access GLint) -- gl.h:1163 with Import => True, Convention => C, External_Name => "glGetLightiv"; procedure glLightModelf (pname : GLenum; param : GLfloat) -- gl.h:1166 with Import => True, Convention => C, External_Name => "glLightModelf"; procedure glLightModeli (pname : GLenum; param : GLint) -- gl.h:1167 with Import => True, Convention => C, External_Name => "glLightModeli"; procedure glLightModelfv (pname : GLenum; params : access GLfloat) -- gl.h:1168 with Import => True, Convention => C, External_Name => "glLightModelfv"; procedure glLightModeliv (pname : GLenum; params : access GLint) -- gl.h:1169 with Import => True, Convention => C, External_Name => "glLightModeliv"; procedure glMaterialf (face : GLenum; pname : GLenum; param : GLfloat) -- gl.h:1171 with Import => True, Convention => C, External_Name => "glMaterialf"; procedure glMateriali (face : GLenum; pname : GLenum; param : GLint) -- gl.h:1172 with Import => True, Convention => C, External_Name => "glMateriali"; procedure glMaterialfv (face : GLenum; pname : GLenum; params : access GLfloat) -- gl.h:1173 with Import => True, Convention => C, External_Name => "glMaterialfv"; procedure glMaterialiv (face : GLenum; pname : GLenum; params : access GLint) -- gl.h:1174 with Import => True, Convention => C, External_Name => "glMaterialiv"; procedure glGetMaterialfv (face : GLenum; pname : GLenum; params : access GLfloat) -- gl.h:1176 with Import => True, Convention => C, External_Name => "glGetMaterialfv"; procedure glGetMaterialiv (face : GLenum; pname : GLenum; params : access GLint) -- gl.h:1177 with Import => True, Convention => C, External_Name => "glGetMaterialiv"; procedure glColorMaterial (face : GLenum; mode : GLenum) -- gl.h:1179 with Import => True, Convention => C, External_Name => "glColorMaterial"; -- * Raster functions -- procedure glPixelZoom (xfactor : GLfloat; yfactor : GLfloat) -- gl.h:1186 with Import => True, Convention => C, External_Name => "glPixelZoom"; procedure glPixelStoref (pname : GLenum; param : GLfloat) -- gl.h:1188 with Import => True, Convention => C, External_Name => "glPixelStoref"; procedure glPixelStorei (pname : GLenum; param : GLint) -- gl.h:1189 with Import => True, Convention => C, External_Name => "glPixelStorei"; procedure glPixelTransferf (pname : GLenum; param : GLfloat) -- gl.h:1191 with Import => True, Convention => C, External_Name => "glPixelTransferf"; procedure glPixelTransferi (pname : GLenum; param : GLint) -- gl.h:1192 with Import => True, Convention => C, External_Name => "glPixelTransferi"; procedure glPixelMapfv (map : GLenum; mapsize : GLsizei; values : access GLfloat) -- gl.h:1194 with Import => True, Convention => C, External_Name => "glPixelMapfv"; procedure glPixelMapuiv (map : GLenum; mapsize : GLsizei; values : access GLuint) -- gl.h:1196 with Import => True, Convention => C, External_Name => "glPixelMapuiv"; procedure glPixelMapusv (map : GLenum; mapsize : GLsizei; values : access GLushort) -- gl.h:1198 with Import => True, Convention => C, External_Name => "glPixelMapusv"; procedure glGetPixelMapfv (map : GLenum; values : access GLfloat) -- gl.h:1201 with Import => True, Convention => C, External_Name => "glGetPixelMapfv"; procedure glGetPixelMapuiv (map : GLenum; values : access GLuint) -- gl.h:1202 with Import => True, Convention => C, External_Name => "glGetPixelMapuiv"; procedure glGetPixelMapusv (map : GLenum; values : access GLushort) -- gl.h:1203 with Import => True, Convention => C, External_Name => "glGetPixelMapusv"; procedure glBitmap (width : GLsizei; height : GLsizei; xorig : GLfloat; yorig : GLfloat; xmove : GLfloat; ymove : GLfloat; bitmap : access GLubyte) -- gl.h:1205 with Import => True, Convention => C, External_Name => "glBitmap"; procedure glReadPixels (x : GLint; y : GLint; width : GLsizei; height : GLsizei; format : GLenum; c_type : GLenum; pixels : System.Address) -- gl.h:1210 with Import => True, Convention => C, External_Name => "glReadPixels"; procedure glDrawPixels (width : GLsizei; height : GLsizei; format : GLenum; c_type : GLenum; pixels : System.Address) -- gl.h:1215 with Import => True, Convention => C, External_Name => "glDrawPixels"; procedure glCopyPixels (x : GLint; y : GLint; width : GLsizei; height : GLsizei; c_type : GLenum) -- gl.h:1219 with Import => True, Convention => C, External_Name => "glCopyPixels"; -- * Stenciling -- procedure glStencilFunc (func : GLenum; ref : GLint; mask : GLuint) -- gl.h:1227 with Import => True, Convention => C, External_Name => "glStencilFunc"; procedure glStencilMask (mask : GLuint) -- gl.h:1229 with Import => True, Convention => C, External_Name => "glStencilMask"; procedure glStencilOp (fail : GLenum; zfail : GLenum; zpass : GLenum) -- gl.h:1231 with Import => True, Convention => C, External_Name => "glStencilOp"; procedure glClearStencil (s : GLint) -- gl.h:1233 with Import => True, Convention => C, External_Name => "glClearStencil"; -- * Texture mapping -- procedure glTexGend (coord : GLenum; pname : GLenum; param : GLdouble) -- gl.h:1241 with Import => True, Convention => C, External_Name => "glTexGend"; procedure glTexGenf (coord : GLenum; pname : GLenum; param : GLfloat) -- gl.h:1242 with Import => True, Convention => C, External_Name => "glTexGenf"; procedure glTexGeni (coord : GLenum; pname : GLenum; param : GLint) -- gl.h:1243 with Import => True, Convention => C, External_Name => "glTexGeni"; procedure glTexGendv (coord : GLenum; pname : GLenum; params : access GLdouble) -- gl.h:1245 with Import => True, Convention => C, External_Name => "glTexGendv"; procedure glTexGenfv (coord : GLenum; pname : GLenum; params : access GLfloat) -- gl.h:1246 with Import => True, Convention => C, External_Name => "glTexGenfv"; procedure glTexGeniv (coord : GLenum; pname : GLenum; params : access GLint) -- gl.h:1247 with Import => True, Convention => C, External_Name => "glTexGeniv"; procedure glGetTexGendv (coord : GLenum; pname : GLenum; params : access GLdouble) -- gl.h:1249 with Import => True, Convention => C, External_Name => "glGetTexGendv"; procedure glGetTexGenfv (coord : GLenum; pname : GLenum; params : access GLfloat) -- gl.h:1250 with Import => True, Convention => C, External_Name => "glGetTexGenfv"; procedure glGetTexGeniv (coord : GLenum; pname : GLenum; params : access GLint) -- gl.h:1251 with Import => True, Convention => C, External_Name => "glGetTexGeniv"; procedure glTexEnvf (target : GLenum; pname : GLenum; param : GLfloat) -- gl.h:1254 with Import => True, Convention => C, External_Name => "glTexEnvf"; procedure glTexEnvi (target : GLenum; pname : GLenum; param : GLint) -- gl.h:1255 with Import => True, Convention => C, External_Name => "glTexEnvi"; procedure glTexEnvfv (target : GLenum; pname : GLenum; params : access GLfloat) -- gl.h:1257 with Import => True, Convention => C, External_Name => "glTexEnvfv"; procedure glTexEnviv (target : GLenum; pname : GLenum; params : access GLint) -- gl.h:1258 with Import => True, Convention => C, External_Name => "glTexEnviv"; procedure glGetTexEnvfv (target : GLenum; pname : GLenum; params : access GLfloat) -- gl.h:1260 with Import => True, Convention => C, External_Name => "glGetTexEnvfv"; procedure glGetTexEnviv (target : GLenum; pname : GLenum; params : access GLint) -- gl.h:1261 with Import => True, Convention => C, External_Name => "glGetTexEnviv"; procedure glTexParameterf (target : GLenum; pname : GLenum; param : GLfloat) -- gl.h:1264 with Import => True, Convention => C, External_Name => "glTexParameterf"; procedure glTexParameteri (target : GLenum; pname : GLenum; param : GLint) -- gl.h:1265 with Import => True, Convention => C, External_Name => "glTexParameteri"; procedure glTexParameterfv (target : GLenum; pname : GLenum; params : access GLfloat) -- gl.h:1267 with Import => True, Convention => C, External_Name => "glTexParameterfv"; procedure glTexParameteriv (target : GLenum; pname : GLenum; params : access GLint) -- gl.h:1269 with Import => True, Convention => C, External_Name => "glTexParameteriv"; procedure glGetTexParameterfv (target : GLenum; pname : GLenum; params : access GLfloat) -- gl.h:1272 with Import => True, Convention => C, External_Name => "glGetTexParameterfv"; procedure glGetTexParameteriv (target : GLenum; pname : GLenum; params : access GLint) -- gl.h:1274 with Import => True, Convention => C, External_Name => "glGetTexParameteriv"; procedure glGetTexLevelParameterfv (target : GLenum; level : GLint; pname : GLenum; params : access GLfloat) -- gl.h:1277 with Import => True, Convention => C, External_Name => "glGetTexLevelParameterfv"; procedure glGetTexLevelParameteriv (target : GLenum; level : GLint; pname : GLenum; params : access GLint) -- gl.h:1279 with Import => True, Convention => C, External_Name => "glGetTexLevelParameteriv"; procedure glTexImage1D (target : GLenum; level : GLint; internalFormat : GLint; width : GLsizei; border : GLint; format : GLenum; c_type : GLenum; pixels : System.Address) -- gl.h:1283 with Import => True, Convention => C, External_Name => "glTexImage1D"; procedure glTexImage2D (target : GLenum; level : GLint; internalFormat : GLint; width : GLsizei; height : GLsizei; border : GLint; format : GLenum; c_type : GLenum; pixels : System.Address) -- gl.h:1289 with Import => True, Convention => C, External_Name => "glTexImage2D"; procedure glGetTexImage (target : GLenum; level : GLint; format : GLenum; c_type : GLenum; pixels : System.Address) -- gl.h:1295 with Import => True, Convention => C, External_Name => "glGetTexImage"; -- 1.1 functions procedure glGenTextures (n : GLsizei; textures : access GLuint) -- gl.h:1302 with Import => True, Convention => C, External_Name => "glGenTextures"; procedure glDeleteTextures (n : GLsizei; textures : access GLuint) -- gl.h:1304 with Import => True, Convention => C, External_Name => "glDeleteTextures"; procedure glBindTexture (target : GLenum; texture : GLuint) -- gl.h:1306 with Import => True, Convention => C, External_Name => "glBindTexture"; procedure glPrioritizeTextures (n : GLsizei; textures : access GLuint; priorities : access GLclampf) -- gl.h:1308 with Import => True, Convention => C, External_Name => "glPrioritizeTextures"; function glAreTexturesResident (n : GLsizei; textures : access GLuint; residences : access GLboolean) return GLboolean -- gl.h:1312 with Import => True, Convention => C, External_Name => "glAreTexturesResident"; function glIsTexture (texture : GLuint) return GLboolean -- gl.h:1316 with Import => True, Convention => C, External_Name => "glIsTexture"; procedure glTexSubImage1D (target : GLenum; level : GLint; xoffset : GLint; width : GLsizei; format : GLenum; c_type : GLenum; pixels : System.Address) -- gl.h:1319 with Import => True, Convention => C, External_Name => "glTexSubImage1D"; procedure glTexSubImage2D (target : GLenum; level : GLint; xoffset : GLint; yoffset : GLint; width : GLsizei; height : GLsizei; format : GLenum; c_type : GLenum; pixels : System.Address) -- gl.h:1325 with Import => True, Convention => C, External_Name => "glTexSubImage2D"; procedure glCopyTexImage1D (target : GLenum; level : GLint; internalformat : GLenum; x : GLint; y : GLint; width : GLsizei; border : GLint) -- gl.h:1332 with Import => True, Convention => C, External_Name => "glCopyTexImage1D"; procedure glCopyTexImage2D (target : GLenum; level : GLint; internalformat : GLenum; x : GLint; y : GLint; width : GLsizei; height : GLsizei; border : GLint) -- gl.h:1338 with Import => True, Convention => C, External_Name => "glCopyTexImage2D"; procedure glCopyTexSubImage1D (target : GLenum; level : GLint; xoffset : GLint; x : GLint; y : GLint; width : GLsizei) -- gl.h:1345 with Import => True, Convention => C, External_Name => "glCopyTexSubImage1D"; procedure glCopyTexSubImage2D (target : GLenum; level : GLint; xoffset : GLint; yoffset : GLint; x : GLint; y : GLint; width : GLsizei; height : GLsizei) -- gl.h:1350 with Import => True, Convention => C, External_Name => "glCopyTexSubImage2D"; -- * Evaluators -- procedure glMap1d (target : GLenum; u1 : GLdouble; u2 : GLdouble; stride : GLint; order : GLint; points : access GLdouble) -- gl.h:1360 with Import => True, Convention => C, External_Name => "glMap1d"; procedure glMap1f (target : GLenum; u1 : GLfloat; u2 : GLfloat; stride : GLint; order : GLint; points : access GLfloat) -- gl.h:1363 with Import => True, Convention => C, External_Name => "glMap1f"; procedure glMap2d (target : GLenum; u1 : GLdouble; u2 : GLdouble; ustride : GLint; uorder : GLint; v1 : GLdouble; v2 : GLdouble; vstride : GLint; vorder : GLint; points : access GLdouble) -- gl.h:1367 with Import => True, Convention => C, External_Name => "glMap2d"; procedure glMap2f (target : GLenum; u1 : GLfloat; u2 : GLfloat; ustride : GLint; uorder : GLint; v1 : GLfloat; v2 : GLfloat; vstride : GLint; vorder : GLint; points : access GLfloat) -- gl.h:1371 with Import => True, Convention => C, External_Name => "glMap2f"; procedure glGetMapdv (target : GLenum; query : GLenum; v : access GLdouble) -- gl.h:1376 with Import => True, Convention => C, External_Name => "glGetMapdv"; procedure glGetMapfv (target : GLenum; query : GLenum; v : access GLfloat) -- gl.h:1377 with Import => True, Convention => C, External_Name => "glGetMapfv"; procedure glGetMapiv (target : GLenum; query : GLenum; v : access GLint) -- gl.h:1378 with Import => True, Convention => C, External_Name => "glGetMapiv"; procedure glEvalCoord1d (u : GLdouble) -- gl.h:1380 with Import => True, Convention => C, External_Name => "glEvalCoord1d"; procedure glEvalCoord1f (u : GLfloat) -- gl.h:1381 with Import => True, Convention => C, External_Name => "glEvalCoord1f"; procedure glEvalCoord1dv (u : access GLdouble) -- gl.h:1383 with Import => True, Convention => C, External_Name => "glEvalCoord1dv"; procedure glEvalCoord1fv (u : access GLfloat) -- gl.h:1384 with Import => True, Convention => C, External_Name => "glEvalCoord1fv"; procedure glEvalCoord2d (u : GLdouble; v : GLdouble) -- gl.h:1386 with Import => True, Convention => C, External_Name => "glEvalCoord2d"; procedure glEvalCoord2f (u : GLfloat; v : GLfloat) -- gl.h:1387 with Import => True, Convention => C, External_Name => "glEvalCoord2f"; procedure glEvalCoord2dv (u : access GLdouble) -- gl.h:1389 with Import => True, Convention => C, External_Name => "glEvalCoord2dv"; procedure glEvalCoord2fv (u : access GLfloat) -- gl.h:1390 with Import => True, Convention => C, External_Name => "glEvalCoord2fv"; procedure glMapGrid1d (un : GLint; u1 : GLdouble; u2 : GLdouble) -- gl.h:1392 with Import => True, Convention => C, External_Name => "glMapGrid1d"; procedure glMapGrid1f (un : GLint; u1 : GLfloat; u2 : GLfloat) -- gl.h:1393 with Import => True, Convention => C, External_Name => "glMapGrid1f"; procedure glMapGrid2d (un : GLint; u1 : GLdouble; u2 : GLdouble; vn : GLint; v1 : GLdouble; v2 : GLdouble) -- gl.h:1395 with Import => True, Convention => C, External_Name => "glMapGrid2d"; procedure glMapGrid2f (un : GLint; u1 : GLfloat; u2 : GLfloat; vn : GLint; v1 : GLfloat; v2 : GLfloat) -- gl.h:1397 with Import => True, Convention => C, External_Name => "glMapGrid2f"; procedure glEvalPoint1 (i : GLint) -- gl.h:1400 with Import => True, Convention => C, External_Name => "glEvalPoint1"; procedure glEvalPoint2 (i : GLint; j : GLint) -- gl.h:1402 with Import => True, Convention => C, External_Name => "glEvalPoint2"; procedure glEvalMesh1 (mode : GLenum; i1 : GLint; i2 : GLint) -- gl.h:1404 with Import => True, Convention => C, External_Name => "glEvalMesh1"; procedure glEvalMesh2 (mode : GLenum; i1 : GLint; i2 : GLint; j1 : GLint; j2 : GLint) -- gl.h:1406 with Import => True, Convention => C, External_Name => "glEvalMesh2"; -- * Fog -- procedure glFogf (pname : GLenum; param : GLfloat) -- gl.h:1413 with Import => True, Convention => C, External_Name => "glFogf"; procedure glFogi (pname : GLenum; param : GLint) -- gl.h:1415 with Import => True, Convention => C, External_Name => "glFogi"; procedure glFogfv (pname : GLenum; params : access GLfloat) -- gl.h:1417 with Import => True, Convention => C, External_Name => "glFogfv"; procedure glFogiv (pname : GLenum; params : access GLint) -- gl.h:1419 with Import => True, Convention => C, External_Name => "glFogiv"; -- * Selection and Feedback -- procedure glFeedbackBuffer (size : GLsizei; c_type : GLenum; buffer : access GLfloat) -- gl.h:1426 with Import => True, Convention => C, External_Name => "glFeedbackBuffer"; procedure glPassThrough (token : GLfloat) -- gl.h:1428 with Import => True, Convention => C, External_Name => "glPassThrough"; procedure glSelectBuffer (size : GLsizei; buffer : access GLuint) -- gl.h:1430 with Import => True, Convention => C, External_Name => "glSelectBuffer"; procedure glInitNames -- gl.h:1432 with Import => True, Convention => C, External_Name => "glInitNames"; procedure glLoadName (name : GLuint) -- gl.h:1434 with Import => True, Convention => C, External_Name => "glLoadName"; procedure glPushName (name : GLuint) -- gl.h:1436 with Import => True, Convention => C, External_Name => "glPushName"; procedure glPopName -- gl.h:1438 with Import => True, Convention => C, External_Name => "glPopName"; -- * OpenGL 1.2 -- procedure glDrawRangeElements (mode : GLenum; start : GLuint; c_end : GLuint; count : GLsizei; c_type : GLenum; indices : System.Address) -- gl.h:1488 with Import => True, Convention => C, External_Name => "glDrawRangeElements"; procedure glTexImage3D (target : GLenum; level : GLint; internalFormat : GLint; width : GLsizei; height : GLsizei; depth : GLsizei; border : GLint; format : GLenum; c_type : GLenum; pixels : System.Address) -- gl.h:1491 with Import => True, Convention => C, External_Name => "glTexImage3D"; procedure glTexSubImage3D (target : GLenum; level : GLint; xoffset : GLint; yoffset : GLint; zoffset : GLint; width : GLsizei; height : GLsizei; depth : GLsizei; format : GLenum; c_type : GLenum; pixels : System.Address) -- gl.h:1498 with Import => True, Convention => C, External_Name => "glTexSubImage3D"; procedure glCopyTexSubImage3D (target : GLenum; level : GLint; xoffset : GLint; yoffset : GLint; zoffset : GLint; x : GLint; y : GLint; width : GLsizei; height : GLsizei) -- gl.h:1505 with Import => True, Convention => C, External_Name => "glCopyTexSubImage3D"; type PFNGLDRAWRANGEELEMENTSPROC is access procedure (arg1 : GLenum; arg2 : GLuint; arg3 : GLuint; arg4 : GLsizei; arg5 : GLenum; arg6 : System.Address) with Convention => C; -- gl.h:1511 type PFNGLTEXIMAGE3DPROC is access procedure (arg1 : GLenum; arg2 : GLint; arg3 : GLint; arg4 : GLsizei; arg5 : GLsizei; arg6 : GLsizei; arg7 : GLint; arg8 : GLenum; arg9 : GLenum; arg10 : System.Address) with Convention => C; -- gl.h:1512 type PFNGLTEXSUBIMAGE3DPROC is access procedure (arg1 : GLenum; arg2 : GLint; arg3 : GLint; arg4 : GLint; arg5 : GLint; arg6 : GLsizei; arg7 : GLsizei; arg8 : GLsizei; arg9 : GLenum; arg10 : GLenum; arg11 : System.Address) with Convention => C; -- gl.h:1513 type PFNGLCOPYTEXSUBIMAGE3DPROC is access procedure (arg1 : GLenum; arg2 : GLint; arg3 : GLint; arg4 : GLint; arg5 : GLint; arg6 : GLint; arg7 : GLint; arg8 : GLsizei; arg9 : GLsizei) with Convention => C; -- gl.h:1514 -- * GL_ARB_imaging -- procedure glColorTable (target : GLenum; internalformat : GLenum; width : GLsizei; format : GLenum; c_type : GLenum; table : System.Address) -- gl.h:1598 with Import => True, Convention => C, External_Name => "glColorTable"; procedure glColorSubTable (target : GLenum; start : GLsizei; count : GLsizei; format : GLenum; c_type : GLenum; data : System.Address) -- gl.h:1602 with Import => True, Convention => C, External_Name => "glColorSubTable"; procedure glColorTableParameteriv (target : GLenum; pname : GLenum; params : access GLint) -- gl.h:1607 with Import => True, Convention => C, External_Name => "glColorTableParameteriv"; procedure glColorTableParameterfv (target : GLenum; pname : GLenum; params : access GLfloat) -- gl.h:1610 with Import => True, Convention => C, External_Name => "glColorTableParameterfv"; procedure glCopyColorSubTable (target : GLenum; start : GLsizei; x : GLint; y : GLint; width : GLsizei) -- gl.h:1613 with Import => True, Convention => C, External_Name => "glCopyColorSubTable"; procedure glCopyColorTable (target : GLenum; internalformat : GLenum; x : GLint; y : GLint; width : GLsizei) -- gl.h:1616 with Import => True, Convention => C, External_Name => "glCopyColorTable"; procedure glGetColorTable (target : GLenum; format : GLenum; c_type : GLenum; table : System.Address) -- gl.h:1619 with Import => True, Convention => C, External_Name => "glGetColorTable"; procedure glGetColorTableParameterfv (target : GLenum; pname : GLenum; params : access GLfloat) -- gl.h:1622 with Import => True, Convention => C, External_Name => "glGetColorTableParameterfv"; procedure glGetColorTableParameteriv (target : GLenum; pname : GLenum; params : access GLint) -- gl.h:1625 with Import => True, Convention => C, External_Name => "glGetColorTableParameteriv"; procedure glBlendEquation (mode : GLenum) -- gl.h:1628 with Import => True, Convention => C, External_Name => "glBlendEquation"; procedure glBlendColor (red : GLclampf; green : GLclampf; blue : GLclampf; alpha : GLclampf) -- gl.h:1630 with Import => True, Convention => C, External_Name => "glBlendColor"; procedure glHistogram (target : GLenum; width : GLsizei; internalformat : GLenum; sink : GLboolean) -- gl.h:1633 with Import => True, Convention => C, External_Name => "glHistogram"; procedure glResetHistogram (target : GLenum) -- gl.h:1636 with Import => True, Convention => C, External_Name => "glResetHistogram"; procedure glGetHistogram (target : GLenum; reset : GLboolean; format : GLenum; c_type : GLenum; values : System.Address) -- gl.h:1638 with Import => True, Convention => C, External_Name => "glGetHistogram"; procedure glGetHistogramParameterfv (target : GLenum; pname : GLenum; params : access GLfloat) -- gl.h:1642 with Import => True, Convention => C, External_Name => "glGetHistogramParameterfv"; procedure glGetHistogramParameteriv (target : GLenum; pname : GLenum; params : access GLint) -- gl.h:1645 with Import => True, Convention => C, External_Name => "glGetHistogramParameteriv"; procedure glMinmax (target : GLenum; internalformat : GLenum; sink : GLboolean) -- gl.h:1648 with Import => True, Convention => C, External_Name => "glMinmax"; procedure glResetMinmax (target : GLenum) -- gl.h:1651 with Import => True, Convention => C, External_Name => "glResetMinmax"; procedure glGetMinmax (target : GLenum; reset : GLboolean; format : GLenum; types : GLenum; values : System.Address) -- gl.h:1653 with Import => True, Convention => C, External_Name => "glGetMinmax"; procedure glGetMinmaxParameterfv (target : GLenum; pname : GLenum; params : access GLfloat) -- gl.h:1657 with Import => True, Convention => C, External_Name => "glGetMinmaxParameterfv"; procedure glGetMinmaxParameteriv (target : GLenum; pname : GLenum; params : access GLint) -- gl.h:1660 with Import => True, Convention => C, External_Name => "glGetMinmaxParameteriv"; procedure glConvolutionFilter1D (target : GLenum; internalformat : GLenum; width : GLsizei; format : GLenum; c_type : GLenum; image : System.Address) -- gl.h:1663 with Import => True, Convention => C, External_Name => "glConvolutionFilter1D"; procedure glConvolutionFilter2D (target : GLenum; internalformat : GLenum; width : GLsizei; height : GLsizei; format : GLenum; c_type : GLenum; image : System.Address) -- gl.h:1667 with Import => True, Convention => C, External_Name => "glConvolutionFilter2D"; procedure glConvolutionParameterf (target : GLenum; pname : GLenum; params : GLfloat) -- gl.h:1671 with Import => True, Convention => C, External_Name => "glConvolutionParameterf"; procedure glConvolutionParameterfv (target : GLenum; pname : GLenum; params : access GLfloat) -- gl.h:1674 with Import => True, Convention => C, External_Name => "glConvolutionParameterfv"; procedure glConvolutionParameteri (target : GLenum; pname : GLenum; params : GLint) -- gl.h:1677 with Import => True, Convention => C, External_Name => "glConvolutionParameteri"; procedure glConvolutionParameteriv (target : GLenum; pname : GLenum; params : access GLint) -- gl.h:1680 with Import => True, Convention => C, External_Name => "glConvolutionParameteriv"; procedure glCopyConvolutionFilter1D (target : GLenum; internalformat : GLenum; x : GLint; y : GLint; width : GLsizei) -- gl.h:1683 with Import => True, Convention => C, External_Name => "glCopyConvolutionFilter1D"; procedure glCopyConvolutionFilter2D (target : GLenum; internalformat : GLenum; x : GLint; y : GLint; width : GLsizei; height : GLsizei) -- gl.h:1686 with Import => True, Convention => C, External_Name => "glCopyConvolutionFilter2D"; procedure glGetConvolutionFilter (target : GLenum; format : GLenum; c_type : GLenum; image : System.Address) -- gl.h:1690 with Import => True, Convention => C, External_Name => "glGetConvolutionFilter"; procedure glGetConvolutionParameterfv (target : GLenum; pname : GLenum; params : access GLfloat) -- gl.h:1693 with Import => True, Convention => C, External_Name => "glGetConvolutionParameterfv"; procedure glGetConvolutionParameteriv (target : GLenum; pname : GLenum; params : access GLint) -- gl.h:1696 with Import => True, Convention => C, External_Name => "glGetConvolutionParameteriv"; procedure glSeparableFilter2D (target : GLenum; internalformat : GLenum; width : GLsizei; height : GLsizei; format : GLenum; c_type : GLenum; row : System.Address; column : System.Address) -- gl.h:1699 with Import => True, Convention => C, External_Name => "glSeparableFilter2D"; procedure glGetSeparableFilter (target : GLenum; format : GLenum; c_type : GLenum; row : System.Address; column : System.Address; span : System.Address) -- gl.h:1703 with Import => True, Convention => C, External_Name => "glGetSeparableFilter"; -- * OpenGL 1.3 -- -- multitexture -- texture_cube_map -- texture_compression -- multisample -- transpose_matrix -- texture_env_combine -- texture_env_dot3 -- texture_border_clamp procedure glActiveTexture (texture : GLenum) -- gl.h:1818 with Import => True, Convention => C, External_Name => "glActiveTexture"; procedure glClientActiveTexture (texture : GLenum) -- gl.h:1820 with Import => True, Convention => C, External_Name => "glClientActiveTexture"; procedure glCompressedTexImage1D (target : GLenum; level : GLint; internalformat : GLenum; width : GLsizei; border : GLint; imageSize : GLsizei; data : System.Address) -- gl.h:1822 with Import => True, Convention => C, External_Name => "glCompressedTexImage1D"; procedure glCompressedTexImage2D (target : GLenum; level : GLint; internalformat : GLenum; width : GLsizei; height : GLsizei; border : GLint; imageSize : GLsizei; data : System.Address) -- gl.h:1824 with Import => True, Convention => C, External_Name => "glCompressedTexImage2D"; procedure glCompressedTexImage3D (target : GLenum; level : GLint; internalformat : GLenum; width : GLsizei; height : GLsizei; depth : GLsizei; border : GLint; imageSize : GLsizei; data : System.Address) -- gl.h:1826 with Import => True, Convention => C, External_Name => "glCompressedTexImage3D"; procedure glCompressedTexSubImage1D (target : GLenum; level : GLint; xoffset : GLint; width : GLsizei; format : GLenum; imageSize : GLsizei; data : System.Address) -- gl.h:1828 with Import => True, Convention => C, External_Name => "glCompressedTexSubImage1D"; procedure glCompressedTexSubImage2D (target : GLenum; level : GLint; xoffset : GLint; yoffset : GLint; width : GLsizei; height : GLsizei; format : GLenum; imageSize : GLsizei; data : System.Address) -- gl.h:1830 with Import => True, Convention => C, External_Name => "glCompressedTexSubImage2D"; procedure glCompressedTexSubImage3D (target : GLenum; level : GLint; xoffset : GLint; yoffset : GLint; zoffset : GLint; width : GLsizei; height : GLsizei; depth : GLsizei; format : GLenum; imageSize : GLsizei; data : System.Address) -- gl.h:1832 with Import => True, Convention => C, External_Name => "glCompressedTexSubImage3D"; procedure glGetCompressedTexImage (target : GLenum; lod : GLint; img : System.Address) -- gl.h:1834 with Import => True, Convention => C, External_Name => "glGetCompressedTexImage"; procedure glMultiTexCoord1d (target : GLenum; s : GLdouble) -- gl.h:1836 with Import => True, Convention => C, External_Name => "glMultiTexCoord1d"; procedure glMultiTexCoord1dv (target : GLenum; v : access GLdouble) -- gl.h:1838 with Import => True, Convention => C, External_Name => "glMultiTexCoord1dv"; procedure glMultiTexCoord1f (target : GLenum; s : GLfloat) -- gl.h:1840 with Import => True, Convention => C, External_Name => "glMultiTexCoord1f"; procedure glMultiTexCoord1fv (target : GLenum; v : access GLfloat) -- gl.h:1842 with Import => True, Convention => C, External_Name => "glMultiTexCoord1fv"; procedure glMultiTexCoord1i (target : GLenum; s : GLint) -- gl.h:1844 with Import => True, Convention => C, External_Name => "glMultiTexCoord1i"; procedure glMultiTexCoord1iv (target : GLenum; v : access GLint) -- gl.h:1846 with Import => True, Convention => C, External_Name => "glMultiTexCoord1iv"; procedure glMultiTexCoord1s (target : GLenum; s : GLshort) -- gl.h:1848 with Import => True, Convention => C, External_Name => "glMultiTexCoord1s"; procedure glMultiTexCoord1sv (target : GLenum; v : access GLshort) -- gl.h:1850 with Import => True, Convention => C, External_Name => "glMultiTexCoord1sv"; procedure glMultiTexCoord2d (target : GLenum; s : GLdouble; t : GLdouble) -- gl.h:1852 with Import => True, Convention => C, External_Name => "glMultiTexCoord2d"; procedure glMultiTexCoord2dv (target : GLenum; v : access GLdouble) -- gl.h:1854 with Import => True, Convention => C, External_Name => "glMultiTexCoord2dv"; procedure glMultiTexCoord2f (target : GLenum; s : GLfloat; t : GLfloat) -- gl.h:1856 with Import => True, Convention => C, External_Name => "glMultiTexCoord2f"; procedure glMultiTexCoord2fv (target : GLenum; v : access GLfloat) -- gl.h:1858 with Import => True, Convention => C, External_Name => "glMultiTexCoord2fv"; procedure glMultiTexCoord2i (target : GLenum; s : GLint; t : GLint) -- gl.h:1860 with Import => True, Convention => C, External_Name => "glMultiTexCoord2i"; procedure glMultiTexCoord2iv (target : GLenum; v : access GLint) -- gl.h:1862 with Import => True, Convention => C, External_Name => "glMultiTexCoord2iv"; procedure glMultiTexCoord2s (target : GLenum; s : GLshort; t : GLshort) -- gl.h:1864 with Import => True, Convention => C, External_Name => "glMultiTexCoord2s"; procedure glMultiTexCoord2sv (target : GLenum; v : access GLshort) -- gl.h:1866 with Import => True, Convention => C, External_Name => "glMultiTexCoord2sv"; procedure glMultiTexCoord3d (target : GLenum; s : GLdouble; t : GLdouble; r : GLdouble) -- gl.h:1868 with Import => True, Convention => C, External_Name => "glMultiTexCoord3d"; procedure glMultiTexCoord3dv (target : GLenum; v : access GLdouble) -- gl.h:1870 with Import => True, Convention => C, External_Name => "glMultiTexCoord3dv"; procedure glMultiTexCoord3f (target : GLenum; s : GLfloat; t : GLfloat; r : GLfloat) -- gl.h:1872 with Import => True, Convention => C, External_Name => "glMultiTexCoord3f"; procedure glMultiTexCoord3fv (target : GLenum; v : access GLfloat) -- gl.h:1874 with Import => True, Convention => C, External_Name => "glMultiTexCoord3fv"; procedure glMultiTexCoord3i (target : GLenum; s : GLint; t : GLint; r : GLint) -- gl.h:1876 with Import => True, Convention => C, External_Name => "glMultiTexCoord3i"; procedure glMultiTexCoord3iv (target : GLenum; v : access GLint) -- gl.h:1878 with Import => True, Convention => C, External_Name => "glMultiTexCoord3iv"; procedure glMultiTexCoord3s (target : GLenum; s : GLshort; t : GLshort; r : GLshort) -- gl.h:1880 with Import => True, Convention => C, External_Name => "glMultiTexCoord3s"; procedure glMultiTexCoord3sv (target : GLenum; v : access GLshort) -- gl.h:1882 with Import => True, Convention => C, External_Name => "glMultiTexCoord3sv"; procedure glMultiTexCoord4d (target : GLenum; s : GLdouble; t : GLdouble; r : GLdouble; q : GLdouble) -- gl.h:1884 with Import => True, Convention => C, External_Name => "glMultiTexCoord4d"; procedure glMultiTexCoord4dv (target : GLenum; v : access GLdouble) -- gl.h:1886 with Import => True, Convention => C, External_Name => "glMultiTexCoord4dv"; procedure glMultiTexCoord4f (target : GLenum; s : GLfloat; t : GLfloat; r : GLfloat; q : GLfloat) -- gl.h:1888 with Import => True, Convention => C, External_Name => "glMultiTexCoord4f"; procedure glMultiTexCoord4fv (target : GLenum; v : access GLfloat) -- gl.h:1890 with Import => True, Convention => C, External_Name => "glMultiTexCoord4fv"; procedure glMultiTexCoord4i (target : GLenum; s : GLint; t : GLint; r : GLint; q : GLint) -- gl.h:1892 with Import => True, Convention => C, External_Name => "glMultiTexCoord4i"; procedure glMultiTexCoord4iv (target : GLenum; v : access GLint) -- gl.h:1894 with Import => True, Convention => C, External_Name => "glMultiTexCoord4iv"; procedure glMultiTexCoord4s (target : GLenum; s : GLshort; t : GLshort; r : GLshort; q : GLshort) -- gl.h:1896 with Import => True, Convention => C, External_Name => "glMultiTexCoord4s"; procedure glMultiTexCoord4sv (target : GLenum; v : access GLshort) -- gl.h:1898 with Import => True, Convention => C, External_Name => "glMultiTexCoord4sv"; procedure glLoadTransposeMatrixd (m : access GLdouble) -- gl.h:1901 with Import => True, Convention => C, External_Name => "glLoadTransposeMatrixd"; procedure glLoadTransposeMatrixf (m : access GLfloat) -- gl.h:1903 with Import => True, Convention => C, External_Name => "glLoadTransposeMatrixf"; procedure glMultTransposeMatrixd (m : access GLdouble) -- gl.h:1905 with Import => True, Convention => C, External_Name => "glMultTransposeMatrixd"; procedure glMultTransposeMatrixf (m : access GLfloat) -- gl.h:1907 with Import => True, Convention => C, External_Name => "glMultTransposeMatrixf"; procedure glSampleCoverage (value : GLclampf; invert : GLboolean) -- gl.h:1909 with Import => True, Convention => C, External_Name => "glSampleCoverage"; type PFNGLACTIVETEXTUREPROC is access procedure (arg1 : GLenum) with Convention => C; -- gl.h:1912 type PFNGLSAMPLECOVERAGEPROC is access procedure (arg1 : GLclampf; arg2 : GLboolean) with Convention => C; -- gl.h:1913 type PFNGLCOMPRESSEDTEXIMAGE3DPROC is access procedure (arg1 : GLenum; arg2 : GLint; arg3 : GLenum; arg4 : GLsizei; arg5 : GLsizei; arg6 : GLsizei; arg7 : GLint; arg8 : GLsizei; arg9 : System.Address) with Convention => C; -- gl.h:1914 type PFNGLCOMPRESSEDTEXIMAGE2DPROC is access procedure (arg1 : GLenum; arg2 : GLint; arg3 : GLenum; arg4 : GLsizei; arg5 : GLsizei; arg6 : GLint; arg7 : GLsizei; arg8 : System.Address) with Convention => C; -- gl.h:1915 type PFNGLCOMPRESSEDTEXIMAGE1DPROC is access procedure (arg1 : GLenum; arg2 : GLint; arg3 : GLenum; arg4 : GLsizei; arg5 : GLint; arg6 : GLsizei; arg7 : System.Address) with Convention => C; -- gl.h:1916 type PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC is access procedure (arg1 : GLenum; arg2 : GLint; arg3 : GLint; arg4 : GLint; arg5 : GLint; arg6 : GLsizei; arg7 : GLsizei; arg8 : GLsizei; arg9 : GLenum; arg10 : GLsizei; arg11 : System.Address) with Convention => C; -- gl.h:1917 type PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC is access procedure (arg1 : GLenum; arg2 : GLint; arg3 : GLint; arg4 : GLint; arg5 : GLsizei; arg6 : GLsizei; arg7 : GLenum; arg8 : GLsizei; arg9 : System.Address) with Convention => C; -- gl.h:1918 type PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC is access procedure (arg1 : GLenum; arg2 : GLint; arg3 : GLint; arg4 : GLsizei; arg5 : GLenum; arg6 : GLsizei; arg7 : System.Address) with Convention => C; -- gl.h:1919 type PFNGLGETCOMPRESSEDTEXIMAGEPROC is access procedure (arg1 : GLenum; arg2 : GLint; arg3 : System.Address) with Convention => C; -- gl.h:1920 -- * GL_ARB_multitexture (ARB extension 1 and OpenGL 1.2.1) -- procedure glActiveTextureARB (texture : GLenum) -- gl.h:1966 with Import => True, Convention => C, External_Name => "glActiveTextureARB"; procedure glClientActiveTextureARB (texture : GLenum) -- gl.h:1967 with Import => True, Convention => C, External_Name => "glClientActiveTextureARB"; procedure glMultiTexCoord1dARB (target : GLenum; s : GLdouble) -- gl.h:1968 with Import => True, Convention => C, External_Name => "glMultiTexCoord1dARB"; procedure glMultiTexCoord1dvARB (target : GLenum; v : access GLdouble) -- gl.h:1969 with Import => True, Convention => C, External_Name => "glMultiTexCoord1dvARB"; procedure glMultiTexCoord1fARB (target : GLenum; s : GLfloat) -- gl.h:1970 with Import => True, Convention => C, External_Name => "glMultiTexCoord1fARB"; procedure glMultiTexCoord1fvARB (target : GLenum; v : access GLfloat) -- gl.h:1971 with Import => True, Convention => C, External_Name => "glMultiTexCoord1fvARB"; procedure glMultiTexCoord1iARB (target : GLenum; s : GLint) -- gl.h:1972 with Import => True, Convention => C, External_Name => "glMultiTexCoord1iARB"; procedure glMultiTexCoord1ivARB (target : GLenum; v : access GLint) -- gl.h:1973 with Import => True, Convention => C, External_Name => "glMultiTexCoord1ivARB"; procedure glMultiTexCoord1sARB (target : GLenum; s : GLshort) -- gl.h:1974 with Import => True, Convention => C, External_Name => "glMultiTexCoord1sARB"; procedure glMultiTexCoord1svARB (target : GLenum; v : access GLshort) -- gl.h:1975 with Import => True, Convention => C, External_Name => "glMultiTexCoord1svARB"; procedure glMultiTexCoord2dARB (target : GLenum; s : GLdouble; t : GLdouble) -- gl.h:1976 with Import => True, Convention => C, External_Name => "glMultiTexCoord2dARB"; procedure glMultiTexCoord2dvARB (target : GLenum; v : access GLdouble) -- gl.h:1977 with Import => True, Convention => C, External_Name => "glMultiTexCoord2dvARB"; procedure glMultiTexCoord2fARB (target : GLenum; s : GLfloat; t : GLfloat) -- gl.h:1978 with Import => True, Convention => C, External_Name => "glMultiTexCoord2fARB"; procedure glMultiTexCoord2fvARB (target : GLenum; v : access GLfloat) -- gl.h:1979 with Import => True, Convention => C, External_Name => "glMultiTexCoord2fvARB"; procedure glMultiTexCoord2iARB (target : GLenum; s : GLint; t : GLint) -- gl.h:1980 with Import => True, Convention => C, External_Name => "glMultiTexCoord2iARB"; procedure glMultiTexCoord2ivARB (target : GLenum; v : access GLint) -- gl.h:1981 with Import => True, Convention => C, External_Name => "glMultiTexCoord2ivARB"; procedure glMultiTexCoord2sARB (target : GLenum; s : GLshort; t : GLshort) -- gl.h:1982 with Import => True, Convention => C, External_Name => "glMultiTexCoord2sARB"; procedure glMultiTexCoord2svARB (target : GLenum; v : access GLshort) -- gl.h:1983 with Import => True, Convention => C, External_Name => "glMultiTexCoord2svARB"; procedure glMultiTexCoord3dARB (target : GLenum; s : GLdouble; t : GLdouble; r : GLdouble) -- gl.h:1984 with Import => True, Convention => C, External_Name => "glMultiTexCoord3dARB"; procedure glMultiTexCoord3dvARB (target : GLenum; v : access GLdouble) -- gl.h:1985 with Import => True, Convention => C, External_Name => "glMultiTexCoord3dvARB"; procedure glMultiTexCoord3fARB (target : GLenum; s : GLfloat; t : GLfloat; r : GLfloat) -- gl.h:1986 with Import => True, Convention => C, External_Name => "glMultiTexCoord3fARB"; procedure glMultiTexCoord3fvARB (target : GLenum; v : access GLfloat) -- gl.h:1987 with Import => True, Convention => C, External_Name => "glMultiTexCoord3fvARB"; procedure glMultiTexCoord3iARB (target : GLenum; s : GLint; t : GLint; r : GLint) -- gl.h:1988 with Import => True, Convention => C, External_Name => "glMultiTexCoord3iARB"; procedure glMultiTexCoord3ivARB (target : GLenum; v : access GLint) -- gl.h:1989 with Import => True, Convention => C, External_Name => "glMultiTexCoord3ivARB"; procedure glMultiTexCoord3sARB (target : GLenum; s : GLshort; t : GLshort; r : GLshort) -- gl.h:1990 with Import => True, Convention => C, External_Name => "glMultiTexCoord3sARB"; procedure glMultiTexCoord3svARB (target : GLenum; v : access GLshort) -- gl.h:1991 with Import => True, Convention => C, External_Name => "glMultiTexCoord3svARB"; procedure glMultiTexCoord4dARB (target : GLenum; s : GLdouble; t : GLdouble; r : GLdouble; q : GLdouble) -- gl.h:1992 with Import => True, Convention => C, External_Name => "glMultiTexCoord4dARB"; procedure glMultiTexCoord4dvARB (target : GLenum; v : access GLdouble) -- gl.h:1993 with Import => True, Convention => C, External_Name => "glMultiTexCoord4dvARB"; procedure glMultiTexCoord4fARB (target : GLenum; s : GLfloat; t : GLfloat; r : GLfloat; q : GLfloat) -- gl.h:1994 with Import => True, Convention => C, External_Name => "glMultiTexCoord4fARB"; procedure glMultiTexCoord4fvARB (target : GLenum; v : access GLfloat) -- gl.h:1995 with Import => True, Convention => C, External_Name => "glMultiTexCoord4fvARB"; procedure glMultiTexCoord4iARB (target : GLenum; s : GLint; t : GLint; r : GLint; q : GLint) -- gl.h:1996 with Import => True, Convention => C, External_Name => "glMultiTexCoord4iARB"; procedure glMultiTexCoord4ivARB (target : GLenum; v : access GLint) -- gl.h:1997 with Import => True, Convention => C, External_Name => "glMultiTexCoord4ivARB"; procedure glMultiTexCoord4sARB (target : GLenum; s : GLshort; t : GLshort; r : GLshort; q : GLshort) -- gl.h:1998 with Import => True, Convention => C, External_Name => "glMultiTexCoord4sARB"; procedure glMultiTexCoord4svARB (target : GLenum; v : access GLshort) -- gl.h:1999 with Import => True, Convention => C, External_Name => "glMultiTexCoord4svARB"; type PFNGLACTIVETEXTUREARBPROC is access procedure (arg1 : GLenum) with Convention => C; -- gl.h:2001 type PFNGLCLIENTACTIVETEXTUREARBPROC is access procedure (arg1 : GLenum) with Convention => C; -- gl.h:2002 type PFNGLMULTITEXCOORD1DARBPROC is access procedure (arg1 : GLenum; arg2 : GLdouble) with Convention => C; -- gl.h:2003 type PFNGLMULTITEXCOORD1DVARBPROC is access procedure (arg1 : GLenum; arg2 : access GLdouble) with Convention => C; -- gl.h:2004 type PFNGLMULTITEXCOORD1FARBPROC is access procedure (arg1 : GLenum; arg2 : GLfloat) with Convention => C; -- gl.h:2005 type PFNGLMULTITEXCOORD1FVARBPROC is access procedure (arg1 : GLenum; arg2 : access GLfloat) with Convention => C; -- gl.h:2006 type PFNGLMULTITEXCOORD1IARBPROC is access procedure (arg1 : GLenum; arg2 : GLint) with Convention => C; -- gl.h:2007 type PFNGLMULTITEXCOORD1IVARBPROC is access procedure (arg1 : GLenum; arg2 : access GLint) with Convention => C; -- gl.h:2008 type PFNGLMULTITEXCOORD1SARBPROC is access procedure (arg1 : GLenum; arg2 : GLshort) with Convention => C; -- gl.h:2009 type PFNGLMULTITEXCOORD1SVARBPROC is access procedure (arg1 : GLenum; arg2 : access GLshort) with Convention => C; -- gl.h:2010 type PFNGLMULTITEXCOORD2DARBPROC is access procedure (arg1 : GLenum; arg2 : GLdouble; arg3 : GLdouble) with Convention => C; -- gl.h:2011 type PFNGLMULTITEXCOORD2DVARBPROC is access procedure (arg1 : GLenum; arg2 : access GLdouble) with Convention => C; -- gl.h:2012 type PFNGLMULTITEXCOORD2FARBPROC is access procedure (arg1 : GLenum; arg2 : GLfloat; arg3 : GLfloat) with Convention => C; -- gl.h:2013 type PFNGLMULTITEXCOORD2FVARBPROC is access procedure (arg1 : GLenum; arg2 : access GLfloat) with Convention => C; -- gl.h:2014 type PFNGLMULTITEXCOORD2IARBPROC is access procedure (arg1 : GLenum; arg2 : GLint; arg3 : GLint) with Convention => C; -- gl.h:2015 type PFNGLMULTITEXCOORD2IVARBPROC is access procedure (arg1 : GLenum; arg2 : access GLint) with Convention => C; -- gl.h:2016 type PFNGLMULTITEXCOORD2SARBPROC is access procedure (arg1 : GLenum; arg2 : GLshort; arg3 : GLshort) with Convention => C; -- gl.h:2017 type PFNGLMULTITEXCOORD2SVARBPROC is access procedure (arg1 : GLenum; arg2 : access GLshort) with Convention => C; -- gl.h:2018 type PFNGLMULTITEXCOORD3DARBPROC is access procedure (arg1 : GLenum; arg2 : GLdouble; arg3 : GLdouble; arg4 : GLdouble) with Convention => C; -- gl.h:2019 type PFNGLMULTITEXCOORD3DVARBPROC is access procedure (arg1 : GLenum; arg2 : access GLdouble) with Convention => C; -- gl.h:2020 type PFNGLMULTITEXCOORD3FARBPROC is access procedure (arg1 : GLenum; arg2 : GLfloat; arg3 : GLfloat; arg4 : GLfloat) with Convention => C; -- gl.h:2021 type PFNGLMULTITEXCOORD3FVARBPROC is access procedure (arg1 : GLenum; arg2 : access GLfloat) with Convention => C; -- gl.h:2022 type PFNGLMULTITEXCOORD3IARBPROC is access procedure (arg1 : GLenum; arg2 : GLint; arg3 : GLint; arg4 : GLint) with Convention => C; -- gl.h:2023 type PFNGLMULTITEXCOORD3IVARBPROC is access procedure (arg1 : GLenum; arg2 : access GLint) with Convention => C; -- gl.h:2024 type PFNGLMULTITEXCOORD3SARBPROC is access procedure (arg1 : GLenum; arg2 : GLshort; arg3 : GLshort; arg4 : GLshort) with Convention => C; -- gl.h:2025 type PFNGLMULTITEXCOORD3SVARBPROC is access procedure (arg1 : GLenum; arg2 : access GLshort) with Convention => C; -- gl.h:2026 type PFNGLMULTITEXCOORD4DARBPROC is access procedure (arg1 : GLenum; arg2 : GLdouble; arg3 : GLdouble; arg4 : GLdouble; arg5 : GLdouble) with Convention => C; -- gl.h:2027 type PFNGLMULTITEXCOORD4DVARBPROC is access procedure (arg1 : GLenum; arg2 : access GLdouble) with Convention => C; -- gl.h:2028 type PFNGLMULTITEXCOORD4FARBPROC is access procedure (arg1 : GLenum; arg2 : GLfloat; arg3 : GLfloat; arg4 : GLfloat; arg5 : GLfloat) with Convention => C; -- gl.h:2029 type PFNGLMULTITEXCOORD4FVARBPROC is access procedure (arg1 : GLenum; arg2 : access GLfloat) with Convention => C; -- gl.h:2030 type PFNGLMULTITEXCOORD4IARBPROC is access procedure (arg1 : GLenum; arg2 : GLint; arg3 : GLint; arg4 : GLint; arg5 : GLint) with Convention => C; -- gl.h:2031 type PFNGLMULTITEXCOORD4IVARBPROC is access procedure (arg1 : GLenum; arg2 : access GLint) with Convention => C; -- gl.h:2032 type PFNGLMULTITEXCOORD4SARBPROC is access procedure (arg1 : GLenum; arg2 : GLshort; arg3 : GLshort; arg4 : GLshort; arg5 : GLshort) with Convention => C; -- gl.h:2033 type PFNGLMULTITEXCOORD4SVARBPROC is access procedure (arg1 : GLenum; arg2 : access GLshort) with Convention => C; -- gl.h:2034 -- * Define this token if you want "old-style" header file behaviour (extensions -- * defined in gl.h). Otherwise, extensions will be included from glext.h. -- -- All extensions that used to be here are now found in glext.h -- * ???. GL_MESA_packed_depth_stencil -- * XXX obsolete -- procedure glBlendEquationSeparateATI (modeRGB : GLenum; modeA : GLenum) -- gl.h:2077 with Import => True, Convention => C, External_Name => "glBlendEquationSeparateATI"; type PFNGLBLENDEQUATIONSEPARATEATIPROC is access procedure (arg1 : GLenum; arg2 : GLenum) with Convention => C; -- gl.h:2078 -- GL_OES_EGL_image type PFNGLEGLIMAGETARGETTEXTURE2DOESPROC is access procedure (arg1 : GLenum; arg2 : glext.GLeglImageOES) with Convention => C; -- gl.h:2094 type PFNGLEGLIMAGETARGETRENDERBUFFERSTORAGEOESPROC is access procedure (arg1 : GLenum; arg2 : glext.GLeglImageOES) with Convention => C; -- gl.h:2095 end gl;
33.135703
117
0.598869
3d1ea6b7f87918c42b1e1794de10d114b2bad046
1,790
ads
Ada
extern/gnat_sdl/gnat_sdl2/src/tbmintrin_h.ads
AdaCore/training_material
6651eb2c53f8c39649b8e0b3c757bc8ff963025a
[ "CC-BY-4.0" ]
15
2020-10-07T08:56:45.000Z
2022-02-08T23:13:22.000Z
extern/gnat_sdl/gnat_sdl2/src/tbmintrin_h.ads
AdaCore/training_material
6651eb2c53f8c39649b8e0b3c757bc8ff963025a
[ "CC-BY-4.0" ]
20
2020-11-05T14:35:20.000Z
2022-01-13T15:59:33.000Z
extern/gnat_sdl/gnat_sdl2/src/tbmintrin_h.ads
AdaCore/training_material
6651eb2c53f8c39649b8e0b3c757bc8ff963025a
[ "CC-BY-4.0" ]
6
2020-10-08T15:57:06.000Z
2021-08-31T12:03:08.000Z
pragma Ada_2005; pragma Style_Checks (Off); with Interfaces.C; use Interfaces.C; package tbmintrin_h is -- Copyright (C) 2010-2017 Free Software Foundation, Inc. -- This file is part of GCC. -- GCC is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation; either version 3, or (at your option) -- any later version. -- GCC is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU General Public License for more details. -- Under Section 7 of GPL version 3, you are granted additional -- permissions described in the GCC Runtime Library Exception, version -- 3.1, as published by the Free Software Foundation. -- You should have received a copy of the GNU General Public License and -- a copy of the GCC Runtime Library Exception along with this program; -- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- <http://www.gnu.org/licenses/>. -- skipped func __blcfill_u32 -- skipped func __blci_u32 -- skipped func __blcic_u32 -- skipped func __blcmsk_u32 -- skipped func __blcs_u32 -- skipped func __blsfill_u32 -- skipped func __blsic_u32 -- skipped func __t1mskc_u32 -- skipped func __tzmsk_u32 -- skipped func __blcfill_u64 -- skipped func __blci_u64 -- skipped func __blcic_u64 -- skipped func __blcmsk_u64 -- skipped func __blcs_u64 -- skipped func __blsfill_u64 -- skipped func __blsic_u64 -- skipped func __t1mskc_u64 -- skipped func __tzmsk_u64 end tbmintrin_h;
28.412698
76
0.701676
c732ac412245b076a3e13f740a902695a81e1339
498
adb
Ada
ada/chopsticks.adb
rtoal/enhanced-dining-philosophers
e5305fb975e8eb5a3d6bbbc1ae0a798d278a074d
[ "MIT" ]
null
null
null
ada/chopsticks.adb
rtoal/enhanced-dining-philosophers
e5305fb975e8eb5a3d6bbbc1ae0a798d278a074d
[ "MIT" ]
null
null
null
ada/chopsticks.adb
rtoal/enhanced-dining-philosophers
e5305fb975e8eb5a3d6bbbc1ae0a798d278a074d
[ "MIT" ]
null
null
null
------------------------------------------------------------------------------ -- chopsticks.adb -- -- Implementation of the Chopsticks package. ------------------------------------------------------------------------------ package body Chopsticks is protected body Chopstick is entry Pick_Up when not Up is begin Up := True; end Pick_Up; entry Put_Down when Up is begin Up := False; end Put_Down; end Chopstick; end Chopsticks;
20.75
79
0.419679
1a2be31915e11e2e4de5504b60d1f541794bf665
3,593
ads
Ada
source/amf/uml/amf-uml-regions-hash.ads
svn2github/matreshka
9d222b3ad9da508855fb1f5adbe5e8a4fad4c530
[ "BSD-3-Clause" ]
24
2016-11-29T06:59:41.000Z
2021-08-30T11:55:16.000Z
source/amf/uml/amf-uml-regions-hash.ads
svn2github/matreshka
9d222b3ad9da508855fb1f5adbe5e8a4fad4c530
[ "BSD-3-Clause" ]
2
2019-01-16T05:15:20.000Z
2019-02-03T10:03:32.000Z
source/amf/uml/amf-uml-regions-hash.ads
svn2github/matreshka
9d222b3ad9da508855fb1f5adbe5e8a4fad4c530
[ "BSD-3-Clause" ]
4
2017-07-18T07:11:05.000Z
2020-06-21T03:02:25.000Z
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Ada Modeling Framework -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2011-2012, Vadim Godunko <[email protected]> -- -- All rights reserved. -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions -- -- are met: -- -- -- -- * Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- -- -- * Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in the -- -- documentation and/or other materials provided with the distribution. -- -- -- -- * Neither the name of the Vadim Godunko, IE nor the names of its -- -- contributors may be used to endorse or promote products derived from -- -- this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -- -- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -- -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -- -- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -- -- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ -- $Revision$ $Date$ ------------------------------------------------------------------------------ -- This file is generated, don't edit it. ------------------------------------------------------------------------------ with AMF.Elements.Generic_Hash; function AMF.UML.Regions.Hash is new AMF.Elements.Generic_Hash (UML_Region, UML_Region_Access);
71.86
78
0.399388
c7a38e26d84ea53ecd7c25f867085a0b83fa4ff4
1,646
ads
Ada
orka/src/orka/interface/orka-loggers-location.ads
onox/orka
9edf99559a16ffa96dfdb208322f4d18efbcbac6
[ "Apache-2.0" ]
52
2016-07-30T23:00:28.000Z
2022-02-05T11:54:55.000Z
orka/src/orka/interface/orka-loggers-location.ads
onox/orka
9edf99559a16ffa96dfdb208322f4d18efbcbac6
[ "Apache-2.0" ]
79
2016-08-01T18:36:48.000Z
2022-02-27T12:14:20.000Z
orka/src/orka/interface/orka-loggers-location.ads
onox/orka
9edf99559a16ffa96dfdb208322f4d18efbcbac6
[ "Apache-2.0" ]
4
2018-04-28T22:36:26.000Z
2020-11-14T23:00:29.000Z
-- SPDX-License-Identifier: Apache-2.0 -- -- Copyright (c) 2019 onox <[email protected]> -- -- 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. with Orka.Resources.Locations; generic Location : Orka.Resources.Locations.Writable_Location_Ptr; Capacity_Queue : Positive; -- Capacity of the message queue -- -- A background task will dequeue messages from this queue -- and write it to the file at the given path by the logger. -- -- Messages that cannot be enqueued will be printed to the terminal. Task_Name : String := "File Logger"; package Orka.Loggers.Location is function Create_Logger (Path : String; Level : Severity := Debug) return Logger_Ptr with Pre => Path'Length > 0; -- Return a logger that logs messages to a writable location procedure Shutdown; -- Shutdown the background task that logs the messages -- -- The task will terminate after it has dequeued the remaining -- messages in the queue. Any system that tries to log new messages -- after the task has terminated will log these messages to the -- terminal. end Orka.Loggers.Location;
35.782609
86
0.718712
1a08e0af63db3a8f14700868224b00bc1f1b2aae
3,419
ads
Ada
ray_tracer.ads
FROL256/ada-ray-tracer
7a4c538dac2fa54523d4eb315c2c963af4ef0f99
[ "MIT" ]
3
2017-02-22T18:53:43.000Z
2020-09-03T06:27:53.000Z
ray_tracer.ads
FROL256/ada-ray-tracer
7a4c538dac2fa54523d4eb315c2c963af4ef0f99
[ "MIT" ]
1
2018-12-14T18:10:35.000Z
2018-12-24T19:48:14.000Z
ray_tracer.ads
FROL256/ada-ray-tracer
7a4c538dac2fa54523d4eb315c2c963af4ef0f99
[ "MIT" ]
null
null
null
with Interfaces; with Ada.Numerics.Float_Random; with Ada.Assertions; with Vector_Math; with Materials; with Lights; with Geometry; with Scene; with Ada.Unchecked_Deallocation; use Interfaces; use Vector_Math; use Materials; use Lights; use Ada.Assertions; use Geometry; package Ray_Tracer is width : Positive := 1024; height : Positive := 768; Threads_Num : Positive := 14*2; Anti_Aliasing_On : boolean := true; Max_Trace_Depth : Positive := 8; Background_Color : float3 := (0.0,0.0,0.0); G_Epsilon : constant float := 1.0e-5; -- small value for geometry offsets G_Epsilon_Div : constant float := 1.0e-20; -- small value for bsdf/pdf divisions g_gamma : constant float := 2.0; g_scn : Scene.Render_Scene; type ScreenBufferData is array(integer range <>, integer range <>) of Unsigned_32; type ScreenBufferDataRef is access ScreenBufferData; screen_buffer : ScreenBufferDataRef := null; type Render_Type is (RT_DEBUG, RT_WHITTED, PT_STUPID, PT_SHADOW, PT_MIS); -- render type procedure Init_Render(a_rendType : Render_Type); procedure Render_Pass; procedure Resize_Viewport(size_x,size_y : integer); function GetSPP return integer; function Finished return Boolean; private -- -- type AccumBuff is array (Integer range <>, integer range <>) of float3; type AccumBuffRef is access AccumBuff; -- pragma Atomic_Components(AccumBuff); -- atomic access to component of "AccumBuff" cannot be guaranteed type FloatBuff is array (Integer range <>, integer range <>) of float; type FloatBuffRef is access FloatBuff; type Color is record Red : float range 0.0..1.0; Green : float range 0.0..1.0; Blue : float range 0.0..1.0; end record; function ColorToUnsigned_32(c: Color) return Unsigned_32; function ToneMapping(v : float3) return Color; pragma Inline (ColorToUnsigned_32); pragma Inline (ToneMapping); function EyeRayDirection (x, y : Natural) return float3; function Compute_Shadow(hit_pos : float3; lpos : float3) return Shadow_Hit; type RayDirPack is array (0 .. 3) of float3; procedure Generate4RayDirections (x, y : in Natural; res : out RayDirPack); type IntRef is access integer; -- multithreaded rendering stuff -- task type Path_Trace_Thread(threadId : integer; Acc_Buff : AccumBuffRef) is entry Resume; entry Finish(spp : IntRef); end Path_Trace_Thread; type Path_Trace_Thread_Ptr is access Path_Trace_Thread; g_threads : array(0..Threads_Num-1) of Path_Trace_Thread_Ptr; g_threadsCreated : boolean := false; ---- instantiate deallocation procedures -- procedure delete is new Ada.Unchecked_Deallocation(Object => ScreenBufferData, Name => ScreenBufferDataRef); --procedure delete is new Ada.Unchecked_Deallocation(Object => RandomGenerator, Name => RandRef); procedure delete is new Ada.Unchecked_Deallocation(Object => integer, Name => IntRef); procedure delete is new Ada.Unchecked_Deallocation(Object => AccumBuff, Name => AccumBuffRef); procedure delete is new Ada.Unchecked_Deallocation(Object => Path_Trace_Thread, Name => Path_Trace_Thread_Ptr); function Find_Closest_Hit(r: Ray) return Hit; pragma Inline(Find_Closest_Hit); g_accBuff : AccumBuffRef := null; g_spp : IntRef := null; g_rend_type : Render_Type := PT_MIS; g_finish : Boolean := false; end Ray_Tracer;
29.991228
113
0.724773
296f022bee457114c193ed02ded45caef25a52e3
14,118
ads
Ada
arch/ARM/STM32/svd/stm32f46_79x/stm32_svd-dac.ads
shakram02/Ada_Drivers_Library
a407ca7ddbc2d9756647016c2f8fd8ef24a239ff
[ "BSD-3-Clause" ]
192
2016-06-01T18:32:04.000Z
2022-03-26T22:52:31.000Z
arch/ARM/STM32/svd/stm32f46_79x/stm32_svd-dac.ads
morbos/Ada_Drivers_Library
a4ab26799be60997c38735f4056160c4af597ef7
[ "BSD-3-Clause" ]
239
2016-05-26T20:02:01.000Z
2022-03-31T09:46:56.000Z
arch/ARM/STM32/svd/stm32f46_79x/stm32_svd-dac.ads
morbos/Ada_Drivers_Library
a4ab26799be60997c38735f4056160c4af597ef7
[ "BSD-3-Clause" ]
142
2016-06-05T08:12:20.000Z
2022-03-24T17:37:17.000Z
-- This spec has been automatically generated from STM32F46_79x.svd pragma Restrictions (No_Elaboration_Code); pragma Ada_2012; pragma Style_Checks (Off); with HAL; with System; package STM32_SVD.DAC is pragma Preelaborate; --------------- -- Registers -- --------------- subtype CR_TSEL1_Field is HAL.UInt3; subtype CR_WAVE1_Field is HAL.UInt2; subtype CR_MAMP1_Field is HAL.UInt4; subtype CR_TSEL2_Field is HAL.UInt3; subtype CR_WAVE2_Field is HAL.UInt2; subtype CR_MAMP2_Field is HAL.UInt4; -- control register type CR_Register is record -- DAC channel1 enable EN1 : Boolean := False; -- DAC channel1 output buffer disable BOFF1 : Boolean := False; -- DAC channel1 trigger enable TEN1 : Boolean := False; -- DAC channel1 trigger selection TSEL1 : CR_TSEL1_Field := 16#0#; -- DAC channel1 noise/triangle wave generation enable WAVE1 : CR_WAVE1_Field := 16#0#; -- DAC channel1 mask/amplitude selector MAMP1 : CR_MAMP1_Field := 16#0#; -- DAC channel1 DMA enable DMAEN1 : Boolean := False; -- DAC channel1 DMA Underrun Interrupt enable DMAUDRIE1 : Boolean := False; -- unspecified Reserved_14_15 : HAL.UInt2 := 16#0#; -- DAC channel2 enable EN2 : Boolean := False; -- DAC channel2 output buffer disable BOFF2 : Boolean := False; -- DAC channel2 trigger enable TEN2 : Boolean := False; -- DAC channel2 trigger selection TSEL2 : CR_TSEL2_Field := 16#0#; -- DAC channel2 noise/triangle wave generation enable WAVE2 : CR_WAVE2_Field := 16#0#; -- DAC channel2 mask/amplitude selector MAMP2 : CR_MAMP2_Field := 16#0#; -- DAC channel2 DMA enable DMAEN2 : Boolean := False; -- DAC channel2 DMA underrun interrupt enable DMAUDRIE2 : Boolean := False; -- unspecified Reserved_30_31 : HAL.UInt2 := 16#0#; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for CR_Register use record EN1 at 0 range 0 .. 0; BOFF1 at 0 range 1 .. 1; TEN1 at 0 range 2 .. 2; TSEL1 at 0 range 3 .. 5; WAVE1 at 0 range 6 .. 7; MAMP1 at 0 range 8 .. 11; DMAEN1 at 0 range 12 .. 12; DMAUDRIE1 at 0 range 13 .. 13; Reserved_14_15 at 0 range 14 .. 15; EN2 at 0 range 16 .. 16; BOFF2 at 0 range 17 .. 17; TEN2 at 0 range 18 .. 18; TSEL2 at 0 range 19 .. 21; WAVE2 at 0 range 22 .. 23; MAMP2 at 0 range 24 .. 27; DMAEN2 at 0 range 28 .. 28; DMAUDRIE2 at 0 range 29 .. 29; Reserved_30_31 at 0 range 30 .. 31; end record; -- SWTRIGR_SWTRIG array type SWTRIGR_SWTRIG_Field_Array is array (1 .. 2) of Boolean with Component_Size => 1, Size => 2; -- Type definition for SWTRIGR_SWTRIG type SWTRIGR_SWTRIG_Field (As_Array : Boolean := False) is record case As_Array is when False => -- SWTRIG as a value Val : HAL.UInt2; when True => -- SWTRIG as an array Arr : SWTRIGR_SWTRIG_Field_Array; end case; end record with Unchecked_Union, Size => 2; for SWTRIGR_SWTRIG_Field use record Val at 0 range 0 .. 1; Arr at 0 range 0 .. 1; end record; -- software trigger register type SWTRIGR_Register is record -- Write-only. DAC channel1 software trigger SWTRIG : SWTRIGR_SWTRIG_Field := (As_Array => False, Val => 16#0#); -- unspecified Reserved_2_31 : HAL.UInt30 := 16#0#; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for SWTRIGR_Register use record SWTRIG at 0 range 0 .. 1; Reserved_2_31 at 0 range 2 .. 31; end record; subtype DHR12R1_DACC1DHR_Field is HAL.UInt12; -- channel1 12-bit right-aligned data holding register type DHR12R1_Register is record -- DAC channel1 12-bit right-aligned data DACC1DHR : DHR12R1_DACC1DHR_Field := 16#0#; -- unspecified Reserved_12_31 : HAL.UInt20 := 16#0#; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for DHR12R1_Register use record DACC1DHR at 0 range 0 .. 11; Reserved_12_31 at 0 range 12 .. 31; end record; subtype DHR12L1_DACC1DHR_Field is HAL.UInt12; -- channel1 12-bit left aligned data holding register type DHR12L1_Register is record -- unspecified Reserved_0_3 : HAL.UInt4 := 16#0#; -- DAC channel1 12-bit left-aligned data DACC1DHR : DHR12L1_DACC1DHR_Field := 16#0#; -- unspecified Reserved_16_31 : HAL.UInt16 := 16#0#; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for DHR12L1_Register use record Reserved_0_3 at 0 range 0 .. 3; DACC1DHR at 0 range 4 .. 15; Reserved_16_31 at 0 range 16 .. 31; end record; subtype DHR8R1_DACC1DHR_Field is HAL.UInt8; -- channel1 8-bit right aligned data holding register type DHR8R1_Register is record -- DAC channel1 8-bit right-aligned data DACC1DHR : DHR8R1_DACC1DHR_Field := 16#0#; -- unspecified Reserved_8_31 : HAL.UInt24 := 16#0#; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for DHR8R1_Register use record DACC1DHR at 0 range 0 .. 7; Reserved_8_31 at 0 range 8 .. 31; end record; subtype DHR12R2_DACC2DHR_Field is HAL.UInt12; -- channel2 12-bit right aligned data holding register type DHR12R2_Register is record -- DAC channel2 12-bit right-aligned data DACC2DHR : DHR12R2_DACC2DHR_Field := 16#0#; -- unspecified Reserved_12_31 : HAL.UInt20 := 16#0#; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for DHR12R2_Register use record DACC2DHR at 0 range 0 .. 11; Reserved_12_31 at 0 range 12 .. 31; end record; subtype DHR12L2_DACC2DHR_Field is HAL.UInt12; -- channel2 12-bit left aligned data holding register type DHR12L2_Register is record -- unspecified Reserved_0_3 : HAL.UInt4 := 16#0#; -- DAC channel2 12-bit left-aligned data DACC2DHR : DHR12L2_DACC2DHR_Field := 16#0#; -- unspecified Reserved_16_31 : HAL.UInt16 := 16#0#; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for DHR12L2_Register use record Reserved_0_3 at 0 range 0 .. 3; DACC2DHR at 0 range 4 .. 15; Reserved_16_31 at 0 range 16 .. 31; end record; subtype DHR8R2_DACC2DHR_Field is HAL.UInt8; -- channel2 8-bit right-aligned data holding register type DHR8R2_Register is record -- DAC channel2 8-bit right-aligned data DACC2DHR : DHR8R2_DACC2DHR_Field := 16#0#; -- unspecified Reserved_8_31 : HAL.UInt24 := 16#0#; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for DHR8R2_Register use record DACC2DHR at 0 range 0 .. 7; Reserved_8_31 at 0 range 8 .. 31; end record; subtype DHR12RD_DACC1DHR_Field is HAL.UInt12; subtype DHR12RD_DACC2DHR_Field is HAL.UInt12; -- Dual DAC 12-bit right-aligned data holding register type DHR12RD_Register is record -- DAC channel1 12-bit right-aligned data DACC1DHR : DHR12RD_DACC1DHR_Field := 16#0#; -- unspecified Reserved_12_15 : HAL.UInt4 := 16#0#; -- DAC channel2 12-bit right-aligned data DACC2DHR : DHR12RD_DACC2DHR_Field := 16#0#; -- unspecified Reserved_28_31 : HAL.UInt4 := 16#0#; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for DHR12RD_Register use record DACC1DHR at 0 range 0 .. 11; Reserved_12_15 at 0 range 12 .. 15; DACC2DHR at 0 range 16 .. 27; Reserved_28_31 at 0 range 28 .. 31; end record; subtype DHR12LD_DACC1DHR_Field is HAL.UInt12; subtype DHR12LD_DACC2DHR_Field is HAL.UInt12; -- DUAL DAC 12-bit left aligned data holding register type DHR12LD_Register is record -- unspecified Reserved_0_3 : HAL.UInt4 := 16#0#; -- DAC channel1 12-bit left-aligned data DACC1DHR : DHR12LD_DACC1DHR_Field := 16#0#; -- unspecified Reserved_16_19 : HAL.UInt4 := 16#0#; -- DAC channel2 12-bit left-aligned data DACC2DHR : DHR12LD_DACC2DHR_Field := 16#0#; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for DHR12LD_Register use record Reserved_0_3 at 0 range 0 .. 3; DACC1DHR at 0 range 4 .. 15; Reserved_16_19 at 0 range 16 .. 19; DACC2DHR at 0 range 20 .. 31; end record; subtype DHR8RD_DACC1DHR_Field is HAL.UInt8; subtype DHR8RD_DACC2DHR_Field is HAL.UInt8; -- DUAL DAC 8-bit right aligned data holding register type DHR8RD_Register is record -- DAC channel1 8-bit right-aligned data DACC1DHR : DHR8RD_DACC1DHR_Field := 16#0#; -- DAC channel2 8-bit right-aligned data DACC2DHR : DHR8RD_DACC2DHR_Field := 16#0#; -- unspecified Reserved_16_31 : HAL.UInt16 := 16#0#; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for DHR8RD_Register use record DACC1DHR at 0 range 0 .. 7; DACC2DHR at 0 range 8 .. 15; Reserved_16_31 at 0 range 16 .. 31; end record; subtype DOR1_DACC1DOR_Field is HAL.UInt12; -- channel1 data output register type DOR1_Register is record -- Read-only. DAC channel1 data output DACC1DOR : DOR1_DACC1DOR_Field; -- unspecified Reserved_12_31 : HAL.UInt20; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for DOR1_Register use record DACC1DOR at 0 range 0 .. 11; Reserved_12_31 at 0 range 12 .. 31; end record; subtype DOR2_DACC2DOR_Field is HAL.UInt12; -- channel2 data output register type DOR2_Register is record -- Read-only. DAC channel2 data output DACC2DOR : DOR2_DACC2DOR_Field; -- unspecified Reserved_12_31 : HAL.UInt20; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for DOR2_Register use record DACC2DOR at 0 range 0 .. 11; Reserved_12_31 at 0 range 12 .. 31; end record; -- status register type SR_Register is record -- unspecified Reserved_0_12 : HAL.UInt13 := 16#0#; -- DAC channel1 DMA underrun flag DMAUDR1 : Boolean := False; -- unspecified Reserved_14_28 : HAL.UInt15 := 16#0#; -- DAC channel2 DMA underrun flag DMAUDR2 : Boolean := False; -- unspecified Reserved_30_31 : HAL.UInt2 := 16#0#; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for SR_Register use record Reserved_0_12 at 0 range 0 .. 12; DMAUDR1 at 0 range 13 .. 13; Reserved_14_28 at 0 range 14 .. 28; DMAUDR2 at 0 range 29 .. 29; Reserved_30_31 at 0 range 30 .. 31; end record; ----------------- -- Peripherals -- ----------------- -- Digital-to-analog converter type DAC_Peripheral is record -- control register CR : aliased CR_Register; -- software trigger register SWTRIGR : aliased SWTRIGR_Register; -- channel1 12-bit right-aligned data holding register DHR12R1 : aliased DHR12R1_Register; -- channel1 12-bit left aligned data holding register DHR12L1 : aliased DHR12L1_Register; -- channel1 8-bit right aligned data holding register DHR8R1 : aliased DHR8R1_Register; -- channel2 12-bit right aligned data holding register DHR12R2 : aliased DHR12R2_Register; -- channel2 12-bit left aligned data holding register DHR12L2 : aliased DHR12L2_Register; -- channel2 8-bit right-aligned data holding register DHR8R2 : aliased DHR8R2_Register; -- Dual DAC 12-bit right-aligned data holding register DHR12RD : aliased DHR12RD_Register; -- DUAL DAC 12-bit left aligned data holding register DHR12LD : aliased DHR12LD_Register; -- DUAL DAC 8-bit right aligned data holding register DHR8RD : aliased DHR8RD_Register; -- channel1 data output register DOR1 : aliased DOR1_Register; -- channel2 data output register DOR2 : aliased DOR2_Register; -- status register SR : aliased SR_Register; end record with Volatile; for DAC_Peripheral use record CR at 16#0# range 0 .. 31; SWTRIGR at 16#4# range 0 .. 31; DHR12R1 at 16#8# range 0 .. 31; DHR12L1 at 16#C# range 0 .. 31; DHR8R1 at 16#10# range 0 .. 31; DHR12R2 at 16#14# range 0 .. 31; DHR12L2 at 16#18# range 0 .. 31; DHR8R2 at 16#1C# range 0 .. 31; DHR12RD at 16#20# range 0 .. 31; DHR12LD at 16#24# range 0 .. 31; DHR8RD at 16#28# range 0 .. 31; DOR1 at 16#2C# range 0 .. 31; DOR2 at 16#30# range 0 .. 31; SR at 16#34# range 0 .. 31; end record; -- Digital-to-analog converter DAC_Periph : aliased DAC_Peripheral with Import, Address => System'To_Address (16#40007400#); end STM32_SVD.DAC;
33.534442
68
0.615455
2236f9d584fcf92da9bc6371e265048ad8e591c2
63,079
adb
Ada
3-mid/impact/source/3d/collision/broadphase/impact-d3-collision-bounding_volume_tree.adb
charlie5/lace
e9b7dc751d500ff3f559617a6fc3089ace9dc134
[ "0BSD" ]
20
2015-11-04T09:23:59.000Z
2022-01-14T10:21:42.000Z
3-mid/impact/source/3d/collision/broadphase/impact-d3-collision-bounding_volume_tree.adb
charlie5/lace
e9b7dc751d500ff3f559617a6fc3089ace9dc134
[ "0BSD" ]
2
2015-11-04T17:05:56.000Z
2015-12-08T03:16:13.000Z
3-mid/impact/source/3d/collision/broadphase/impact-d3-collision-bounding_volume_tree.adb
charlie5/lace
e9b7dc751d500ff3f559617a6fc3089ace9dc134
[ "0BSD" ]
1
2015-12-07T12:53:52.000Z
2015-12-07T12:53:52.000Z
with impact.d3.Vector; with ada.Unchecked_Deallocation; with Ada.Unchecked_Conversion; with System; with impact.d3.aabb_Util; package body impact.d3.collision.bounding_volume_Tree is subtype tNodeArray is Node_Vector; subtype tConstNodeArray is Node_Vector; procedure free is new ada.Unchecked_Deallocation (Node'Class, Node_view); type NodeEnumerator is new ICollide with record nodes : tConstNodeArray; end record; overriding procedure Process (Self : in out NodeEnumerator; n1 : access Node'Class) is begin Self.nodes.append (n1.all'Access); end Process; function indexof (node : access bounding_volume_Tree.Node'Class) return Integer is begin return Boolean'Pos (node.parent.state.childs (2) = node) + 1; end indexof; --- Defaults volumes -- -- AabbMm -- function FromCE (c, e : in math.Vector_3 ) return AabbMm is use Math; box : AabbMm; begin box.mi := c - e; box.mx := c + e; return box; end FromCE; function FromCR (c : in math.Vector_3; r : in math.Real) return AabbMm is begin return FromCE (c, (r, r, r)); end FromCR; function FromMM (mi, mx : in math.Vector_3) return AabbMm is box : AabbMm; begin box.mi := mi; box.mx := mx; return box; end FromMM; function FromPoints (pts : in Vector_3_array) return AabbMm is use impact.d3.Vector; box : AabbMm; begin box.mi := pts (1); box.mx := pts (1); for i in 2 .. pts'Last loop setMin (box.mi, pts (i)); setMax (box.mx, pts (i)); end loop; return box; end FromPoints; function FromPoints (ppts : in Vector_3_view_array; n : in Integer) return AabbMm is use impact.d3.Vector; box : AabbMm; begin box.mi := ppts (1).all; box.mx := ppts (1).all; for i in 2 .. n loop setMin (box.mi, ppts (i).all); setMax (box.mx, ppts (i).all); end loop; return box; end FromPoints; function Center (Self : in AabbMm) return math.Vector_3 is use Math; begin return (Self.mi + Self.mx) / 2.0; end Center; function Lengths (Self : in AabbMm) return math.Vector_3 is use Math; begin return Self.mx - Self.mi; end Lengths; function Extents (Self : in AabbMm) return math.Vector_3 is use Math; begin return (Self.mx - Self.mi) / 2.0; end Extents; function Mins (Self : in AabbMm) return math.Vector_3 is begin return Self.mi; end Mins; function Maxs (Self : in AabbMm) return math.Vector_3 is begin return Self.mx; end Maxs; procedure Expand (Self : in out AabbMm; e : in math.Vector_3) is use Math; begin Self.mi := Self.mi - e; Self.mx := Self.mx + e; end Expand; procedure SignedExpand (Self : in out AabbMm; e : in math.Vector_3) is begin if e (1) > 0.0 then Self.mx (1) := Self.mx (1) + e (1); else Self.mi (1) := Self.mi (1) + e (1); end if; if e (2) > 0.0 then Self.mx (2) := Self.mx (2) + e (2); else Self.mi (2) := Self.mi (2) + e (2); end if; if e (3) > 0.0 then Self.mx (3) := Self.mx (3) + e (3); else Self.mi (3) := Self.mi (3) + e (3); end if; end SignedExpand; function Contain (Self : in AabbMm'Class; a : in AabbMm'Class) return Boolean is begin return Self.mi (1) <= a.mi (1) and then Self.mi (2) <= a.mi (2) and then Self.mi (3) <= a.mi (3) and then Self.mx (1) >= a.mx (1) and then Self.mx (2) >= a.mx (2) and then Self.mx (3) >= a.mx (3); end Contain; function Classify (Self : in AabbMm; n : in math.Vector_3; o : in math.Real; s : in Integer) return Integer is use impact.d3.Vector; pi, px : math.Vector_3; begin case s is when 0+0+0 => px := Self.mi; pi := Self.mx; when 1+0+0 => px := (Self.mx (1), Self.mi (2), Self.mi (3)); pi := (Self.mi (1), Self.mx (2), Self.mx (3)); when 0+2+0 => px := (Self.mi (1), Self.mx (2), Self.mi (3)); pi := (Self.mx (1), Self.mi (2), Self.mx (3)); when 1+2+0 => px := (Self.mx (1), Self.mx (2), Self.mi (3)); pi := (Self.mi (1), Self.mi (2), Self.mx (3)); when 0+0+4 => px := (Self.mi (1), Self.mi (2), Self.mx (3)); pi := (Self.mx (1), Self.mx (2), Self.mi (3)); when 1+0+4 => px := (Self.mx (1), Self.mi (2), Self.mx (3)); pi := (Self.mi (1), Self.mx (2), Self.mi (3)); when 0+2+4 => px := (Self.mi (1), Self.mx (2), Self.mx (3)); pi := (Self.mx (1), Self.mi (2), Self.mi (3)); when 1+2+4 => px := (Self.mx (1), Self.mx (2), Self.mx (3)); pi := (Self.mi (1), Self.mi (2), Self.mi (3)); when others => raise Program_Error; end case; if dot (n, px) + o < 0.0 then return -1; end if; if dot (n, pi) + o >= 0.0 then return +1; end if; return 0; end Classify; function ProjectMinimum (Self : access AabbMm; v : in math.Vector_3; signs : in interfaces.Unsigned_32) return math.Real is use impact.d3.Vector; use type interfaces.Unsigned_32; b : constant Vector_3_view_array := (Self.mx'Access, Self.mi'Access); p : constant math.Vector_3 := (b (Integer (signs and 1)) (1), b (Integer ((signs / 2) and 1)) (2), b (Integer ((signs / 4) and 1)) (3)); begin return dot (p, v); end ProjectMinimum; function Intersect (a, b : in AabbMm'Class) return Boolean is begin return a.mi (1) <= b.mx (1) and then a.mx (1) >= b.mi (1) and then a.mi (2) <= b.mx (2) and then a.mx (2) >= b.mi (2) and then a.mi (3) <= b.mx (3) and then a.mx (3) >= b.mi (3); end Intersect; function Intersect (a : in AabbMm; b : in math.Vector_3) return Boolean is begin return (b (1) >= a.mi (1)) and then (b (2) >= a.mi (2)) and then (b (3) >= a.mi (3)) and then (b (1) <= a.mx (1)) and then (b (2) <= a.mx (2)) and then (b (3) <= a.mx (3)); end Intersect; function Proximity (a, b : in AabbMm) return math.Real is use Math; d : constant math.Vector_3 := (a.mi + a.mx) - (b.mi + b.mx); begin return abs (d (1)) + abs (d (2)) + abs (d (3)); end Proximity; function do_Select (o, a, b : in AabbMm) return Integer is begin if Proximity (o, a) < Proximity (o, b) then return 1; else return 2; end if; end do_Select; procedure Merge (a, b : in AabbMm; r : out AabbMm) is begin for i in 1 .. 3 loop if a.mi (i) < b.mi (i) then r.mi (i) := a.mi (i); else r.mi (i) := b.mi (i); end if; if a.mx (i) > b.mx (i) then r.mx (i) := a.mx (i); else r.mx (i) := b.mx (i); end if; end loop; end Merge; function merge (a, b : in Volume) return Volume is res : Volume; begin Merge (a, b, res); return res; end merge; -- volume+edge lengths -- function size (a : in Volume) return math.Real is edges : math.Vector_3 renames a.Lengths; begin return edges (1) * edges (2) * edges (3) + edges (1) + edges (2) + edges (3); end size; procedure getmaxdepth (node : access bounding_volume_Tree.Node'Class; depth : in Integer; maxdepth : in out Integer) is begin if node.isinternal then getmaxdepth (node.state.childs (1), depth + 1, maxdepth); getmaxdepth (node.state.childs (2), depth + 1, maxdepth); else maxdepth := Integer'Max (maxdepth, depth); end if; end getmaxdepth; procedure deletenode (pdbvt : access impact.d3.collision.bounding_volume_Tree.item; node : access bounding_volume_Tree.Node'Class) is begin free (pdbvt.m_free); pdbvt.m_free := node.all'Access; end deletenode; procedure recursedeletenode (pdbvt : access impact.d3.collision.bounding_volume_Tree.item; node : access bounding_volume_Tree.Node'Class) is begin if not node.isleaf then recursedeletenode (pdbvt, node.state.childs (1)); recursedeletenode (pdbvt, node.state.childs (2)); end if; if node = pdbvt.m_root then pdbvt.m_root := null; end if; deletenode (pdbvt, node); end recursedeletenode; function createnode (pdbvt : access impact.d3.collision.bounding_volume_Tree.item'Class; parent : access Node'Class; data : access Any'Class) return Node_view is node : Node_view; begin if pdbvt.m_free /= null then node := pdbvt.m_free; pdbvt.m_free := null; else node := new bounding_volume_Tree.Node; end if; node.parent := Node_view (parent); node.state := ( -- kind => use_data, data => data, childs => (others => null), dataasint => 0); return node; end createnode; function createnode (pdbvt : access impact.d3.collision.bounding_volume_Tree.item'Class; parent : access Node'Class; volume : in bounding_volume_Tree.Volume; data : access Any'Class) return Node_view is node : constant Node_view := createnode (pdbvt, parent, data).all'Access; begin node.volume := volume; return node; end createnode; function createnode (pdbvt : access impact.d3.collision.bounding_volume_Tree.item; parent : access Node'Class; volume0 : in Volume; volume1 : in Volume; data : access Any'Class) return Node_view is node : constant Node_view := createnode (pdbvt, parent, data).all'Access; begin Merge (volume0, volume1, node.volume); return node; end createnode; procedure insertleaf (pdbvt : access impact.d3.collision.bounding_volume_Tree.item; the_root, leaf : in Node_view) is root : Node_view := the_Root; prev, node : Node_view; begin if pdbvt.m_root = null then pdbvt.m_root := leaf.all'Access; leaf.parent := null; else if not root.isleaf then loop root := root.state.childs (do_Select (leaf.volume, root.state.childs (1).volume, root.state.childs (2).volume)); exit when root.isleaf; end loop; end if; prev := root.parent; node := createnode (pdbvt, prev, leaf.volume, root.volume, null); if prev /= null then prev.state.childs (indexof (root)) := node.all'Access; node.state.childs (1) := root; root.parent := node; node.state.childs (2) := leaf; leaf.parent := node; loop if not prev.volume.Contain (node.volume) then Merge (prev.state.childs (1).volume, prev.state.childs (2).volume, prev.volume); else exit; end if; node := prev; prev := node.parent; exit when prev = null; end loop; else node.state.childs (1) := root; root.parent := node; node.state.childs (2) := leaf; leaf.parent := node; pdbvt.m_root := node; end if; end if; end insertleaf; function removeleaf (pdbvt : access impact.d3.collision.bounding_volume_Tree.item; leaf : in Node_view) return Node_view is parent, prev, sibling : Node_view; begin if leaf = pdbvt.m_root then pdbvt.m_root := null; return null; else parent := leaf.parent; prev := parent.parent; if indexof (leaf) = 1 then sibling := parent.state.childs (2); else sibling := parent.state.childs (1); end if; -- sibling := parent.state.childs (1 - indexof (leaf)); if prev /= null then prev.state.childs (indexof (parent)) := sibling; sibling.parent := prev; deletenode (pdbvt, parent); while prev /= null loop declare pb : Volume renames prev.volume; begin Merge (prev.state.childs (1).volume, prev.state.childs (2).volume, prev.volume); if NotEqual (pb, prev.volume) then prev := prev.parent; else exit; end if; end; end loop; if prev /= null then return prev; else return pdbvt.m_root; end if; else pdbvt.m_root := sibling; sibling.parent := null; deletenode (pdbvt, parent); return pdbvt.m_root; end if; end if; end removeleaf; procedure fetchleaves (pdbvt : access impact.d3.collision.bounding_volume_Tree.item; root : in Node_view; leaves : in out tNodeArray; depth : in Integer := -1) is begin if root.isinternal and then depth /= 0 then fetchleaves (pdbvt, root.state.childs (1), leaves, depth - 1); fetchleaves (pdbvt, root.state.childs (2), leaves, depth - 1); deletenode (pdbvt, root); else leaves.append (root); end if; end fetchleaves; procedure split (leaves : in tNodeArray; left, right : in out tNodeArray; org, axis : in math.Vector_3) is use impact.d3.Vector, Math; begin left.clear; right.clear; for i in 1 .. Integer (leaves.Length) loop if dot (axis, leaves.Element (i).volume.Center - org) < 0.0 then left .append (leaves.Element (i)); else right.append (leaves.Element (i)); end if; end loop; end split; function bounds (leaves : in tNodeArray) return Volume is volume : bounding_volume_Tree.Volume := leaves.Element (1).volume; begin for i in 2 .. Integer (leaves.Length) loop Merge (volume, leaves.Element (i).volume, volume); end loop; return volume; end bounds; procedure bottomup (pdbvt : access impact.d3.collision.bounding_volume_Tree.item; leaves : in out tNodeArray) is use type ada.containers.Count_type; begin while leaves.Length > 1 loop declare minsize : math.Real := math.Real'Last; minidx : math.Integers := (1 => -1, 2 => -1); sz : math.Real; begin for i in 1 .. Integer (leaves.Length) loop for j in i + 1 .. Integer (leaves.Length) loop sz := size (merge (leaves.Element (i).volume, leaves.Element (j).volume)); if sz < minsize then minsize := sz; minidx (1) := i; minidx (2) := j; end if; end loop; end loop; declare n : constant Node_views := (leaves.Element (minidx (1)), leaves.Element (minidx (2))); p : constant Node_view := createnode (pdbvt, null, n (1).volume, n (2).volume, null); begin p.state.childs (1) := n (1); p.state.childs (2) := n (2); n (1).parent := p; n (2).parent := p; leaves.replace_Element (minidx (1), p); leaves.swap (minidx (2), Integer (leaves.Length) - 0); leaves.delete_Last; end; end; end loop; end bottomup; axis : constant Vector_3_array := ((1.0, 0.0, 0.0), (0.0, 1.0, 0.0), (0.0, 0.0, 1.0)); function topdown (pdbvt : access impact.d3.collision.bounding_volume_Tree.item; leaves : access tNodeArray; bu_treshold : in Integer ) return Node_view is use type ada.containers.Count_type; begin if leaves.Length > 1 then if Integer (leaves.Length) > bu_treshold then declare use ada.Containers, Interfaces; vol : Volume renames bounds (leaves.all); org : math.Vector_3 renames vol.Center; sets : array (1 .. 2) of aliased tNodeArray; bestaxis : Integer := -1; bestmidp : Integer := Integer (leaves.Length); splitcount : array (1 .. 3, 1 .. 2) of Integer := ((0, 0), (0, 0), (0, 0)); begin for i in 1 .. Integer (leaves.Length) loop declare use impact.d3.Vector, Math; x : constant math.Vector_3 := leaves.Element (i).volume.Center - org; begin for j in 1 .. 3 loop if dot (x, axis (j)) > 0.0 then splitcount (j, 2) := splitcount (j, 2) + 1; else splitcount (j, 1) := splitcount (j, 1) + 1; end if; end loop; end; end loop; for i in 1 .. 3 loop if (splitcount (i, 1) > 0) and then (splitcount (i, 2) > 0) then declare midp : constant Integer := Integer (abs (math.Real (splitcount (i, 1) - splitcount (i, 2)))); begin if midp < bestmidp then bestaxis := i; bestmidp := midp; end if; end; end if; end loop; if bestaxis >= 0 then sets (1).reserve_Capacity (Count_type (splitcount (bestaxis, 1))); sets (2).reserve_Capacity (Count_type (splitcount (bestaxis, 2))); split (leaves.all, sets (1), sets (2), org, axis (bestaxis)); else sets (1).reserve_Capacity (leaves.Length / 2 + 1); sets (2).reserve_Capacity (leaves.Length / 2); for i in 1 .. Integer (leaves.Length) loop sets (Integer (Unsigned_32 (i) and 1)).append (leaves.Element (i)); end loop; end if; declare node : constant Node_view := createnode (pdbvt, null, vol, null).all'Access; begin node.state.childs (1) := topdown (pdbvt, sets (1)'Access, bu_treshold); node.state.childs (2) := topdown (pdbvt, sets (2)'Access, bu_treshold); node.state.childs (1).parent := node; node.state.childs (2).parent := node; return node; end; end; else bottomup (pdbvt, leaves.all); return leaves.Element (1); end if; end if; return leaves.Element (1); end topdown; function sort (n : in Node_view; r : access Node_view) return Node_view is use type ada.containers.Count_type; p : constant Node_view := n.parent; pragma Assert (n.isinternal); function to_long_Integer is new ada.unchecked_Conversion (System.address, Long_Integer); begin if p /= null and then to_long_Integer (p.all'Address) -- tbd: check this ! > to_long_Integer (n.all'Address) then declare i : Integer renames indexof (n); j : constant Integer := 3 - i; s : constant Node_view := p.state.childs (j); q : constant Node_view := p.parent; pragma Assert (n = p.state.childs (i)); begin if q /= null then q.state.childs (indexof (p)) := n.all'Access; else r.all := n.all'Access; end if; s.parent := n.all'Access; p.parent := n.all'Access; n.parent := q; p.state.childs (1) := n.state.childs (1); p.state.childs (2) := n.state.childs (2); n.state.childs (1).parent := p; n.state.childs (2).parent := p; n.state.childs (i) := p; n.state.childs (j) := s; declare -- swap p and q volumes Pad : constant Volume := p.volume; begin p.volume := n.volume; n.volume := Pad; end; return p; end; end if; return n; end sort; function NotEqual (a, b : in AabbMm) return Boolean is begin return a.mi (1) /= b.mi (1) or else a.mi (2) /= b.mi (2) or else a.mi (3) /= b.mi (3) or else a.mx (1) /= b.mx (1) or else a.mx (2) /= b.mx (2) or else a.mx (3) /= b.mx (3); end NotEqual; -- Node -- function isleaf (Self : in Node) return Boolean is begin return Self.state.childs (2) = null; end isleaf; function isinternal (Self : in Node) return Boolean is begin return not Self.isleaf; end isinternal; --- Policies/Interfaces -- -- ICollide -- procedure Process (Self : in out ICollide; n : access Node'Class; a : in math.Real) is pragma Unreferenced (a); begin Self.process (n); end Process; function Descent (Self : in ICollide; n : in Node'Class) return Boolean is pragma Unreferenced (Self, n); begin return True; end Descent; function Allleaves (Self : in ICollide; n : in Node'Class) return Boolean is pragma Unreferenced (Self, n); begin return True; end Allleaves; --- impact.d3.collision.bounding_volume_Tree -- procedure destruct (Self : in out Item) is begin Self.clear; end destruct; procedure clear (Self : in out Item) is begin if Self.m_root /= null then recursedeletenode (Self'Access, Self.m_root); end if; free (Self.m_free); Self.m_lkhd := -1; Self.m_stkStack.clear; Self.m_opath := 0; end clear; function empty (Self : in Item) return Boolean is begin return Self.m_root = null; end empty; procedure optimizeBottomUp (Self : in out Item) is use ada.Containers; begin if Self.m_root /= null then declare leaves : tNodeArray; begin leaves.reserve_Capacity (Count_type (Self.m_leaves)); fetchleaves (Self'Access, Self.m_root, leaves); bottomup (Self'Access, leaves); Self.m_root := leaves.Element (1); end; end if; end optimizeBottomUp; procedure optimizeTopDown (Self : in out Item; bu_treshold : Integer := 128) is begin if Self.m_root /= null then declare use ada.Containers; leaves : aliased tNodeArray; begin leaves.reserve_Capacity (Count_type (Self.m_leaves)); fetchleaves (Self'Access, Self.m_root, leaves); Self.m_root := topdown (Self'Access, leaves'Access, bu_treshold); end; end if; end optimizeTopDown; procedure optimizeIncremental (Self : in out Item; pass_Count : Integer) is passes : Integer := pass_Count; begin if passes < 0 then passes := Self.m_leaves; end if; if Self.m_root /= null and then passes > 0 then loop declare use Interfaces; node : Node_view := Self.m_root; bit : Unsigned_32 := 0; begin while node.isinternal loop node := sort (node, Self.m_root'Access).state.childs (Integer ((Self.m_opath / 2**Natural (bit)) and 1) + 1); bit := (bit + 1) and (unsigned_32'Size - 1); end loop; Self.update (node.all'Access); Self.m_opath := Self.m_opath + 1; passes := passes - 1; exit when passes = 0; end; end loop; end if; end optimizeIncremental; function insert (Self : access Item; volume : in bounding_volume_Tree.Volume'Class; data : access Any'Class ) return access Node'Class is leaf : constant Node_view := createnode (Self, null, bounding_volume_Tree.Volume (volume), data); begin insertleaf (Self, Self.m_root, leaf); Self.m_leaves := Self.m_leaves + 1; return leaf; end insert; procedure update (Self : in out Item; leaf : access Node'Class; lookahead : in Integer := -1) is root : Node_view := removeleaf (Self'Access, leaf.all'Access); i : Integer; begin if root /= null then if lookahead >= 0 then i := 1; while i <= lookahead and then root.parent /= null loop root := root.parent; i := i + 1; end loop; else root := Self.m_root; end if; end if; insertleaf (Self'Access, root, leaf.all'Access); end update; procedure update (Self : in out Item; leaf : access Node 'Class; volume : in bounding_volume_Tree.Volume'Class) is root : Node_view := removeleaf (Self'Access, leaf.all'Access); i : Integer; begin if root /= null then if Self.m_lkhd >= 0 then i := 1; while i <= Self.m_lkhd and then root.parent /= null loop root := root.parent; i := i + 1; end loop; else root := Self.m_root; end if; end if; leaf.volume := bounding_volume_Tree.Volume (volume); insertleaf (Self'Access, root, leaf.all'Access); end update; function update (Self : access Item; leaf : access Node 'Class; volume : access bounding_volume_Tree.Volume'Class; velocity : in math.Vector_3; margin : in math.Real ) return Boolean is begin if leaf.volume.Contain (volume.all) then return False; end if; volume.Expand ((margin, margin, margin)); volume.SignedExpand (velocity); Self.update (leaf, volume.all); return True; end update; function update (Self : access Item; leaf : access Node 'Class; volume : access bounding_volume_Tree.Volume'Class; velocity : in math.Vector_3) return Boolean is begin if leaf.volume.Contain (volume.all) then return False; end if; volume.SignedExpand (velocity); Self.update (leaf, volume.all); return True; end update; function update (Self : access Item; leaf : access Node 'Class; volume : access bounding_volume_Tree.Volume'Class; margin : in math.Real ) return Boolean is begin if leaf.volume.Contain (volume.all) then return False; end if; volume.Expand ((margin, margin, margin)); Self.update (leaf, volume.all); return True; end update; procedure remove (Self : in out Item; leaf : access Node 'Class) is unused : Node_view; pragma Unreferenced (unused); begin unused := removeleaf (Self'Access, leaf.all'Access); deletenode (Self'Access, leaf); Self.m_leaves := Self.m_leaves - 1; end remove; procedure write (Self : in Item; iwriter : access impact.d3.collision.bounding_volume_Tree.IWriter'Class) is use ada.Containers; nodes : aliased NodeEnumerator; begin nodes.nodes.reserve_Capacity (Count_type (Self.m_leaves) * 2); enumNodes (Self.m_root, nodes'Access); iwriter.Prepare (Self.m_root.all, Integer (nodes.nodes.Length)); for i in 1 .. Integer (nodes.nodes.Length) loop declare n : Node_view renames nodes.nodes.Element (i); p : Integer := -1; begin if n.parent /= null then p := nodes.nodes.find_Index (n.parent); end if; if n.isinternal then declare c0 : Integer renames nodes.nodes.find_Index (n.state.childs (1)); c1 : Integer renames nodes.nodes.find_Index (n.state.childs (2)); begin iwriter.WriteNode (n.all, i, p, c0, c1); end; else iwriter.WriteLeaf (n.all, i, p); end if; end; end loop; end write; procedure clone (Self : in Item; dest : access Item'Class; iclone : access impact.d3.collision.bounding_volume_Tree.IClone'Class := null) is begin dest.clear; if Self.m_root /= null then declare use ada.Containers; stack : sStkCLN_Vector; begin stack.reserve_Capacity (Count_type (Self.m_leaves)); stack.append (sStkCLN' (Self.m_root, null)); loop declare use Interfaces; i : constant Integer := Integer (stack.Length); e : sStkCLN renames stack.Element (i); n : constant Node_view := createnode (dest, e.parent, e.node.volume, e.node.state.data); begin stack.delete_Last; if e.parent /= null then e.parent.state.childs (Integer (Unsigned_32 (i) and 1)) := n; else dest.m_root := n; end if; if e.node.isinternal then stack.append (sStkCLN'(e.node.state.childs (1), n)); stack.append (sStkCLN'(e.node.state.childs (2), n)); else iclone.CloneLeaf (n.all); end if; exit when stack.Length = 0; end; end loop; end; end if; end clone; function maxdepth (node : access bounding_volume_Tree.Node) return Integer is depth : Integer := 0; begin if node /= null then getmaxdepth (node, 1, depth); end if; return depth; end maxdepth; function countLeaves (node : in bounding_volume_Tree.Node) return Integer is begin if node.isinternal then return countleaves (node.state.childs (1).all) + countleaves (node.state.childs (2).all); else return 1; end if; end countLeaves; procedure extractleaves (node : access bounding_volume_Tree.Node; leaves : out Node_Vector) is begin if node.isinternal then extractleaves (node.state.childs (1), leaves); extractleaves (node.state.childs (2), leaves); else leaves.append (node.all'Access); end if; end extractleaves; procedure enumNodes (root : access Node; policy : access ICollide'Class) is begin policy.Process (root); if root.isinternal then enumNodes (root.state.childs (1), policy); enumNodes (root.state.childs (2), policy); end if; end enumNodes; procedure enumleaves (root : access Node; policy : access ICollide'Class) is begin if root.isinternal then enumleaves (root.state.childs (1), policy); enumleaves (root.state.childs (2), policy); else policy.Process (root); end if; end enumleaves; procedure collideTT (Self : in out Item; root0, root1 : access Node'Class; policy : access ICollide 'Class) is pragma Unreferenced (Self); begin if root0 /= null and then root1 /= null then declare depth : Integer := 1; treshold : Integer := DOUBLE_STACKSIZE - 4; stkStack : sStkNN_Vector; -- btAlignedObjectArray<sStkNN> stkStack; begin stkStack.set_Length (DOUBLE_STACKSIZE); stkStack.replace_Element (1, sStkNN'(root0, root1)); loop declare use type ada.containers.Count_type; p : sStkNN := stkStack.Element (depth); begin depth := depth - 1; if depth > treshold then stkStack.set_Length (stkStack.Length * 2); treshold := Integer (stkStack.Length - 4); end if; if p.a = p.b then if p.a.isinternal then depth := depth + 1; stkStack.replace_Element (depth, sStkNN'(p.a.state.childs (1).all'Access, p.a.state.childs (1).all'Access)); depth := depth + 1; stkStack.replace_Element (depth, sStkNN'(p.a.state.childs (2).all'Access, p.a.state.childs (2).all'Access)); depth := depth + 1; stkStack.replace_Element (depth, sStkNN'(p.a.state.childs (1).all'Access, p.a.state.childs (2).all'Access)); end if; elsif Intersect (p.a.volume, p.b.volume) then if p.a.isinternal then if p.b.isinternal then depth := depth + 1; stkStack.replace_Element (depth, sStkNN'(p.a.state.childs (1).all'Access, p.b.state.childs (1).all'Access)); depth := depth + 1; stkStack.replace_Element (depth, sStkNN'(p.a.state.childs (2).all'Access, p.b.state.childs (1).all'Access)); depth := depth + 1; stkStack.replace_Element (depth, sStkNN'(p.a.state.childs (1).all'Access, p.b.state.childs (2).all'Access)); depth := depth + 1; stkStack.replace_Element (depth, sStkNN'(p.a.state.childs (2).all'Access, p.b.state.childs (2).all'Access)); else depth := depth + 1; stkStack.replace_Element (depth, sStkNN'(p.a.state.childs (1).all'Access, p.b)); depth := depth + 1; stkStack.replace_Element (depth, sStkNN'(p.a.state.childs (2).all'Access, p.b)); end if; else if p.b.isinternal then depth := depth + 1; stkStack.replace_Element (depth, sStkNN'(p.a, p.b.state.childs (1).all'Access)); depth := depth + 1; stkStack.replace_Element (depth, sStkNN'(p.a, p.b.state.childs (2).all'Access)); else policy.Process (p.a, p.b); end if; end if; end if; exit when depth = 0; end; end loop; end; end if; end collideTT; procedure collideTTpersistentStack (Self : in out Item; root0, root1 : access Node'Class; policy : access ICollide'Class) is depth, threshold : Integer; begin if root0 /= null and then root1 /= null then depth := 1; threshold := DOUBLE_STACKSIZE - 4; Self.m_stkStack.set_Length (DOUBLE_STACKSIZE); Self.m_stkStack.replace_Element (1, sStkNN'(root0, root1)); loop declare use type ada.containers.Count_type; p : sStkNN := Self.m_stkStack.Element (depth); begin depth := depth - 1; if depth > threshold then Self.m_stkStack.set_Length (Self.m_stkStack.Length * 2); threshold := Integer (Self.m_stkStack.Length) - 4; end if; if p.a = p.b then if p.a.isinternal then depth := depth + 1; Self.m_stkStack.replace_Element (depth, sStkNN'(p.a.state.childs (1), p.a.state.childs (1))); depth := depth + 1; Self.m_stkStack.replace_Element (depth, sStkNN'(p.a.state.childs (2), p.a.state.childs (2))); depth := depth + 1; Self.m_stkStack.replace_Element (depth, sStkNN'(p.a.state.childs (1), p.a.state.childs (2))); end if; elsif Intersect (p.a.volume, p.b.volume) then if p.a.isinternal then if p.b.isinternal then depth := depth + 1; Self.m_stkStack.replace_Element (depth, sStkNN'(p.a.state.childs (1), p.b.state.childs (1))); depth := depth + 1; Self.m_stkStack.replace_Element (depth, sStkNN'(p.a.state.childs (2), p.b.state.childs (1))); depth := depth + 1; Self.m_stkStack.replace_Element (depth, sStkNN'(p.a.state.childs (1), p.b.state.childs (2))); depth := depth + 1; Self.m_stkStack.replace_Element (depth, sStkNN'(p.a.state.childs (2), p.b.state.childs (2))); else depth := depth + 1; Self.m_stkStack.replace_Element (depth, sStkNN'(p.a.state.childs (1), p.b)); depth := depth + 1; Self.m_stkStack.replace_Element (depth, sStkNN'(p.a.state.childs (2), p.b)); end if; else if p.b.isinternal then depth := depth + 1; Self.m_stkStack.replace_Element (depth, sStkNN'(p.a, p.b.state.childs (1))); depth := depth + 1; Self.m_stkStack.replace_Element (depth, sStkNN'(p.a, p.b.state.childs (2))); else policy.Process (p.a, p.b); end if; end if; end if; exit when depth = 0; end; end loop; end if; end collideTTpersistentStack; procedure collideTV (Self : in Item; root : access Node'Class; vol : in Volume'Class; policy : access ICollide 'Class) is pragma Unreferenced (Self); begin if root /= null then declare use Node_Vectors; volume : constant bounding_volume_Tree.Volume'Class := vol; stack : Node_Vector; -- btAlignedObjectArray<const Node*> ; begin stack.clear; stack.reserve_Capacity (SIMPLE_STACKSIZE); stack.append (root.all'Access); loop declare use type ada.containers.Count_type; n : constant access Node := stack.last_Element; begin stack.delete_Last; if Intersect (n.volume, volume) then if n.isinternal then stack.append (n.state.childs (1)); stack.append (n.state.childs (2)); else policy.Process (n); end if; end if; exit when stack.Length = 0; end; end loop; end; end if; end collideTV; procedure rayTest (root : access Node; rayFrom, rayTo : in math.Vector_3; policy : access ICollide'Class) is use impact.d3.Vector, Math; COMPARE_BTRAY_AABB2 : constant Boolean := True; rayDir : math.Vector_3; rayDirectionInverse : math.vector_3; begin if root /= null then rayDir := Normalized (rayTo - rayFrom); --- what about division by zero? --> just set rayDirection[i] to INF/BT_LARGE_FLOAT -- if rayDir (1) = 0.0 then rayDirectionInverse (1) := BT_LARGE_FLOAT; else rayDirectionInverse (1) := 1.0 / rayDir (1); end if; if rayDir (2) = 0.0 then rayDirectionInverse (2) := BT_LARGE_FLOAT; else rayDirectionInverse (2) := 1.0 / rayDir (2); end if; if rayDir (3) = 0.0 then rayDirectionInverse (3) := BT_LARGE_FLOAT; else rayDirectionInverse (3) := 1.0 / rayDir (3); end if; declare signs : constant impact.d3.aabb_Util.Signs := (Boolean'Pos (rayDirectionInverse (1) < 0.0), Boolean'Pos (rayDirectionInverse (2) < 0.0), Boolean'Pos (rayDirectionInverse (3) < 0.0)); lambda_max : math.Real := dot (rayDir, rayTo - rayFrom); resultNormal : aliased math.vector_3; stack : Node_Vector; depth : Integer := 1; threshold : Integer := DOUBLE_STACKSIZE - 2; bounds : impact.d3.aabb_Util.Bounds; begin stack.set_Length (DOUBLE_STACKSIZE); stack.replace_Element (1, root.all'Access); loop declare use impact.d3.aabb_Util; use type ada.Containers.Count_type; node : constant access bounding_volume_Tree.Node := stack.Element (depth); tmin : aliased math.Real := 1.0; lambda_min : constant math.Real := 0.0; result1 : Boolean; begin depth := depth - 1; bounds (1) := node.volume.Mins; bounds (2) := node.volume.Maxs; result1 := btRayAabb2 (rayFrom, rayDirectionInverse, signs, bounds, tmin'Access, lambda_min, lambda_max); if COMPARE_BTRAY_AABB2 then declare param : aliased math.Real := 1.0; result2 : constant Boolean := btRayAabb (rayFrom, rayTo, node.volume.Mins, node.volume.Maxs, param 'Access, resultNormal'Access); pragma Assert (result1 = result2); begin null; end; end if; if result1 then if node.isinternal then if depth > threshold then stack.set_Length (stack.Length * 2); threshold := Integer (stack.Length - 2); end if; depth := depth + 1; stack.replace_Element (depth, node.state.childs (1)); depth := depth + 1; stack.replace_Element (depth, node.state.childs (2)); else policy.Process (node); end if; end if; exit when depth = 0; end; end loop; end; end if; end rayTest; procedure rayTestInternal (Self : in out Item; root : access Node'Class; rayFrom, rayTo, rayDirectionInverse : in math.Vector_3; signs : in impact.d3.aabb_Util.Signs; lambda_max : in math.Real; aabbMin, aabbMax : in math.Vector_3; policy : access ICollide'Class) is pragma Unreferenced (Self, rayTo); begin if root /= null then declare -- resultNormal : math.Vector_3; depth : Integer := 1; threshold : Integer := DOUBLE_STACKSIZE - 2; stack : Node_Vector; bounds : Vector_3_array (1 .. 2); begin stack.set_Length (DOUBLE_STACKSIZE); stack.replace_Element (1, root.all'Access); loop declare use impact.d3.aabb_Util, Math; use type ada.containers.Count_type; node : constant access bounding_volume_Tree.Node := stack.Element (depth); tmin : aliased math.Real := 1.0; lambda_min : constant math.Real := 0.0; result1 : Boolean := False; begin depth := depth - 1; bounds (1) := node.volume.Mins - aabbMax; bounds (2) := node.volume.Maxs - aabbMin; result1 := btRayAabb2 (rayFrom, rayDirectionInverse, signs, bounds, tmin'Access, lambda_min, lambda_max); if result1 then if node.isinternal then if depth > threshold then stack.set_Length (stack.Length * 2); threshold := Integer (stack.Length) - 2; end if; depth := depth + 1; stack.replace_Element (depth, node.state.childs (1)); depth := depth + 1; stack.replace_Element (depth, node.state.childs (2)); else policy.Process (node); end if; end if; exit when depth = 0; end; end loop; end; end if; end rayTestInternal; -- Helpers -- function nearest (i : in Integer_Vector; a : in sStkNPS_Vector; v : in math.Real; the_l, the_h : in Integer) return Integer is l : Integer := the_l; h : Integer := the_h; m : Integer := 0; begin while l < h loop m := (l + h) / 2; if a.Element (i.Element (m)).value >= v then l := m + 1; else h := m; end if; end loop; return h; end nearest; function allocate (ifree : access Integer_Vector; stock : access sStkNPS_Vector; value : in sStkNPS ) return Integer is use type ada.containers.Count_Type; i : Integer; begin if ifree.Length > 0 then i := ifree.last_Element; ifree.delete_Last; stock.replace_Element (i, value); else stock.append (value); i := Integer (stock.Length); end if; return i; end allocate; --- Collide operations -- procedure collideKDOP (root : access Node; normals : in Vector_3_array; offsets : in math.Vector; count : in Integer; policy : access ICollide'Class) is begin if root /= null then declare use Interfaces; use type Flags; inside : constant Flags := 2**count - 1; stack : sStkNP_Vector; signs : array (1 .. Unsigned_32'Size * 8 * 8) of Integer; pragma Assert (count < Integer ((signs'Size / 8) / (signs (1)'Size / 8))); begin for i in 1 .. count loop declare N_x, N_y, N_z : Unsigned_32; begin if normals (i) (1) >= 0.0 then N_x := 1; else N_x := 0; end if; if normals (i) (2) >= 0.0 then N_y := 2; else N_y := 0; end if; if normals (i) (3) >= 0.0 then N_z := 4; else N_z := 0; end if; signs (i) := Integer (N_x + N_y + N_z); end; end loop; stack.reserve_Capacity (SIMPLE_STACKSIZE); stack.append (sStkNP'(root, 0)); loop declare use type Flags, ada.containers.Count_type; se : sStkNP := stack.last_Element; the_out : Boolean := False; side : Integer; i : Integer; j : Flags; begin stack.delete_Last; i := 1; j := 2; while not the_out and then i <= count loop if 0 = (se.mask and j) then side := se.node.volume.Classify (normals (i), offsets (i), signs (i)); case side is when -1 => the_out := True; when +1 => se.mask := se.mask or j; when others => raise Program_Error; end case; end if; i := i + 1; j := j * 2; end loop; if not the_out then if (se.mask /= inside) and then (se.node.isinternal) then stack.append (sStkNP '(se.node.state.childs (1), se.mask)); stack.append (sStkNP '(se.node.state.childs (2), se.mask)); else if policy.Allleaves (se.node.all) then enumleaves (se.node, policy); end if; end if; end if; exit when stack.Length = 0; end; end loop; end; end if; end collideKDOP; procedure collideOCL (root : access Node; normals : in Vector_3_array; offsets : in math.Vector; sortaxis : in math.Vector_3; count : in Integer; policy : access ICollide'Class; fullsort : in Boolean := True) is begin if root /= null then declare use Interfaces; use type Flags; SA_x, SA_y, SA_z : Unsigned_32; pragma Unreferenced (SA_y, SA_z); srtsgns : Unsigned_32; inside : constant Flags := 2**count - 1; stock : aliased sStkNPS_Vector; ifree : aliased Integer_Vector; stack : aliased Integer_Vector; signs : math.Integers (1 .. Unsigned_32'Size * 8 * 8); pragma Assert (count < Integer ((signs'Size / 8) / (signs (1)'Size / 8))); begin if sortaxis (1) >= 0.0 then SA_x := 1; else SA_x := 0; end if; if sortaxis (2) >= 0.0 then SA_y := 2; else SA_y := 0; end if; if sortaxis (3) >= 0.0 then SA_z := 4; else SA_z := 0; end if; srtsgns := SA_x + SA_x + SA_x; for i in 1 .. count loop declare N_x, N_y, N_z : Unsigned_32; begin if normals (i) (1) >= 0.0 then N_x := 1; else N_x := 0; end if; if normals (i) (2) >= 0.0 then N_y := 2; else N_y := 0; end if; if normals (i) (3) >= 0.0 then N_z := 4; else N_z := 0; end if; signs (i) := Integer (N_x + N_y + N_z); end; end loop; stock.reserve_Capacity (SIMPLE_STACKSIZE); stack.reserve_Capacity (SIMPLE_STACKSIZE); ifree.reserve_Capacity (SIMPLE_STACKSIZE); stack.append (allocate (ifree'Access, stock'Access, sStkNPS'(root, 0, root.volume.ProjectMinimum (sortaxis, srtsgns)))); loop declare use type Flags, ada.containers.Count_type; id : constant Integer := stack.last_Element; se : sStkNPS := stock.Element (id); the_out : Boolean; i : Integer; j : Flags; side : Integer; continue_required : Boolean := False; begin stack.delete_Last; ifree.append (id); if se.mask /= inside then the_out := False; end if; i := 1; j := 2; while not the_out and then i <= count loop if (se.mask and j) = 0 then side := se.node.volume.Classify (normals (i), offsets (i), signs (i)); case side is when -1 => the_out := True; when +1 => se.mask := se.mask or j; when others => raise Program_Error; end case; end if; i := i + 1; j := j * 2; end loop; if the_out then continue_required := True; end if; if not continue_required then if policy.Descent (se.node.all) then if se.node.isinternal then declare pns : Node_views := (se.node.state.childs (1), se.node.state.childs (2)); nes : array (Positive range <>) of sStkNPS := (sStkNPS'(pns (1), se.mask, pns (1).volume.ProjectMinimum (sortaxis, srtsgns)), sStkNPS'(pns (2), se.mask, pns (2).volume.ProjectMinimum (sortaxis, srtsgns))); q : Integer; j : Integer := Integer (stack.Length); k : Integer; begin if nes (1).value < nes (2).value then q := 1; else q := 0; end if; if fullsort and then j > 0 then -- Insert 0 -- j := nearest (stack, stock, nes (q).value, 0, Integer (stack.Length)); stack.append (0); k := Integer (stack.Length) - 1; while k > j loop stack.replace_Element (k, stack.Element (k - 1)); k := k - 1; end loop; stack.replace_Element (j, allocate (ifree'Access, stock'Access, nes (q))); -- Insert 1 -- j := nearest (stack, stock, nes (1-q).value, j, Integer (stack.Length)); stack.append (0); k := Integer (stack.Length) - 1; while k > j loop stack.replace_Element (k, stack.Element (k - 1)); k := k - 1; end loop; stack.replace_Element (j, allocate (ifree'Access, stock'Access, nes (1-q))); else stack.append (allocate (ifree'Access, stock'Access, nes (q))); stack.append (allocate (ifree'Access, stock'Access, nes (1-q))); end if; end; else policy.Process (se.node, se.value); end if; end if; end if; exit when stack.Length = 0; end; end loop; end; end if; end collideOCL; procedure collideTU (root : access Node; policy : access ICollide'Class) is begin if root /= null then declare use type ada.containers.Count_type; stack : Node_Vector; n : access Node; begin stack.reserve_Capacity (SIMPLE_STACKSIZE); stack.append (root.all'Access); loop n := stack.last_Element; stack.delete_Last; if policy.Descent (n.all) then if n.isinternal then stack.append (n.state.childs (1)); stack.append (n.state.childs (2)); else policy.Process (n); end if; end if; exit when stack.Length = 0; end loop; end; end if; end collideTU; procedure AddSpan (Self : in AabbMm; d : in math.Vector_3; smi, smx : in out math.Real) is begin for i in 1 .. 3 loop if d (i) < 0.0 then smi := smi + Self.mx (i) * d (i); smx := smx + Self.mi (i) * d (i); else smi := smi + Self.mi (i) * d (i); smx := smx + Self.mx (i) * d (i); end if; end loop; end AddSpan; function Root (Self : in Item) return Node_view is begin return Self.m_root; end Root; function leaves (Self : in Item) return Integer is begin return Self.m_leaves; end leaves; end impact.d3.collision.bounding_volume_Tree;
25.322762
159
0.449722
c72e458e24ad26d8726c9111752d87ad8d3a6d62
8,038
ads
Ada
bb-runtimes/runtimes/ravenscar-full-stm32f3x4/gnat/i-pacdec.ads
JCGobbi/Nucleo-STM32F334R8
2a0b1b4b2664c92773703ac5e95dcb71979d051c
[ "BSD-3-Clause" ]
null
null
null
bb-runtimes/runtimes/ravenscar-full-stm32f3x4/gnat/i-pacdec.ads
JCGobbi/Nucleo-STM32F334R8
2a0b1b4b2664c92773703ac5e95dcb71979d051c
[ "BSD-3-Clause" ]
null
null
null
bb-runtimes/runtimes/ravenscar-full-stm32f3x4/gnat/i-pacdec.ads
JCGobbi/Nucleo-STM32F334R8
2a0b1b4b2664c92773703ac5e95dcb71979d051c
[ "BSD-3-Clause" ]
null
null
null
------------------------------------------------------------------------------ -- -- -- GNAT COMPILER COMPONENTS -- -- -- -- I N T E R F A C E S . P A C K E D _ D E C I M A L -- -- -- -- S p e c -- -- (Version for IBM Mainframe Packed Decimal Format) -- -- -- -- Copyright (C) 1992-2021, Free Software Foundation, Inc. -- -- -- -- GNAT 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 3, or (at your option) any later ver- -- -- sion. GNAT 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. -- -- -- -- -- -- -- -- -- -- -- -- You should have received a copy of the GNU General Public License and -- -- a copy of the GCC Runtime Library Exception along with this program; -- -- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- -- <http://www.gnu.org/licenses/>. -- -- -- -- GNAT was originally developed by the GNAT team at New York University. -- -- Extensive contributions were provided by Ada Core Technologies Inc. -- -- -- ------------------------------------------------------------------------------ -- This unit defines the packed decimal format used by GNAT in response to -- a specification of Machine_Radix 10 for a decimal fixed-point type. The -- format and operations are completely encapsulated in this unit, so all -- that is necessary to compile using different packed decimal formats is -- to replace this single unit. -- Note that the compiler access the spec of this unit during compilation -- to obtain the data length that needs allocating, so the correct version -- of the spec must be available to the compiler, and must correspond to -- the spec and body made available to the linker, and all units of a given -- program must be compiled with the same version of the spec and body. -- This consistency will be enforced automatically using the normal binder -- consistency checking, since any unit declaring Machine_Radix 10 types or -- containing operations on such data will implicitly with Packed_Decimal. with System; package Interfaces.Packed_Decimal is ------------------------ -- Format Description -- ------------------------ -- IBM Mainframe packed decimal format uses a byte string of length one -- to 10 bytes, with the most significant byte first. Each byte contains -- two decimal digits (with the high order digit in the left nibble, and -- the low order four bits contain the sign, using the following code: -- 16#A# 2#1010# positive -- 16#B# 2#1011# negative -- 16#C# 2#1100# positive (preferred representation) -- 16#D# 2#1101# negative (preferred representation) -- 16#E# 2#1110# positive -- 16#F# 2#1011# positive -- In this package, all six sign representations are interpreted as -- shown above when an operand is read, when an operand is written, -- the preferred representations are always used. Constraint_Error -- is raised if any other bit pattern is found in the sign nibble, -- or if a digit nibble contains an invalid digit code. -- Some examples follow: -- 05 76 3C +5763 -- 00 01 1D -11 -- 00 04 4E +44 (non-standard sign) -- 00 00 00 invalid (incorrect sign nibble) -- 0A 01 1C invalid (bad digit) ------------------ -- Length Array -- ------------------ -- The following array must be declared in exactly the form shown, since -- the compiler accesses the associated tree to determine the size to be -- allocated to a machine radix 10 type, depending on the number of digits. subtype Byte_Length is Positive range 1 .. 10; -- Range of possible byte lengths Packed_Size : constant array (1 .. 18) of Byte_Length := (01 => 01, -- Length in bytes for digits 1 02 => 02, -- Length in bytes for digits 2 03 => 02, -- Length in bytes for digits 2 04 => 03, -- Length in bytes for digits 2 05 => 03, -- Length in bytes for digits 2 06 => 04, -- Length in bytes for digits 2 07 => 04, -- Length in bytes for digits 2 08 => 05, -- Length in bytes for digits 2 09 => 05, -- Length in bytes for digits 2 10 => 06, -- Length in bytes for digits 2 11 => 06, -- Length in bytes for digits 2 12 => 07, -- Length in bytes for digits 2 13 => 07, -- Length in bytes for digits 2 14 => 08, -- Length in bytes for digits 2 15 => 08, -- Length in bytes for digits 2 16 => 09, -- Length in bytes for digits 2 17 => 09, -- Length in bytes for digits 2 18 => 10); -- Length in bytes for digits 2 ------------------------- -- Conversion Routines -- ------------------------- subtype D32 is Positive range 1 .. 9; -- Used to represent number of digits in a packed decimal value that -- can be represented in a 32-bit binary signed integer form. subtype D64 is Positive range 10 .. 18; -- Used to represent number of digits in a packed decimal value that -- requires a 64-bit signed binary integer for representing all values. function Packed_To_Int32 (P : System.Address; D : D32) return Integer_32; -- The argument P is the address of a packed decimal value and D is the -- number of digits (in the range 1 .. 9, as implied by the subtype). -- The returned result is the corresponding signed binary value. The -- exception Constraint_Error is raised if the input is invalid. function Packed_To_Int64 (P : System.Address; D : D64) return Integer_64; -- The argument P is the address of a packed decimal value and D is the -- number of digits (in the range 10 .. 18, as implied by the subtype). -- The returned result is the corresponding signed binary value. The -- exception Constraint_Error is raised if the input is invalid. procedure Int32_To_Packed (V : Integer_32; P : System.Address; D : D32); -- The argument V is a signed binary integer, which is converted to -- packed decimal format and stored using P, the address of a packed -- decimal item of D digits (D is in the range 1-9). Constraint_Error -- is raised if V is out of range of this number of digits. procedure Int64_To_Packed (V : Integer_64; P : System.Address; D : D64); -- The argument V is a signed binary integer, which is converted to -- packed decimal format and stored using P, the address of a packed -- decimal item of D digits (D is in the range 10-18). Constraint_Error -- is raised if V is out of range of this number of digits. end Interfaces.Packed_Decimal;
53.586667
79
0.546778
c74447726d633e13009b62d2a90221f4f28f1e4d
584
ads
Ada
src/002/moving_thing.ads
xeenta/learning-ada
bd3edf0c9e8b8eff814ffd89b040f488b80a7d5b
[ "MIT" ]
null
null
null
src/002/moving_thing.ads
xeenta/learning-ada
bd3edf0c9e8b8eff814ffd89b040f488b80a7d5b
[ "MIT" ]
null
null
null
src/002/moving_thing.ads
xeenta/learning-ada
bd3edf0c9e8b8eff814ffd89b040f488b80a7d5b
[ "MIT" ]
null
null
null
package Moving_Thing is type Position is private; type Speed is private; type Thing is private; type Direction is (North, South, East, West, Up, Down); procedure Faster (T : in out Thing; D : in Direction; M : in Float); procedure Stop (T : in out Thing); private type Position is record X, Y, Z : Float; end record; type Speed is record Vx, Vy, Vz : Float; end record; type Thing is record Pos : Position; Spd : Speed; end record; end Moving_Thing;
17.69697
38
0.561644
c7cc1d0e3d6c5577733ebff41d68a607e2ce5b0d
1,137
ads
Ada
tools/SPARK2005/preprocessor/src/fp_detect.ads
michalkonecny/polypaver
7a1541a85523f5ecbef44b7f5e09680d9a5c1ca6
[ "BSD-3-Clause" ]
1
2015-07-01T14:50:00.000Z
2015-07-01T14:50:00.000Z
tools/SPARK2005/preprocessor/src/fp_detect.ads
michalkonecny/polypaver
7a1541a85523f5ecbef44b7f5e09680d9a5c1ca6
[ "BSD-3-Clause" ]
null
null
null
tools/SPARK2005/preprocessor/src/fp_detect.ads
michalkonecny/polypaver
7a1541a85523f5ecbef44b7f5e09680d9a5c1ca6
[ "BSD-3-Clause" ]
null
null
null
with Asis; package FP_Detect is type FP_Type_Code is (F, LF, SF); type FP_Type is record Precision : Positive; Name : Asis.Defining_Name; Is_Standard : Boolean; Code : FP_Type_Code; end record; type FP_Operator_Kind is (Field_Op, Elementary_Fn, Not_An_FP_Operator); type Maybe_FP_Operator(Kind : FP_Operator_Kind) is record case Kind is when Field_Op | Elementary_Fn => Type_Info : FP_Type; case Kind is when Field_Op => Op_Kind : Asis.Operator_Kinds; when Elementary_Fn => Fn_Name : Asis.Element; when Not_An_FP_Operator => null; end case; when Not_An_FP_Operator => null; end case; end record; No_FP_Operator : constant Maybe_FP_Operator := (Kind => Not_An_FP_Operator); function FP_Type_Of(Expr : Asis.Element) return FP_Type; function Is_FP_Operator_Expression(Element : Asis.Element) return Maybe_FP_Operator; end FP_Detect;
27.071429
87
0.580475
221ac2a3ed58c01de6b7b27bb065b6c0f1a861fc
5,228
ads
Ada
source/amf/uml/amf-uml-behavioral_features-collections.ads
svn2github/matreshka
9d222b3ad9da508855fb1f5adbe5e8a4fad4c530
[ "BSD-3-Clause" ]
24
2016-11-29T06:59:41.000Z
2021-08-30T11:55:16.000Z
source/amf/uml/amf-uml-behavioral_features-collections.ads
svn2github/matreshka
9d222b3ad9da508855fb1f5adbe5e8a4fad4c530
[ "BSD-3-Clause" ]
2
2019-01-16T05:15:20.000Z
2019-02-03T10:03:32.000Z
source/amf/uml/amf-uml-behavioral_features-collections.ads
svn2github/matreshka
9d222b3ad9da508855fb1f5adbe5e8a4fad4c530
[ "BSD-3-Clause" ]
4
2017-07-18T07:11:05.000Z
2020-06-21T03:02:25.000Z
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Ada Modeling Framework -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2011-2012, Vadim Godunko <[email protected]> -- -- All rights reserved. -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions -- -- are met: -- -- -- -- * Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- -- -- * Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in the -- -- documentation and/or other materials provided with the distribution. -- -- -- -- * Neither the name of the Vadim Godunko, IE nor the names of its -- -- contributors may be used to endorse or promote products derived from -- -- this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -- -- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -- -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -- -- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -- -- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ -- $Revision$ $Date$ ------------------------------------------------------------------------------ -- This file is generated, don't edit it. ------------------------------------------------------------------------------ with AMF.Generic_Collections; package AMF.UML.Behavioral_Features.Collections is pragma Preelaborate; package UML_Behavioral_Feature_Collections is new AMF.Generic_Collections (UML_Behavioral_Feature, UML_Behavioral_Feature_Access); type Set_Of_UML_Behavioral_Feature is new UML_Behavioral_Feature_Collections.Set with null record; Empty_Set_Of_UML_Behavioral_Feature : constant Set_Of_UML_Behavioral_Feature; type Ordered_Set_Of_UML_Behavioral_Feature is new UML_Behavioral_Feature_Collections.Ordered_Set with null record; Empty_Ordered_Set_Of_UML_Behavioral_Feature : constant Ordered_Set_Of_UML_Behavioral_Feature; type Bag_Of_UML_Behavioral_Feature is new UML_Behavioral_Feature_Collections.Bag with null record; Empty_Bag_Of_UML_Behavioral_Feature : constant Bag_Of_UML_Behavioral_Feature; type Sequence_Of_UML_Behavioral_Feature is new UML_Behavioral_Feature_Collections.Sequence with null record; Empty_Sequence_Of_UML_Behavioral_Feature : constant Sequence_Of_UML_Behavioral_Feature; private Empty_Set_Of_UML_Behavioral_Feature : constant Set_Of_UML_Behavioral_Feature := (UML_Behavioral_Feature_Collections.Set with null record); Empty_Ordered_Set_Of_UML_Behavioral_Feature : constant Ordered_Set_Of_UML_Behavioral_Feature := (UML_Behavioral_Feature_Collections.Ordered_Set with null record); Empty_Bag_Of_UML_Behavioral_Feature : constant Bag_Of_UML_Behavioral_Feature := (UML_Behavioral_Feature_Collections.Bag with null record); Empty_Sequence_Of_UML_Behavioral_Feature : constant Sequence_Of_UML_Behavioral_Feature := (UML_Behavioral_Feature_Collections.Sequence with null record); end AMF.UML.Behavioral_Features.Collections;
56.826087
96
0.537299
2293118fa640c91cc727d33366053b68b00a2775
20,586
ads
Ada
extern/gnat_sdl/gnat_sdl2/src/sdl_scancode_h.ads
AdaCore/training_material
6651eb2c53f8c39649b8e0b3c757bc8ff963025a
[ "CC-BY-4.0" ]
15
2020-10-07T08:56:45.000Z
2022-02-08T23:13:22.000Z
extern/gnat_sdl/gnat_sdl2/src/sdl_scancode_h.ads
AdaCore/training_material
6651eb2c53f8c39649b8e0b3c757bc8ff963025a
[ "CC-BY-4.0" ]
20
2020-11-05T14:35:20.000Z
2022-01-13T15:59:33.000Z
extern/gnat_sdl/gnat_sdl2/src/sdl_scancode_h.ads
AdaCore/training_material
6651eb2c53f8c39649b8e0b3c757bc8ff963025a
[ "CC-BY-4.0" ]
6
2020-10-08T15:57:06.000Z
2021-08-31T12:03:08.000Z
pragma Ada_2005; pragma Style_Checks (Off); with Interfaces.C; use Interfaces.C; package SDL_scancode_h is -- Simple DirectMedia Layer -- Copyright (C) 1997-2018 Sam Lantinga <[email protected]> -- This software is provided 'as-is', without any express or implied -- warranty. In no event will the authors be held liable for any damages -- arising from the use of this software. -- Permission is granted to anyone to use this software for any purpose, -- including commercial applications, and to alter it and redistribute it -- freely, subject to the following restrictions: -- 1. The origin of this software must not be misrepresented; you must not -- claim that you wrote the original software. If you use this software -- in a product, an acknowledgment in the product documentation would be -- appreciated but is not required. -- 2. Altered source versions must be plainly marked as such, and must not be -- misrepresented as being the original software. -- 3. This notice may not be removed or altered from any source distribution. -- --* -- * \file SDL_scancode.h -- * -- * Defines keyboard scancodes. -- --* -- * \brief The SDL keyboard scancode representation. -- * -- * Values of this type are used to represent keyboard keys, among other places -- * in the \link SDL_Keysym::scancode key.keysym.scancode \endlink field of the -- * SDL_Event structure. -- * -- * The values in this enumeration are based on the USB usage page standard: -- * http://www.usb.org/developers/hidpage/Hut1_12v2.pdf -- --* -- * \name Usage page 0x07 -- * -- * These values are from usage page 0x07 (USB keyboard page). -- -- @{ --*< Located at the lower left of the return -- * key on ISO keyboards and at the right end -- * of the QWERTY row on ANSI keyboards. -- * Produces REVERSE SOLIDUS (backslash) and -- * VERTICAL LINE in a US layout, REVERSE -- * SOLIDUS and VERTICAL LINE in a UK Mac -- * layout, NUMBER SIGN and TILDE in a UK -- * Windows layout, DOLLAR SIGN and POUND SIGN -- * in a Swiss German layout, NUMBER SIGN and -- * APOSTROPHE in a German layout, GRAVE -- * ACCENT and POUND SIGN in a French Mac -- * layout, and ASTERISK and MICRO SIGN in a -- * French Windows layout. -- --*< ISO USB keyboards actually use this code -- * instead of 49 for the same key, but all -- * OSes I've seen treat the two codes -- * identically. So, as an implementor, unless -- * your keyboard generates both of those -- * codes and your OS treats them differently, -- * you should generate SDL_SCANCODE_BACKSLASH -- * instead of this code. As a user, you -- * should not rely on this code because SDL -- * will never generate it with most (all?) -- * keyboards. -- --*< Located in the top left corner (on both ANSI -- * and ISO keyboards). Produces GRAVE ACCENT and -- * TILDE in a US Windows layout and in US and UK -- * Mac layouts on ANSI keyboards, GRAVE ACCENT -- * and NOT SIGN in a UK Windows layout, SECTION -- * SIGN and PLUS-MINUS SIGN in US and UK Mac -- * layouts on ISO keyboards, SECTION SIGN and -- * DEGREE SIGN in a Swiss German layout (Mac: -- * only on ISO keyboards), CIRCUMFLEX ACCENT and -- * DEGREE SIGN in a German layout (Mac: only on -- * ISO keyboards), SUPERSCRIPT TWO and TILDE in a -- * French Windows layout, COMMERCIAL AT and -- * NUMBER SIGN in a French Mac layout on ISO -- * keyboards, and LESS-THAN SIGN and GREATER-THAN -- * SIGN in a Swiss German, German, or French Mac -- * layout on ANSI keyboards. -- --*< insert on PC, help on some Mac keyboards (but -- does send code 73, not 117) --*< num lock on PC, clear on Mac keyboards -- --*< This is the additional key that ISO -- * keyboards have over ANSI ones, -- * located between left shift and Y. -- * Produces GRAVE ACCENT and TILDE in a -- * US or UK Mac layout, REVERSE SOLIDUS -- * (backslash) and VERTICAL LINE in a -- * US or UK Windows layout, and -- * LESS-THAN SIGN and GREATER-THAN SIGN -- * in a Swiss German, German, or French -- * layout. --*< windows contextual menu, compose --*< The USB document says this is a status flag, -- * not a physical key - but some Mac keyboards -- * do have a power key. --*< redo -- not sure whether there's a reason to enable these -- SDL_SCANCODE_LOCKINGCAPSLOCK = 130, -- SDL_SCANCODE_LOCKINGNUMLOCK = 131, -- SDL_SCANCODE_LOCKINGSCROLLLOCK = 132, --*< used on Asian keyboards, see -- footnotes in USB doc --*< Yen --*< Hangul/English toggle --*< Hanja conversion --*< Katakana --*< Hiragana --*< Zenkaku/Hankaku --*< reserved --*< reserved --*< reserved --*< reserved --*< Erase-Eaze --*< alt, option --*< windows, command (apple), meta --*< alt gr, option --*< windows, command (apple), meta --*< I'm not sure if this is really not covered -- * by any of the above, but since there's a -- * special KMOD_MODE for it I'm adding it here -- -- @} -- Usage page 0x07 --* -- * \name Usage page 0x0C -- * -- * These values are mapped from usage page 0x0C (USB consumer page). -- -- @{ -- @} -- Usage page 0x0C --* -- * \name Walther keys -- * -- * These are values that Christian Walther added (for mac keyboard?). -- -- @{ --*< display mirroring/dual display -- switch, video mode switch -- @} -- Walther keys --* -- * \name Usage page 0x0C (additional media keys) -- * -- * These values are mapped from usage page 0x0C (USB consumer page). -- -- @{ -- @} -- Usage page 0x0C (additional media keys) -- Add any other keys here. --*< not a key, just marks the number of scancodes -- for array bounds subtype SDL_Scancode is unsigned; SDL_SCANCODE_UNKNOWN : constant unsigned := 0; SDL_SCANCODE_A : constant unsigned := 4; SDL_SCANCODE_B : constant unsigned := 5; SDL_SCANCODE_C : constant unsigned := 6; SDL_SCANCODE_D : constant unsigned := 7; SDL_SCANCODE_E : constant unsigned := 8; SDL_SCANCODE_F : constant unsigned := 9; SDL_SCANCODE_G : constant unsigned := 10; SDL_SCANCODE_H : constant unsigned := 11; SDL_SCANCODE_I : constant unsigned := 12; SDL_SCANCODE_J : constant unsigned := 13; SDL_SCANCODE_K : constant unsigned := 14; SDL_SCANCODE_L : constant unsigned := 15; SDL_SCANCODE_M : constant unsigned := 16; SDL_SCANCODE_N : constant unsigned := 17; SDL_SCANCODE_O : constant unsigned := 18; SDL_SCANCODE_P : constant unsigned := 19; SDL_SCANCODE_Q : constant unsigned := 20; SDL_SCANCODE_R : constant unsigned := 21; SDL_SCANCODE_S : constant unsigned := 22; SDL_SCANCODE_T : constant unsigned := 23; SDL_SCANCODE_U : constant unsigned := 24; SDL_SCANCODE_V : constant unsigned := 25; SDL_SCANCODE_W : constant unsigned := 26; SDL_SCANCODE_X : constant unsigned := 27; SDL_SCANCODE_Y : constant unsigned := 28; SDL_SCANCODE_Z : constant unsigned := 29; SDL_SCANCODE_1 : constant unsigned := 30; SDL_SCANCODE_2 : constant unsigned := 31; SDL_SCANCODE_3 : constant unsigned := 32; SDL_SCANCODE_4 : constant unsigned := 33; SDL_SCANCODE_5 : constant unsigned := 34; SDL_SCANCODE_6 : constant unsigned := 35; SDL_SCANCODE_7 : constant unsigned := 36; SDL_SCANCODE_8 : constant unsigned := 37; SDL_SCANCODE_9 : constant unsigned := 38; SDL_SCANCODE_0 : constant unsigned := 39; SDL_SCANCODE_RETURN : constant unsigned := 40; SDL_SCANCODE_ESCAPE : constant unsigned := 41; SDL_SCANCODE_BACKSPACE : constant unsigned := 42; SDL_SCANCODE_TAB : constant unsigned := 43; SDL_SCANCODE_SPACE : constant unsigned := 44; SDL_SCANCODE_MINUS : constant unsigned := 45; SDL_SCANCODE_EQUALS : constant unsigned := 46; SDL_SCANCODE_LEFTBRACKET : constant unsigned := 47; SDL_SCANCODE_RIGHTBRACKET : constant unsigned := 48; SDL_SCANCODE_BACKSLASH : constant unsigned := 49; SDL_SCANCODE_NONUSHASH : constant unsigned := 50; SDL_SCANCODE_SEMICOLON : constant unsigned := 51; SDL_SCANCODE_APOSTROPHE : constant unsigned := 52; SDL_SCANCODE_GRAVE : constant unsigned := 53; SDL_SCANCODE_COMMA : constant unsigned := 54; SDL_SCANCODE_PERIOD : constant unsigned := 55; SDL_SCANCODE_SLASH : constant unsigned := 56; SDL_SCANCODE_CAPSLOCK : constant unsigned := 57; SDL_SCANCODE_F1 : constant unsigned := 58; SDL_SCANCODE_F2 : constant unsigned := 59; SDL_SCANCODE_F3 : constant unsigned := 60; SDL_SCANCODE_F4 : constant unsigned := 61; SDL_SCANCODE_F5 : constant unsigned := 62; SDL_SCANCODE_F6 : constant unsigned := 63; SDL_SCANCODE_F7 : constant unsigned := 64; SDL_SCANCODE_F8 : constant unsigned := 65; SDL_SCANCODE_F9 : constant unsigned := 66; SDL_SCANCODE_F10 : constant unsigned := 67; SDL_SCANCODE_F11 : constant unsigned := 68; SDL_SCANCODE_F12 : constant unsigned := 69; SDL_SCANCODE_PRINTSCREEN : constant unsigned := 70; SDL_SCANCODE_SCROLLLOCK : constant unsigned := 71; SDL_SCANCODE_PAUSE : constant unsigned := 72; SDL_SCANCODE_INSERT : constant unsigned := 73; SDL_SCANCODE_HOME : constant unsigned := 74; SDL_SCANCODE_PAGEUP : constant unsigned := 75; SDL_SCANCODE_DELETE : constant unsigned := 76; SDL_SCANCODE_END : constant unsigned := 77; SDL_SCANCODE_PAGEDOWN : constant unsigned := 78; SDL_SCANCODE_RIGHT : constant unsigned := 79; SDL_SCANCODE_LEFT : constant unsigned := 80; SDL_SCANCODE_DOWN : constant unsigned := 81; SDL_SCANCODE_UP : constant unsigned := 82; SDL_SCANCODE_NUMLOCKCLEAR : constant unsigned := 83; SDL_SCANCODE_KP_DIVIDE : constant unsigned := 84; SDL_SCANCODE_KP_MULTIPLY : constant unsigned := 85; SDL_SCANCODE_KP_MINUS : constant unsigned := 86; SDL_SCANCODE_KP_PLUS : constant unsigned := 87; SDL_SCANCODE_KP_ENTER : constant unsigned := 88; SDL_SCANCODE_KP_1 : constant unsigned := 89; SDL_SCANCODE_KP_2 : constant unsigned := 90; SDL_SCANCODE_KP_3 : constant unsigned := 91; SDL_SCANCODE_KP_4 : constant unsigned := 92; SDL_SCANCODE_KP_5 : constant unsigned := 93; SDL_SCANCODE_KP_6 : constant unsigned := 94; SDL_SCANCODE_KP_7 : constant unsigned := 95; SDL_SCANCODE_KP_8 : constant unsigned := 96; SDL_SCANCODE_KP_9 : constant unsigned := 97; SDL_SCANCODE_KP_0 : constant unsigned := 98; SDL_SCANCODE_KP_PERIOD : constant unsigned := 99; SDL_SCANCODE_NONUSBACKSLASH : constant unsigned := 100; SDL_SCANCODE_APPLICATION : constant unsigned := 101; SDL_SCANCODE_POWER : constant unsigned := 102; SDL_SCANCODE_KP_EQUALS : constant unsigned := 103; SDL_SCANCODE_F13 : constant unsigned := 104; SDL_SCANCODE_F14 : constant unsigned := 105; SDL_SCANCODE_F15 : constant unsigned := 106; SDL_SCANCODE_F16 : constant unsigned := 107; SDL_SCANCODE_F17 : constant unsigned := 108; SDL_SCANCODE_F18 : constant unsigned := 109; SDL_SCANCODE_F19 : constant unsigned := 110; SDL_SCANCODE_F20 : constant unsigned := 111; SDL_SCANCODE_F21 : constant unsigned := 112; SDL_SCANCODE_F22 : constant unsigned := 113; SDL_SCANCODE_F23 : constant unsigned := 114; SDL_SCANCODE_F24 : constant unsigned := 115; SDL_SCANCODE_EXECUTE : constant unsigned := 116; SDL_SCANCODE_HELP : constant unsigned := 117; SDL_SCANCODE_MENU : constant unsigned := 118; SDL_SCANCODE_SELECT : constant unsigned := 119; SDL_SCANCODE_STOP : constant unsigned := 120; SDL_SCANCODE_AGAIN : constant unsigned := 121; SDL_SCANCODE_UNDO : constant unsigned := 122; SDL_SCANCODE_CUT : constant unsigned := 123; SDL_SCANCODE_COPY : constant unsigned := 124; SDL_SCANCODE_PASTE : constant unsigned := 125; SDL_SCANCODE_FIND : constant unsigned := 126; SDL_SCANCODE_MUTE : constant unsigned := 127; SDL_SCANCODE_VOLUMEUP : constant unsigned := 128; SDL_SCANCODE_VOLUMEDOWN : constant unsigned := 129; SDL_SCANCODE_KP_COMMA : constant unsigned := 133; SDL_SCANCODE_KP_EQUALSAS400 : constant unsigned := 134; SDL_SCANCODE_INTERNATIONAL1 : constant unsigned := 135; SDL_SCANCODE_INTERNATIONAL2 : constant unsigned := 136; SDL_SCANCODE_INTERNATIONAL3 : constant unsigned := 137; SDL_SCANCODE_INTERNATIONAL4 : constant unsigned := 138; SDL_SCANCODE_INTERNATIONAL5 : constant unsigned := 139; SDL_SCANCODE_INTERNATIONAL6 : constant unsigned := 140; SDL_SCANCODE_INTERNATIONAL7 : constant unsigned := 141; SDL_SCANCODE_INTERNATIONAL8 : constant unsigned := 142; SDL_SCANCODE_INTERNATIONAL9 : constant unsigned := 143; SDL_SCANCODE_LANG1 : constant unsigned := 144; SDL_SCANCODE_LANG2 : constant unsigned := 145; SDL_SCANCODE_LANG3 : constant unsigned := 146; SDL_SCANCODE_LANG4 : constant unsigned := 147; SDL_SCANCODE_LANG5 : constant unsigned := 148; SDL_SCANCODE_LANG6 : constant unsigned := 149; SDL_SCANCODE_LANG7 : constant unsigned := 150; SDL_SCANCODE_LANG8 : constant unsigned := 151; SDL_SCANCODE_LANG9 : constant unsigned := 152; SDL_SCANCODE_ALTERASE : constant unsigned := 153; SDL_SCANCODE_SYSREQ : constant unsigned := 154; SDL_SCANCODE_CANCEL : constant unsigned := 155; SDL_SCANCODE_CLEAR : constant unsigned := 156; SDL_SCANCODE_PRIOR : constant unsigned := 157; SDL_SCANCODE_RETURN2 : constant unsigned := 158; SDL_SCANCODE_SEPARATOR : constant unsigned := 159; SDL_SCANCODE_OUT : constant unsigned := 160; SDL_SCANCODE_OPER : constant unsigned := 161; SDL_SCANCODE_CLEARAGAIN : constant unsigned := 162; SDL_SCANCODE_CRSEL : constant unsigned := 163; SDL_SCANCODE_EXSEL : constant unsigned := 164; SDL_SCANCODE_KP_00 : constant unsigned := 176; SDL_SCANCODE_KP_000 : constant unsigned := 177; SDL_SCANCODE_THOUSANDSSEPARATOR : constant unsigned := 178; SDL_SCANCODE_DECIMALSEPARATOR : constant unsigned := 179; SDL_SCANCODE_CURRENCYUNIT : constant unsigned := 180; SDL_SCANCODE_CURRENCYSUBUNIT : constant unsigned := 181; SDL_SCANCODE_KP_LEFTPAREN : constant unsigned := 182; SDL_SCANCODE_KP_RIGHTPAREN : constant unsigned := 183; SDL_SCANCODE_KP_LEFTBRACE : constant unsigned := 184; SDL_SCANCODE_KP_RIGHTBRACE : constant unsigned := 185; SDL_SCANCODE_KP_TAB : constant unsigned := 186; SDL_SCANCODE_KP_BACKSPACE : constant unsigned := 187; SDL_SCANCODE_KP_A : constant unsigned := 188; SDL_SCANCODE_KP_B : constant unsigned := 189; SDL_SCANCODE_KP_C : constant unsigned := 190; SDL_SCANCODE_KP_D : constant unsigned := 191; SDL_SCANCODE_KP_E : constant unsigned := 192; SDL_SCANCODE_KP_F : constant unsigned := 193; SDL_SCANCODE_KP_XOR : constant unsigned := 194; SDL_SCANCODE_KP_POWER : constant unsigned := 195; SDL_SCANCODE_KP_PERCENT : constant unsigned := 196; SDL_SCANCODE_KP_LESS : constant unsigned := 197; SDL_SCANCODE_KP_GREATER : constant unsigned := 198; SDL_SCANCODE_KP_AMPERSAND : constant unsigned := 199; SDL_SCANCODE_KP_DBLAMPERSAND : constant unsigned := 200; SDL_SCANCODE_KP_VERTICALBAR : constant unsigned := 201; SDL_SCANCODE_KP_DBLVERTICALBAR : constant unsigned := 202; SDL_SCANCODE_KP_COLON : constant unsigned := 203; SDL_SCANCODE_KP_HASH : constant unsigned := 204; SDL_SCANCODE_KP_SPACE : constant unsigned := 205; SDL_SCANCODE_KP_AT : constant unsigned := 206; SDL_SCANCODE_KP_EXCLAM : constant unsigned := 207; SDL_SCANCODE_KP_MEMSTORE : constant unsigned := 208; SDL_SCANCODE_KP_MEMRECALL : constant unsigned := 209; SDL_SCANCODE_KP_MEMCLEAR : constant unsigned := 210; SDL_SCANCODE_KP_MEMADD : constant unsigned := 211; SDL_SCANCODE_KP_MEMSUBTRACT : constant unsigned := 212; SDL_SCANCODE_KP_MEMMULTIPLY : constant unsigned := 213; SDL_SCANCODE_KP_MEMDIVIDE : constant unsigned := 214; SDL_SCANCODE_KP_PLUSMINUS : constant unsigned := 215; SDL_SCANCODE_KP_CLEAR : constant unsigned := 216; SDL_SCANCODE_KP_CLEARENTRY : constant unsigned := 217; SDL_SCANCODE_KP_BINARY : constant unsigned := 218; SDL_SCANCODE_KP_OCTAL : constant unsigned := 219; SDL_SCANCODE_KP_DECIMAL : constant unsigned := 220; SDL_SCANCODE_KP_HEXADECIMAL : constant unsigned := 221; SDL_SCANCODE_LCTRL : constant unsigned := 224; SDL_SCANCODE_LSHIFT : constant unsigned := 225; SDL_SCANCODE_LALT : constant unsigned := 226; SDL_SCANCODE_LGUI : constant unsigned := 227; SDL_SCANCODE_RCTRL : constant unsigned := 228; SDL_SCANCODE_RSHIFT : constant unsigned := 229; SDL_SCANCODE_RALT : constant unsigned := 230; SDL_SCANCODE_RGUI : constant unsigned := 231; SDL_SCANCODE_MODE : constant unsigned := 257; SDL_SCANCODE_AUDIONEXT : constant unsigned := 258; SDL_SCANCODE_AUDIOPREV : constant unsigned := 259; SDL_SCANCODE_AUDIOSTOP : constant unsigned := 260; SDL_SCANCODE_AUDIOPLAY : constant unsigned := 261; SDL_SCANCODE_AUDIOMUTE : constant unsigned := 262; SDL_SCANCODE_MEDIASELECT : constant unsigned := 263; SDL_SCANCODE_WWW : constant unsigned := 264; SDL_SCANCODE_MAIL : constant unsigned := 265; SDL_SCANCODE_CALCULATOR : constant unsigned := 266; SDL_SCANCODE_COMPUTER : constant unsigned := 267; SDL_SCANCODE_AC_SEARCH : constant unsigned := 268; SDL_SCANCODE_AC_HOME : constant unsigned := 269; SDL_SCANCODE_AC_BACK : constant unsigned := 270; SDL_SCANCODE_AC_FORWARD : constant unsigned := 271; SDL_SCANCODE_AC_STOP : constant unsigned := 272; SDL_SCANCODE_AC_REFRESH : constant unsigned := 273; SDL_SCANCODE_AC_BOOKMARKS : constant unsigned := 274; SDL_SCANCODE_BRIGHTNESSDOWN : constant unsigned := 275; SDL_SCANCODE_BRIGHTNESSUP : constant unsigned := 276; SDL_SCANCODE_DISPLAYSWITCH : constant unsigned := 277; SDL_SCANCODE_KBDILLUMTOGGLE : constant unsigned := 278; SDL_SCANCODE_KBDILLUMDOWN : constant unsigned := 279; SDL_SCANCODE_KBDILLUMUP : constant unsigned := 280; SDL_SCANCODE_EJECT : constant unsigned := 281; SDL_SCANCODE_SLEEP : constant unsigned := 282; SDL_SCANCODE_APP1 : constant unsigned := 283; SDL_SCANCODE_APP2 : constant unsigned := 284; SDL_SCANCODE_AUDIOREWIND : constant unsigned := 285; SDL_SCANCODE_AUDIOFASTFORWARD : constant unsigned := 286; SDL_NUM_SCANCODES : constant unsigned := 512; -- ..\SDL2_tmp\SDL_scancode.h:409 -- vi: set ts=4 sw=4 expandtab: end SDL_scancode_h;
47.986014
84
0.637666
59b0bdb99de30230ca0b4f9cf6923f70486fe666
51,997
adb
Ada
gcc-gcc-7_3_0-release/gcc/ada/a-cbhase.adb
best08618/asylo
5a520a9f5c461ede0f32acc284017b737a43898c
[ "Apache-2.0" ]
7
2020-05-02T17:34:05.000Z
2021-10-17T10:15:18.000Z
gcc-gcc-7_3_0-release/gcc/ada/a-cbhase.adb
best08618/asylo
5a520a9f5c461ede0f32acc284017b737a43898c
[ "Apache-2.0" ]
null
null
null
gcc-gcc-7_3_0-release/gcc/ada/a-cbhase.adb
best08618/asylo
5a520a9f5c461ede0f32acc284017b737a43898c
[ "Apache-2.0" ]
2
2020-07-27T00:22:36.000Z
2021-04-01T09:41:02.000Z
------------------------------------------------------------------------------ -- -- -- GNAT LIBRARY COMPONENTS -- -- -- -- A D A . C O N T A I N E R S . B O U N D E D _ H A S H E D _ S E T S -- -- -- -- B o d y -- -- -- -- Copyright (C) 2004-2015, Free Software Foundation, Inc. -- -- -- -- GNAT 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 3, or (at your option) any later ver- -- -- sion. GNAT 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. -- -- -- -- As a special exception under Section 7 of GPL version 3, you are granted -- -- additional permissions described in the GCC Runtime Library Exception, -- -- version 3.1, as published by the Free Software Foundation. -- -- -- -- You should have received a copy of the GNU General Public License and -- -- a copy of the GCC Runtime Library Exception along with this program; -- -- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- -- <http://www.gnu.org/licenses/>. -- -- -- -- This unit was originally developed by Matthew J Heaney. -- ------------------------------------------------------------------------------ with Ada.Containers.Hash_Tables.Generic_Bounded_Operations; pragma Elaborate_All (Ada.Containers.Hash_Tables.Generic_Bounded_Operations); with Ada.Containers.Hash_Tables.Generic_Bounded_Keys; pragma Elaborate_All (Ada.Containers.Hash_Tables.Generic_Bounded_Keys); with Ada.Containers.Helpers; use Ada.Containers.Helpers; with Ada.Containers.Prime_Numbers; use Ada.Containers.Prime_Numbers; with System; use type System.Address; package body Ada.Containers.Bounded_Hashed_Sets is pragma Warnings (Off, "variable ""Busy*"" is not referenced"); pragma Warnings (Off, "variable ""Lock*"" is not referenced"); -- See comment in Ada.Containers.Helpers ----------------------- -- Local Subprograms -- ----------------------- function Equivalent_Keys (Key : Element_Type; Node : Node_Type) return Boolean; pragma Inline (Equivalent_Keys); function Hash_Node (Node : Node_Type) return Hash_Type; pragma Inline (Hash_Node); procedure Insert (Container : in out Set; New_Item : Element_Type; Node : out Count_Type; Inserted : out Boolean); function Is_In (HT : Set; Key : Node_Type) return Boolean; pragma Inline (Is_In); procedure Set_Element (Node : in out Node_Type; Item : Element_Type); pragma Inline (Set_Element); function Next (Node : Node_Type) return Count_Type; pragma Inline (Next); procedure Set_Next (Node : in out Node_Type; Next : Count_Type); pragma Inline (Set_Next); function Vet (Position : Cursor) return Boolean; -------------------------- -- Local Instantiations -- -------------------------- package HT_Ops is new Hash_Tables.Generic_Bounded_Operations (HT_Types => HT_Types, Hash_Node => Hash_Node, Next => Next, Set_Next => Set_Next); package Element_Keys is new Hash_Tables.Generic_Bounded_Keys (HT_Types => HT_Types, Next => Next, Set_Next => Set_Next, Key_Type => Element_Type, Hash => Hash, Equivalent_Keys => Equivalent_Keys); procedure Replace_Element is new Element_Keys.Generic_Replace_Element (Hash_Node, Set_Element); --------- -- "=" -- --------- function "=" (Left, Right : Set) return Boolean is function Find_Equal_Key (R_HT : Hash_Table_Type'Class; L_Node : Node_Type) return Boolean; pragma Inline (Find_Equal_Key); function Is_Equal is new HT_Ops.Generic_Equal (Find_Equal_Key); -------------------- -- Find_Equal_Key -- -------------------- function Find_Equal_Key (R_HT : Hash_Table_Type'Class; L_Node : Node_Type) return Boolean is R_Index : constant Hash_Type := Element_Keys.Index (R_HT, L_Node.Element); R_Node : Count_Type := R_HT.Buckets (R_Index); begin loop if R_Node = 0 then return False; end if; if L_Node.Element = R_HT.Nodes (R_Node).Element then return True; end if; R_Node := Next (R_HT.Nodes (R_Node)); end loop; end Find_Equal_Key; -- Start of processing for "=" begin return Is_Equal (Left, Right); end "="; ------------ -- Assign -- ------------ procedure Assign (Target : in out Set; Source : Set) is procedure Insert_Element (Source_Node : Count_Type); procedure Insert_Elements is new HT_Ops.Generic_Iteration (Insert_Element); -------------------- -- Insert_Element -- -------------------- procedure Insert_Element (Source_Node : Count_Type) is N : Node_Type renames Source.Nodes (Source_Node); X : Count_Type; B : Boolean; begin Insert (Target, N.Element, X, B); pragma Assert (B); end Insert_Element; -- Start of processing for Assign begin if Target'Address = Source'Address then return; end if; if Checks and then Target.Capacity < Source.Length then raise Capacity_Error with "Target capacity is less than Source length"; end if; HT_Ops.Clear (Target); Insert_Elements (Source); end Assign; -------------- -- Capacity -- -------------- function Capacity (Container : Set) return Count_Type is begin return Container.Capacity; end Capacity; ----------- -- Clear -- ----------- procedure Clear (Container : in out Set) is begin HT_Ops.Clear (Container); end Clear; ------------------------ -- Constant_Reference -- ------------------------ function Constant_Reference (Container : aliased Set; Position : Cursor) return Constant_Reference_Type is begin if Checks and then Position.Container = null then raise Constraint_Error with "Position cursor has no element"; end if; if Checks and then Position.Container /= Container'Unrestricted_Access then raise Program_Error with "Position cursor designates wrong container"; end if; pragma Assert (Vet (Position), "bad cursor in Constant_Reference"); declare N : Node_Type renames Container.Nodes (Position.Node); TC : constant Tamper_Counts_Access := Container.TC'Unrestricted_Access; begin return R : constant Constant_Reference_Type := (Element => N.Element'Access, Control => (Controlled with TC)) do Lock (TC.all); end return; end; end Constant_Reference; -------------- -- Contains -- -------------- function Contains (Container : Set; Item : Element_Type) return Boolean is begin return Find (Container, Item) /= No_Element; end Contains; ---------- -- Copy -- ---------- function Copy (Source : Set; Capacity : Count_Type := 0; Modulus : Hash_Type := 0) return Set is C : Count_Type; M : Hash_Type; begin if Capacity = 0 then C := Source.Length; elsif Capacity >= Source.Length then C := Capacity; elsif Checks then raise Capacity_Error with "Capacity value too small"; end if; if Modulus = 0 then M := Default_Modulus (C); else M := Modulus; end if; return Target : Set (Capacity => C, Modulus => M) do Assign (Target => Target, Source => Source); end return; end Copy; --------------------- -- Default_Modulus -- --------------------- function Default_Modulus (Capacity : Count_Type) return Hash_Type is begin return To_Prime (Capacity); end Default_Modulus; ------------ -- Delete -- ------------ procedure Delete (Container : in out Set; Item : Element_Type) is X : Count_Type; begin Element_Keys.Delete_Key_Sans_Free (Container, Item, X); if Checks and then X = 0 then raise Constraint_Error with "attempt to delete element not in set"; end if; HT_Ops.Free (Container, X); end Delete; procedure Delete (Container : in out Set; Position : in out Cursor) is begin if Checks and then Position.Node = 0 then raise Constraint_Error with "Position cursor equals No_Element"; end if; if Checks and then Position.Container /= Container'Unrestricted_Access then raise Program_Error with "Position cursor designates wrong set"; end if; TC_Check (Container.TC); pragma Assert (Vet (Position), "bad cursor in Delete"); HT_Ops.Delete_Node_Sans_Free (Container, Position.Node); HT_Ops.Free (Container, Position.Node); Position := No_Element; end Delete; ---------------- -- Difference -- ---------------- procedure Difference (Target : in out Set; Source : Set) is Tgt_Node, Src_Node : Count_Type; Src : Set renames Source'Unrestricted_Access.all; TN : Nodes_Type renames Target.Nodes; SN : Nodes_Type renames Source.Nodes; begin if Target'Address = Source'Address then HT_Ops.Clear (Target); return; end if; if Source.Length = 0 then return; end if; TC_Check (Target.TC); if Source.Length < Target.Length then Src_Node := HT_Ops.First (Source); while Src_Node /= 0 loop Tgt_Node := Element_Keys.Find (Target, SN (Src_Node).Element); if Tgt_Node /= 0 then HT_Ops.Delete_Node_Sans_Free (Target, Tgt_Node); HT_Ops.Free (Target, Tgt_Node); end if; Src_Node := HT_Ops.Next (Src, Src_Node); end loop; else Tgt_Node := HT_Ops.First (Target); while Tgt_Node /= 0 loop if Is_In (Source, TN (Tgt_Node)) then declare X : constant Count_Type := Tgt_Node; begin Tgt_Node := HT_Ops.Next (Target, Tgt_Node); HT_Ops.Delete_Node_Sans_Free (Target, X); HT_Ops.Free (Target, X); end; else Tgt_Node := HT_Ops.Next (Target, Tgt_Node); end if; end loop; end if; end Difference; function Difference (Left, Right : Set) return Set is begin if Left'Address = Right'Address then return Empty_Set; end if; if Left.Length = 0 then return Empty_Set; end if; if Right.Length = 0 then return Left; end if; return Result : Set (Left.Length, To_Prime (Left.Length)) do Iterate_Left : declare procedure Process (L_Node : Count_Type); procedure Iterate is new HT_Ops.Generic_Iteration (Process); ------------- -- Process -- ------------- procedure Process (L_Node : Count_Type) is N : Node_Type renames Left.Nodes (L_Node); X : Count_Type; B : Boolean; begin if not Is_In (Right, N) then Insert (Result, N.Element, X, B); -- optimize this ??? pragma Assert (B); pragma Assert (X > 0); end if; end Process; -- Start of processing for Iterate_Left begin Iterate (Left); end Iterate_Left; end return; end Difference; ------------- -- Element -- ------------- function Element (Position : Cursor) return Element_Type is begin if Checks and then Position.Node = 0 then raise Constraint_Error with "Position cursor equals No_Element"; end if; pragma Assert (Vet (Position), "bad cursor in function Element"); declare S : Set renames Position.Container.all; N : Node_Type renames S.Nodes (Position.Node); begin return N.Element; end; end Element; --------------------- -- Equivalent_Sets -- --------------------- function Equivalent_Sets (Left, Right : Set) return Boolean is function Find_Equivalent_Key (R_HT : Hash_Table_Type'Class; L_Node : Node_Type) return Boolean; pragma Inline (Find_Equivalent_Key); function Is_Equivalent is new HT_Ops.Generic_Equal (Find_Equivalent_Key); ------------------------- -- Find_Equivalent_Key -- ------------------------- function Find_Equivalent_Key (R_HT : Hash_Table_Type'Class; L_Node : Node_Type) return Boolean is R_Index : constant Hash_Type := Element_Keys.Index (R_HT, L_Node.Element); R_Node : Count_Type := R_HT.Buckets (R_Index); RN : Nodes_Type renames R_HT.Nodes; begin loop if R_Node = 0 then return False; end if; if Equivalent_Elements (L_Node.Element, RN (R_Node).Element) then return True; end if; R_Node := Next (R_HT.Nodes (R_Node)); end loop; end Find_Equivalent_Key; -- Start of processing for Equivalent_Sets begin return Is_Equivalent (Left, Right); end Equivalent_Sets; ------------------------- -- Equivalent_Elements -- ------------------------- function Equivalent_Elements (Left, Right : Cursor) return Boolean is begin if Checks and then Left.Node = 0 then raise Constraint_Error with "Left cursor of Equivalent_Elements equals No_Element"; end if; if Checks and then Right.Node = 0 then raise Constraint_Error with "Right cursor of Equivalent_Elements equals No_Element"; end if; pragma Assert (Vet (Left), "bad Left cursor in Equivalent_Elements"); pragma Assert (Vet (Right), "bad Right cursor in Equivalent_Elements"); -- AI05-0022 requires that a container implementation detect element -- tampering by a generic actual subprogram. However, the following case -- falls outside the scope of that AI. Randy Brukardt explained on the -- ARG list on 2013/02/07 that: -- (Begin Quote): -- But for an operation like "<" [the ordered set analog of -- Equivalent_Elements], there is no need to "dereference" a cursor -- after the call to the generic formal parameter function, so nothing -- bad could happen if tampering is undetected. And the operation can -- safely return a result without a problem even if an element is -- deleted from the container. -- (End Quote). declare LN : Node_Type renames Left.Container.Nodes (Left.Node); RN : Node_Type renames Right.Container.Nodes (Right.Node); begin return Equivalent_Elements (LN.Element, RN.Element); end; end Equivalent_Elements; function Equivalent_Elements (Left : Cursor; Right : Element_Type) return Boolean is begin if Checks and then Left.Node = 0 then raise Constraint_Error with "Left cursor of Equivalent_Elements equals No_Element"; end if; pragma Assert (Vet (Left), "Left cursor in Equivalent_Elements is bad"); declare LN : Node_Type renames Left.Container.Nodes (Left.Node); begin return Equivalent_Elements (LN.Element, Right); end; end Equivalent_Elements; function Equivalent_Elements (Left : Element_Type; Right : Cursor) return Boolean is begin if Checks and then Right.Node = 0 then raise Constraint_Error with "Right cursor of Equivalent_Elements equals No_Element"; end if; pragma Assert (Vet (Right), "Right cursor of Equivalent_Elements is bad"); declare RN : Node_Type renames Right.Container.Nodes (Right.Node); begin return Equivalent_Elements (Left, RN.Element); end; end Equivalent_Elements; --------------------- -- Equivalent_Keys -- --------------------- function Equivalent_Keys (Key : Element_Type; Node : Node_Type) return Boolean is begin return Equivalent_Elements (Key, Node.Element); end Equivalent_Keys; ------------- -- Exclude -- ------------- procedure Exclude (Container : in out Set; Item : Element_Type) is X : Count_Type; begin Element_Keys.Delete_Key_Sans_Free (Container, Item, X); HT_Ops.Free (Container, X); end Exclude; -------------- -- Finalize -- -------------- procedure Finalize (Object : in out Iterator) is begin if Object.Container /= null then Unbusy (Object.Container.TC); end if; end Finalize; ---------- -- Find -- ---------- function Find (Container : Set; Item : Element_Type) return Cursor is Node : constant Count_Type := Element_Keys.Find (Container'Unrestricted_Access.all, Item); begin return (if Node = 0 then No_Element else Cursor'(Container'Unrestricted_Access, Node)); end Find; ----------- -- First -- ----------- function First (Container : Set) return Cursor is Node : constant Count_Type := HT_Ops.First (Container); begin return (if Node = 0 then No_Element else Cursor'(Container'Unrestricted_Access, Node)); end First; overriding function First (Object : Iterator) return Cursor is begin return Object.Container.First; end First; ------------------------ -- Get_Element_Access -- ------------------------ function Get_Element_Access (Position : Cursor) return not null Element_Access is begin return Position.Container.Nodes (Position.Node).Element'Access; end Get_Element_Access; ----------------- -- Has_Element -- ----------------- function Has_Element (Position : Cursor) return Boolean is begin pragma Assert (Vet (Position), "bad cursor in Has_Element"); return Position.Node /= 0; end Has_Element; --------------- -- Hash_Node -- --------------- function Hash_Node (Node : Node_Type) return Hash_Type is begin return Hash (Node.Element); end Hash_Node; ------------- -- Include -- ------------- procedure Include (Container : in out Set; New_Item : Element_Type) is Position : Cursor; Inserted : Boolean; begin Insert (Container, New_Item, Position, Inserted); if not Inserted then TE_Check (Container.TC); Container.Nodes (Position.Node).Element := New_Item; end if; end Include; ------------ -- Insert -- ------------ procedure Insert (Container : in out Set; New_Item : Element_Type; Position : out Cursor; Inserted : out Boolean) is begin Insert (Container, New_Item, Position.Node, Inserted); Position.Container := Container'Unchecked_Access; end Insert; procedure Insert (Container : in out Set; New_Item : Element_Type) is Position : Cursor; pragma Unreferenced (Position); Inserted : Boolean; begin Insert (Container, New_Item, Position, Inserted); if Checks and then not Inserted then raise Constraint_Error with "attempt to insert element already in set"; end if; end Insert; procedure Insert (Container : in out Set; New_Item : Element_Type; Node : out Count_Type; Inserted : out Boolean) is procedure Allocate_Set_Element (Node : in out Node_Type); pragma Inline (Allocate_Set_Element); function New_Node return Count_Type; pragma Inline (New_Node); procedure Local_Insert is new Element_Keys.Generic_Conditional_Insert (New_Node); procedure Allocate is new HT_Ops.Generic_Allocate (Allocate_Set_Element); --------------------------- -- Allocate_Set_Element -- --------------------------- procedure Allocate_Set_Element (Node : in out Node_Type) is begin Node.Element := New_Item; end Allocate_Set_Element; -------------- -- New_Node -- -------------- function New_Node return Count_Type is Result : Count_Type; begin Allocate (Container, Result); return Result; end New_Node; -- Start of processing for Insert begin -- The buckets array length is specified by the user as a discriminant -- of the container type, so it is possible for the buckets array to -- have a length of zero. We must check for this case specifically, in -- order to prevent divide-by-zero errors later, when we compute the -- buckets array index value for an element, given its hash value. if Checks and then Container.Buckets'Length = 0 then raise Capacity_Error with "No capacity for insertion"; end if; Local_Insert (Container, New_Item, Node, Inserted); end Insert; ------------------ -- Intersection -- ------------------ procedure Intersection (Target : in out Set; Source : Set) is Tgt_Node : Count_Type; TN : Nodes_Type renames Target.Nodes; begin if Target'Address = Source'Address then return; end if; if Source.Length = 0 then HT_Ops.Clear (Target); return; end if; TC_Check (Target.TC); Tgt_Node := HT_Ops.First (Target); while Tgt_Node /= 0 loop if Is_In (Source, TN (Tgt_Node)) then Tgt_Node := HT_Ops.Next (Target, Tgt_Node); else declare X : constant Count_Type := Tgt_Node; begin Tgt_Node := HT_Ops.Next (Target, Tgt_Node); HT_Ops.Delete_Node_Sans_Free (Target, X); HT_Ops.Free (Target, X); end; end if; end loop; end Intersection; function Intersection (Left, Right : Set) return Set is C : Count_Type; begin if Left'Address = Right'Address then return Left; end if; C := Count_Type'Min (Left.Length, Right.Length); if C = 0 then return Empty_Set; end if; return Result : Set (C, To_Prime (C)) do Iterate_Left : declare procedure Process (L_Node : Count_Type); procedure Iterate is new HT_Ops.Generic_Iteration (Process); ------------- -- Process -- ------------- procedure Process (L_Node : Count_Type) is N : Node_Type renames Left.Nodes (L_Node); X : Count_Type; B : Boolean; begin if Is_In (Right, N) then Insert (Result, N.Element, X, B); -- optimize ??? pragma Assert (B); pragma Assert (X > 0); end if; end Process; -- Start of processing for Iterate_Left begin Iterate (Left); end Iterate_Left; end return; end Intersection; -------------- -- Is_Empty -- -------------- function Is_Empty (Container : Set) return Boolean is begin return Container.Length = 0; end Is_Empty; ----------- -- Is_In -- ----------- function Is_In (HT : Set; Key : Node_Type) return Boolean is begin return Element_Keys.Find (HT'Unrestricted_Access.all, Key.Element) /= 0; end Is_In; --------------- -- Is_Subset -- --------------- function Is_Subset (Subset : Set; Of_Set : Set) return Boolean is Subset_Node : Count_Type; SN : Nodes_Type renames Subset.Nodes; begin if Subset'Address = Of_Set'Address then return True; end if; if Subset.Length > Of_Set.Length then return False; end if; Subset_Node := HT_Ops.First (Subset); while Subset_Node /= 0 loop if not Is_In (Of_Set, SN (Subset_Node)) then return False; end if; Subset_Node := HT_Ops.Next (Subset'Unrestricted_Access.all, Subset_Node); end loop; return True; end Is_Subset; ------------- -- Iterate -- ------------- procedure Iterate (Container : Set; Process : not null access procedure (Position : Cursor)) is procedure Process_Node (Node : Count_Type); pragma Inline (Process_Node); procedure Iterate is new HT_Ops.Generic_Iteration (Process_Node); ------------------ -- Process_Node -- ------------------ procedure Process_Node (Node : Count_Type) is begin Process (Cursor'(Container'Unrestricted_Access, Node)); end Process_Node; Busy : With_Busy (Container.TC'Unrestricted_Access); -- Start of processing for Iterate begin Iterate (Container); end Iterate; function Iterate (Container : Set) return Set_Iterator_Interfaces.Forward_Iterator'Class is begin Busy (Container.TC'Unrestricted_Access.all); return It : constant Iterator := Iterator'(Limited_Controlled with Container => Container'Unrestricted_Access); end Iterate; ------------ -- Length -- ------------ function Length (Container : Set) return Count_Type is begin return Container.Length; end Length; ---------- -- Move -- ---------- procedure Move (Target : in out Set; Source : in out Set) is begin if Target'Address = Source'Address then return; end if; TC_Check (Source.TC); Target.Assign (Source); Source.Clear; end Move; ---------- -- Next -- ---------- function Next (Node : Node_Type) return Count_Type is begin return Node.Next; end Next; function Next (Position : Cursor) return Cursor is begin if Position.Node = 0 then return No_Element; end if; pragma Assert (Vet (Position), "bad cursor in Next"); declare HT : Set renames Position.Container.all; Node : constant Count_Type := HT_Ops.Next (HT, Position.Node); begin if Node = 0 then return No_Element; end if; return Cursor'(Position.Container, Node); end; end Next; procedure Next (Position : in out Cursor) is begin Position := Next (Position); end Next; function Next (Object : Iterator; Position : Cursor) return Cursor is begin if Position.Container = null then return No_Element; end if; if Checks and then Position.Container /= Object.Container then raise Program_Error with "Position cursor of Next designates wrong set"; end if; return Next (Position); end Next; ------------- -- Overlap -- ------------- function Overlap (Left, Right : Set) return Boolean is Left_Node : Count_Type; begin if Right.Length = 0 then return False; end if; if Left'Address = Right'Address then return True; end if; Left_Node := HT_Ops.First (Left); while Left_Node /= 0 loop if Is_In (Right, Left.Nodes (Left_Node)) then return True; end if; Left_Node := HT_Ops.Next (Left'Unrestricted_Access.all, Left_Node); end loop; return False; end Overlap; ---------------------- -- Pseudo_Reference -- ---------------------- function Pseudo_Reference (Container : aliased Set'Class) return Reference_Control_Type is TC : constant Tamper_Counts_Access := Container.TC'Unrestricted_Access; begin return R : constant Reference_Control_Type := (Controlled with TC) do Lock (TC.all); end return; end Pseudo_Reference; ------------------- -- Query_Element -- ------------------- procedure Query_Element (Position : Cursor; Process : not null access procedure (Element : Element_Type)) is begin if Checks and then Position.Node = 0 then raise Constraint_Error with "Position cursor of Query_Element equals No_Element"; end if; pragma Assert (Vet (Position), "bad cursor in Query_Element"); declare S : Set renames Position.Container.all; Lock : With_Lock (S.TC'Unrestricted_Access); begin Process (S.Nodes (Position.Node).Element); end; end Query_Element; ---------- -- Read -- ---------- procedure Read (Stream : not null access Root_Stream_Type'Class; Container : out Set) is function Read_Node (Stream : not null access Root_Stream_Type'Class) return Count_Type; procedure Read_Nodes is new HT_Ops.Generic_Read (Read_Node); --------------- -- Read_Node -- --------------- function Read_Node (Stream : not null access Root_Stream_Type'Class) return Count_Type is procedure Read_Element (Node : in out Node_Type); pragma Inline (Read_Element); procedure Allocate is new HT_Ops.Generic_Allocate (Read_Element); procedure Read_Element (Node : in out Node_Type) is begin Element_Type'Read (Stream, Node.Element); end Read_Element; Node : Count_Type; -- Start of processing for Read_Node begin Allocate (Container, Node); return Node; end Read_Node; -- Start of processing for Read begin Read_Nodes (Stream, Container); end Read; procedure Read (Stream : not null access Root_Stream_Type'Class; Item : out Cursor) is begin raise Program_Error with "attempt to stream set cursor"; end Read; procedure Read (Stream : not null access Root_Stream_Type'Class; Item : out Constant_Reference_Type) is begin raise Program_Error with "attempt to stream reference"; end Read; ------------- -- Replace -- ------------- procedure Replace (Container : in out Set; New_Item : Element_Type) is Node : constant Count_Type := Element_Keys.Find (Container, New_Item); begin if Checks and then Node = 0 then raise Constraint_Error with "attempt to replace element not in set"; end if; TE_Check (Container.TC); Container.Nodes (Node).Element := New_Item; end Replace; procedure Replace_Element (Container : in out Set; Position : Cursor; New_Item : Element_Type) is begin if Checks and then Position.Node = 0 then raise Constraint_Error with "Position cursor equals No_Element"; end if; if Checks and then Position.Container /= Container'Unrestricted_Access then raise Program_Error with "Position cursor designates wrong set"; end if; pragma Assert (Vet (Position), "bad cursor in Replace_Element"); Replace_Element (Container, Position.Node, New_Item); end Replace_Element; ---------------------- -- Reserve_Capacity -- ---------------------- procedure Reserve_Capacity (Container : in out Set; Capacity : Count_Type) is begin if Checks and then Capacity > Container.Capacity then raise Capacity_Error with "requested capacity is too large"; end if; end Reserve_Capacity; ------------------ -- Set_Element -- ------------------ procedure Set_Element (Node : in out Node_Type; Item : Element_Type) is begin Node.Element := Item; end Set_Element; -------------- -- Set_Next -- -------------- procedure Set_Next (Node : in out Node_Type; Next : Count_Type) is begin Node.Next := Next; end Set_Next; -------------------------- -- Symmetric_Difference -- -------------------------- procedure Symmetric_Difference (Target : in out Set; Source : Set) is procedure Process (Source_Node : Count_Type); pragma Inline (Process); procedure Iterate is new HT_Ops.Generic_Iteration (Process); ------------- -- Process -- ------------- procedure Process (Source_Node : Count_Type) is N : Node_Type renames Source.Nodes (Source_Node); X : Count_Type; B : Boolean; begin if Is_In (Target, N) then Delete (Target, N.Element); else Insert (Target, N.Element, X, B); pragma Assert (B); end if; end Process; -- Start of processing for Symmetric_Difference begin if Target'Address = Source'Address then HT_Ops.Clear (Target); return; end if; if Target.Length = 0 then Assign (Target => Target, Source => Source); return; end if; TC_Check (Target.TC); Iterate (Source); end Symmetric_Difference; function Symmetric_Difference (Left, Right : Set) return Set is C : Count_Type; begin if Left'Address = Right'Address then return Empty_Set; end if; if Right.Length = 0 then return Left; end if; if Left.Length = 0 then return Right; end if; C := Left.Length + Right.Length; return Result : Set (C, To_Prime (C)) do Iterate_Left : declare procedure Process (L_Node : Count_Type); procedure Iterate is new HT_Ops.Generic_Iteration (Process); ------------- -- Process -- ------------- procedure Process (L_Node : Count_Type) is N : Node_Type renames Left.Nodes (L_Node); X : Count_Type; B : Boolean; begin if not Is_In (Right, N) then Insert (Result, N.Element, X, B); pragma Assert (B); end if; end Process; -- Start of processing for Iterate_Left begin Iterate (Left); end Iterate_Left; Iterate_Right : declare procedure Process (R_Node : Count_Type); procedure Iterate is new HT_Ops.Generic_Iteration (Process); ------------- -- Process -- ------------- procedure Process (R_Node : Count_Type) is N : Node_Type renames Right.Nodes (R_Node); X : Count_Type; B : Boolean; begin if not Is_In (Left, N) then Insert (Result, N.Element, X, B); pragma Assert (B); end if; end Process; -- Start of processing for Iterate_Right begin Iterate (Right); end Iterate_Right; end return; end Symmetric_Difference; ------------ -- To_Set -- ------------ function To_Set (New_Item : Element_Type) return Set is X : Count_Type; B : Boolean; begin return Result : Set (1, 1) do Insert (Result, New_Item, X, B); pragma Assert (B); end return; end To_Set; ----------- -- Union -- ----------- procedure Union (Target : in out Set; Source : Set) is procedure Process (Src_Node : Count_Type); procedure Iterate is new HT_Ops.Generic_Iteration (Process); ------------- -- Process -- ------------- procedure Process (Src_Node : Count_Type) is N : Node_Type renames Source.Nodes (Src_Node); X : Count_Type; B : Boolean; begin Insert (Target, N.Element, X, B); end Process; -- Start of processing for Union begin if Target'Address = Source'Address then return; end if; TC_Check (Target.TC); -- ??? why is this code commented out ??? -- declare -- N : constant Count_Type := Target.Length + Source.Length; -- begin -- if N > HT_Ops.Capacity (Target.HT) then -- HT_Ops.Reserve_Capacity (Target.HT, N); -- end if; -- end; Iterate (Source); end Union; function Union (Left, Right : Set) return Set is C : Count_Type; begin if Left'Address = Right'Address then return Left; end if; if Right.Length = 0 then return Left; end if; if Left.Length = 0 then return Right; end if; C := Left.Length + Right.Length; return Result : Set (C, To_Prime (C)) do Assign (Target => Result, Source => Left); Union (Target => Result, Source => Right); end return; end Union; --------- -- Vet -- --------- function Vet (Position : Cursor) return Boolean is begin if Position.Node = 0 then return Position.Container = null; end if; if Position.Container = null then return False; end if; declare S : Set renames Position.Container.all; N : Nodes_Type renames S.Nodes; X : Count_Type; begin if S.Length = 0 then return False; end if; if Position.Node > N'Last then return False; end if; if N (Position.Node).Next = Position.Node then return False; end if; X := S.Buckets (Element_Keys.Checked_Index (S, N (Position.Node).Element)); for J in 1 .. S.Length loop if X = Position.Node then return True; end if; if X = 0 then return False; end if; if X = N (X).Next then -- to prevent unnecessary looping return False; end if; X := N (X).Next; end loop; return False; end; end Vet; ----------- -- Write -- ----------- procedure Write (Stream : not null access Root_Stream_Type'Class; Container : Set) is procedure Write_Node (Stream : not null access Root_Stream_Type'Class; Node : Node_Type); pragma Inline (Write_Node); procedure Write_Nodes is new HT_Ops.Generic_Write (Write_Node); ---------------- -- Write_Node -- ---------------- procedure Write_Node (Stream : not null access Root_Stream_Type'Class; Node : Node_Type) is begin Element_Type'Write (Stream, Node.Element); end Write_Node; -- Start of processing for Write begin Write_Nodes (Stream, Container); end Write; procedure Write (Stream : not null access Root_Stream_Type'Class; Item : Cursor) is begin raise Program_Error with "attempt to stream set cursor"; end Write; procedure Write (Stream : not null access Root_Stream_Type'Class; Item : Constant_Reference_Type) is begin raise Program_Error with "attempt to stream reference"; end Write; package body Generic_Keys is ----------------------- -- Local Subprograms -- ----------------------- function Equivalent_Key_Node (Key : Key_Type; Node : Node_Type) return Boolean; pragma Inline (Equivalent_Key_Node); -------------------------- -- Local Instantiations -- -------------------------- package Key_Keys is new Hash_Tables.Generic_Bounded_Keys (HT_Types => HT_Types, Next => Next, Set_Next => Set_Next, Key_Type => Key_Type, Hash => Hash, Equivalent_Keys => Equivalent_Key_Node); ------------------------ -- Constant_Reference -- ------------------------ function Constant_Reference (Container : aliased Set; Key : Key_Type) return Constant_Reference_Type is Node : constant Count_Type := Key_Keys.Find (Container'Unrestricted_Access.all, Key); begin if Checks and then Node = 0 then raise Constraint_Error with "key not in set"; end if; declare N : Node_Type renames Container.Nodes (Node); TC : constant Tamper_Counts_Access := Container.TC'Unrestricted_Access; begin return R : constant Constant_Reference_Type := (Element => N.Element'Access, Control => (Controlled with TC)) do Lock (TC.all); end return; end; end Constant_Reference; -------------- -- Contains -- -------------- function Contains (Container : Set; Key : Key_Type) return Boolean is begin return Find (Container, Key) /= No_Element; end Contains; ------------ -- Delete -- ------------ procedure Delete (Container : in out Set; Key : Key_Type) is X : Count_Type; begin Key_Keys.Delete_Key_Sans_Free (Container, Key, X); if Checks and then X = 0 then raise Constraint_Error with "attempt to delete key not in set"; end if; HT_Ops.Free (Container, X); end Delete; ------------- -- Element -- ------------- function Element (Container : Set; Key : Key_Type) return Element_Type is Node : constant Count_Type := Key_Keys.Find (Container'Unrestricted_Access.all, Key); begin if Checks and then Node = 0 then raise Constraint_Error with "key not in set"; end if; return Container.Nodes (Node).Element; end Element; ------------------------- -- Equivalent_Key_Node -- ------------------------- function Equivalent_Key_Node (Key : Key_Type; Node : Node_Type) return Boolean is begin return Equivalent_Keys (Key, Generic_Keys.Key (Node.Element)); end Equivalent_Key_Node; ------------- -- Exclude -- ------------- procedure Exclude (Container : in out Set; Key : Key_Type) is X : Count_Type; begin Key_Keys.Delete_Key_Sans_Free (Container, Key, X); HT_Ops.Free (Container, X); end Exclude; -------------- -- Finalize -- -------------- procedure Finalize (Control : in out Reference_Control_Type) is begin if Control.Container /= null then Impl.Reference_Control_Type (Control).Finalize; if Checks and then Hash (Key (Element (Control.Old_Pos))) /= Control.Old_Hash then HT_Ops.Delete_Node_At_Index (Control.Container.all, Control.Index, Control.Old_Pos.Node); raise Program_Error with "key not preserved in reference"; end if; Control.Container := null; end if; end Finalize; ---------- -- Find -- ---------- function Find (Container : Set; Key : Key_Type) return Cursor is Node : constant Count_Type := Key_Keys.Find (Container'Unrestricted_Access.all, Key); begin return (if Node = 0 then No_Element else Cursor'(Container'Unrestricted_Access, Node)); end Find; --------- -- Key -- --------- function Key (Position : Cursor) return Key_Type is begin if Checks and then Position.Node = 0 then raise Constraint_Error with "Position cursor equals No_Element"; end if; pragma Assert (Vet (Position), "bad cursor in function Key"); return Key (Position.Container.Nodes (Position.Node).Element); end Key; ---------- -- Read -- ---------- procedure Read (Stream : not null access Root_Stream_Type'Class; Item : out Reference_Type) is begin raise Program_Error with "attempt to stream reference"; end Read; ------------------------------ -- Reference_Preserving_Key -- ------------------------------ function Reference_Preserving_Key (Container : aliased in out Set; Position : Cursor) return Reference_Type is begin if Checks and then Position.Container = null then raise Constraint_Error with "Position cursor has no element"; end if; if Checks and then Position.Container /= Container'Unrestricted_Access then raise Program_Error with "Position cursor designates wrong container"; end if; pragma Assert (Vet (Position), "bad cursor in function Reference_Preserving_Key"); declare N : Node_Type renames Container.Nodes (Position.Node); begin return R : constant Reference_Type := (Element => N.Element'Unrestricted_Access, Control => (Controlled with Container.TC'Unrestricted_Access, Container'Unrestricted_Access, Index => Key_Keys.Index (Container, Key (Position)), Old_Pos => Position, Old_Hash => Hash (Key (Position)))) do Lock (Container.TC); end return; end; end Reference_Preserving_Key; function Reference_Preserving_Key (Container : aliased in out Set; Key : Key_Type) return Reference_Type is Node : constant Count_Type := Key_Keys.Find (Container, Key); begin if Checks and then Node = 0 then raise Constraint_Error with "key not in set"; end if; declare P : constant Cursor := Find (Container, Key); begin return R : constant Reference_Type := (Element => Container.Nodes (Node).Element'Unrestricted_Access, Control => (Controlled with Container.TC'Unrestricted_Access, Container'Unrestricted_Access, Index => Key_Keys.Index (Container, Key), Old_Pos => P, Old_Hash => Hash (Key))) do Lock (Container.TC); end return; end; end Reference_Preserving_Key; ------------- -- Replace -- ------------- procedure Replace (Container : in out Set; Key : Key_Type; New_Item : Element_Type) is Node : constant Count_Type := Key_Keys.Find (Container, Key); begin if Checks and then Node = 0 then raise Constraint_Error with "attempt to replace key not in set"; end if; Replace_Element (Container, Node, New_Item); end Replace; ----------------------------------- -- Update_Element_Preserving_Key -- ----------------------------------- procedure Update_Element_Preserving_Key (Container : in out Set; Position : Cursor; Process : not null access procedure (Element : in out Element_Type)) is Indx : Hash_Type; N : Nodes_Type renames Container.Nodes; begin if Checks and then Position.Node = 0 then raise Constraint_Error with "Position cursor equals No_Element"; end if; if Checks and then Position.Container /= Container'Unrestricted_Access then raise Program_Error with "Position cursor designates wrong set"; end if; -- ??? why is this code commented out ??? -- if HT.Buckets = null -- or else HT.Buckets'Length = 0 -- or else HT.Length = 0 -- or else Position.Node.Next = Position.Node -- then -- raise Program_Error with -- "Position cursor is bad (set is empty)"; -- end if; pragma Assert (Vet (Position), "bad cursor in Update_Element_Preserving_Key"); -- Per AI05-0022, the container implementation is required to detect -- element tampering by a generic actual subprogram. declare E : Element_Type renames N (Position.Node).Element; K : constant Key_Type := Key (E); Lock : With_Lock (Container.TC'Unrestricted_Access); begin -- Record bucket now, in case key is changed Indx := HT_Ops.Index (Container.Buckets, N (Position.Node)); Process (E); if Equivalent_Keys (K, Key (E)) then return; end if; end; -- Key was modified, so remove this node from set. if Container.Buckets (Indx) = Position.Node then Container.Buckets (Indx) := N (Position.Node).Next; else declare Prev : Count_Type := Container.Buckets (Indx); begin while N (Prev).Next /= Position.Node loop Prev := N (Prev).Next; if Checks and then Prev = 0 then raise Program_Error with "Position cursor is bad (node not found)"; end if; end loop; N (Prev).Next := N (Position.Node).Next; end; end if; Container.Length := Container.Length - 1; HT_Ops.Free (Container, Position.Node); raise Program_Error with "key was modified"; end Update_Element_Preserving_Key; ----------- -- Write -- ----------- procedure Write (Stream : not null access Root_Stream_Type'Class; Item : Reference_Type) is begin raise Program_Error with "attempt to stream reference"; end Write; end Generic_Keys; end Ada.Containers.Bounded_Hashed_Sets;
26.706215
79
0.542358
225c6542e9c6f9d3cbbea25cfa21d18ed330225d
5,134
ads
Ada
source/web/fastcgi/fastcgi-replies.ads
svn2github/matreshka
9d222b3ad9da508855fb1f5adbe5e8a4fad4c530
[ "BSD-3-Clause" ]
24
2016-11-29T06:59:41.000Z
2021-08-30T11:55:16.000Z
source/web/fastcgi/fastcgi-replies.ads
svn2github/matreshka
9d222b3ad9da508855fb1f5adbe5e8a4fad4c530
[ "BSD-3-Clause" ]
2
2019-01-16T05:15:20.000Z
2019-02-03T10:03:32.000Z
source/web/fastcgi/fastcgi-replies.ads
svn2github/matreshka
9d222b3ad9da508855fb1f5adbe5e8a4fad4c530
[ "BSD-3-Clause" ]
4
2017-07-18T07:11:05.000Z
2020-06-21T03:02:25.000Z
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Web Framework -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2010, Vadim Godunko <[email protected]> -- -- All rights reserved. -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions -- -- are met: -- -- -- -- * Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- -- -- * Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in the -- -- documentation and/or other materials provided with the distribution. -- -- -- -- * Neither the name of the Vadim Godunko, IE nor the names of its -- -- contributors may be used to endorse or promote products derived from -- -- this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -- -- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -- -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -- -- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -- -- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ -- $Revision$ $Date$ ------------------------------------------------------------------------------ with Ada.Streams; with League.Stream_Element_Vectors; with League.Strings; private with Matreshka.FastCGI; package FastCGI.Replies is -- pragma Preelaborate; type Reply is tagged limited private; function Has_Raw_Header (Self : Reply; Name : League.Stream_Element_Vectors.Stream_Element_Vector) return Boolean; function Raw_Header (Self : Reply; Name : League.Stream_Element_Vectors.Stream_Element_Vector) return League.Stream_Element_Vectors.Stream_Element_Vector; procedure Set_Raw_Header (Self : in out Reply; Name : League.Stream_Element_Vectors.Stream_Element_Vector; Value : League.Stream_Element_Vectors.Stream_Element_Vector); procedure Set_Content_Type (Self : in out Reply; Value : League.Strings.Universal_String); function Stream (Self : Reply) return not null access Ada.Streams.Root_Stream_Type'Class; -- Returns stream to write reply's data to server. function Error_Stream (Self : Reply) return not null access Ada.Streams.Root_Stream_Type'Class; -- Returns stream to read error data to server. private type Output_Stream is new Ada.Streams.Root_Stream_Type with record Descriptor : Matreshka.FastCGI.Descriptor_Access; end record; type Output_Stream_Access is access all Output_Stream; overriding procedure Read (Self : in out Output_Stream; Item : out Ada.Streams.Stream_Element_Array; Last : out Ada.Streams.Stream_Element_Offset); overriding procedure Write (Self : in out Output_Stream; Item : Ada.Streams.Stream_Element_Array); type Reply is tagged limited record Descriptor : Matreshka.FastCGI.Descriptor_Access; Out_Stream : Output_Stream_Access; end record; end FastCGI.Replies;
47.537037
78
0.509934
c75dfbe66e6f4b7fda2fc0e1c15429a89ec49758
602
adb
Ada
gcc-gcc-7_3_0-release/gcc/testsuite/gnat.dg/unc.adb
best08618/asylo
5a520a9f5c461ede0f32acc284017b737a43898c
[ "Apache-2.0" ]
7
2020-05-02T17:34:05.000Z
2021-10-17T10:15:18.000Z
gcc-gcc-7_3_0-release/gcc/testsuite/gnat.dg/unc.adb
best08618/asylo
5a520a9f5c461ede0f32acc284017b737a43898c
[ "Apache-2.0" ]
null
null
null
gcc-gcc-7_3_0-release/gcc/testsuite/gnat.dg/unc.adb
best08618/asylo
5a520a9f5c461ede0f32acc284017b737a43898c
[ "Apache-2.0" ]
2
2020-07-27T00:22:36.000Z
2021-04-01T09:41:02.000Z
-- { dg-do compile } with Ada.Streams.Stream_IO; use Ada.Streams.Stream_IO; procedure Unc is type Arr is array (1..4) of integer; type Bytes is array (positive range <>) of Character; type Buffer (D : Boolean := False) is record case D is when False => Chars: Bytes (1..16); when True => Values : Arr; end case; end record; -- pragma Unchecked_Union (Buffer); pragma Warnings (Off); Val : Buffer; -- F : File_Type; S : Stream_Access; begin Create (F, Out_File); S := Stream (F); Buffer'Output (S, Val); end;
22.296296
56
0.584718
1a288e76ae83f1e1f01cad2026067ceee9140d2b
26,855
adb
Ada
ga_ref_impl/src/blade.adb
rogermc2/GA_Ada
0b55eb5691ac1c543c79c9a06ffdbe2e47e8f1be
[ "ISC" ]
3
2019-04-12T01:09:55.000Z
2021-02-24T18:17:32.000Z
ga_ref_impl/src/blade.adb
rogermc2/GA_Ada
0b55eb5691ac1c543c79c9a06ffdbe2e47e8f1be
[ "ISC" ]
1
2020-08-12T10:10:25.000Z
2020-08-12T10:10:25.000Z
ga_ref_impl/src/blade.adb
rogermc2/GA_Ada
0b55eb5691ac1c543c79c9a06ffdbe2e47e8f1be
[ "ISC" ]
1
2019-04-12T01:14:15.000Z
2019-04-12T01:14:15.000Z
with Ada.Text_IO; use Ada.Text_IO; with Bits; package body Blade is epsilon : constant Float := 10.0 ** (-6); function GP_OP (BA, BB : Basis_Blade; Outer : Boolean) return Basis_Blade; function Inner_Product_Filter (Grade_1, Grade_2 : Integer; Blades : Blade_List; Cont : Contraction_Type) return Blade_List; function Inner_Product_Filter (Grade_1, Grade_2 : Integer; BB : Basis_Blade; Cont : Contraction_Type) return Basis_Blade; function New_Blade (Weight : Float := 1.0) return Basis_Blade; function To_Eigen_Basis (BB : Basis_Blade; Met : Metric.Metric_Record) return Blade_List; function To_Metric_Basis (BL : Blade_List; Met : Metric.Metric_Record) return Blade_List; function Transform_Basis (BA : Blade.Basis_Blade; Met : GA_Maths.Float_Matrix) return Blade_List; -- ------------------------------------------------------------------------- function "<" (Left, Right : Blade.Basis_Blade) return Boolean is begin return Bitmap (Left) < Bitmap (Right); end "<"; -- ------------------------------------------------------------------------ function "*" (S : Float; BB : Basis_Blade) return Basis_Blade is begin return (BB.Bitmap, S * BB.Weight); end "*"; -- ------------------------------------------------------------------------ function "*" (BB : Basis_Blade; S : Float) return Basis_Blade is begin return S * BB; end "*"; -- ------------------------------------------------------------------------ procedure Add_Blade (Blades : in out Blade_List; BB : Basis_Blade)is begin Blades.Append (BB); end Add_Blade; -- ------------------------------------------------------------------------- procedure Add_Blade (Blades : in out Blade_Vector; Index : Natural; BB : Basis_Blade)is begin Blades.Replace_Element (Index, BB); end Add_Blade; -- ------------------------------------------------------------------------- procedure Add_Blades (Blades : in out Blade_List; More_Blades : Blade_List) is use Blade_List_Package; Curs : Cursor := More_Blades.First; aBlade : Basis_Blade; begin while Has_Element (Curs) loop aBlade := Element (Curs); if Weight (aBlade) /= 0.0 then Blades.Append (aBlade); end if; Next (Curs); end loop; end Add_Blades; -- ------------------------------------------------------------------------- function BB_First (BB_List : Blade_List) return Basis_Blade is begin return BB_List.First_Element; end BB_First; -- ------------------------------------------------------------------------- function BB_Item (BB_List : Blade_List; Index : Integer) return Basis_Blade is use Blade_List_Package; Curs : Cursor := BB_List.First; begin if Index > 1 then for count in 2 .. Index loop Next (Curs); end loop; end if; return Element (Curs); end BB_Item; -- ------------------------------------------------------------------------- function Blade_String (aBlade : Basis_Blade; BV_Names : Basis_Vector_Names) return Ada.Strings.Unbounded.Unbounded_String is use Names_Package; BM : Unsigned_32 := aBlade.Bitmap; Bit_Num : Natural := 1; Scale : constant GA_Maths.float_3 := GA_Maths.float_3 (Weight (aBlade)); Name : Unbounded_String; Val : Unbounded_String; theString : Ada.Strings.Unbounded.Unbounded_String := To_Unbounded_String (""); begin -- Put_Line ("Blade.Blade_String, initial BM: " & Unsigned_32'Image (BM)); if BM = 0 then theString := To_Unbounded_String (GA_Maths.float_3'Image (Scale)); else while BM /= 0 loop -- Put_Line ("Blade.Blade_String, BM, Bit_Num: " & Unsigned_32'Image (BM) & -- ", " & Natural'Image (Bit_Num)); if (BM and 1) /= 0 then -- Put_Line ("Blade.Blade_String, BM bit detected: " & Unsigned_32'Image (BM)); if Length (theString) > 0 then theString := theString & "^"; end if; if Is_Empty (Vector (BV_Names)) or (Bit_Num > Natural (Length (Vector (BV_Names))) or (Bit_Num) < 1) then theString := theString & "e"; Val := To_Unbounded_String (Natural'Image (Bit_Num)); Val := Trim (Val, Ada.Strings.Left); theString := theString & Val; else Name := Element (BV_Names, Bit_Num); theString := theString & Name; end if; -- Put_Line ("Blade.Blade_String, theString: " & To_String (theString)); end if; BM := BM / 2; -- BM >>= 1; Bit_Num := Bit_Num + 1; end loop; if Length (theString) > 0 then theString := GA_Maths.float_3'Image (Scale) & " * " & theString; end if; end if; -- Put_Line ("Blade.Blade_String, final theString: " & To_String (theString)); return theString; exception when others => Put_Line ("An exception occurred in Blade.Blade_String."); raise; end Blade_String; -- ------------------------------------------------------------------------- function Bitmap (BB : Basis_Blade) return Unsigned_32 is begin return BB.Bitmap; end Bitmap; -- ------------------------------------------------------------------------ function Canonical_Reordering_Sign (Map_A, Map_B : Unsigned_32) return float is A : Unsigned_32 := Map_A / 2; Swaps : Natural := 0; begin while A /= 0 loop Swaps := Swaps + Bits.Bit_Count (A and Map_B); A := A / 2; end loop; if Swaps mod 2 = 0 then -- an even number of swaps return 1.0; else -- an odd number of swaps return -1.0; end if; end Canonical_Reordering_Sign; -- ------------------------------------------------------------------------ -- Based on BasisBlade.java geometricProduct(BasisBlade a, BasisBlade b, double[] m) -- wher m is an array of doubles giving the metric for each basis vector. function Geometric_Product (BB : Basis_Blade; Sc : Float) return Basis_Blade is S_Blade : constant Basis_Blade := New_Scalar_Blade (Sc); begin return GP_OP (BB, S_Blade, False); end Geometric_Product; -- ------------------------------------------------------------------------ -- Geometric_Product computes the geometric product of two basis blades. function Geometric_Product (BA, BB : Basis_Blade) return Basis_Blade is begin return GP_OP (BA, BB, False); end Geometric_Product; -- ------------------------------------------------------------------------ -- This Geometric_Product returns an ArrayList because -- the result does not have to be a single BasisBlade. function Geometric_Product (BA, BB : Basis_Blade; Met : Metric.Metric_Record) return Blade_List is use Blade_List_Package; use GA_Maths.Float_Array_Package; List_A : constant Blade_List := To_Eigen_Basis (BA, Met); List_B : constant Blade_List := To_Eigen_Basis (BB, Met); LA_Cursor : Cursor := List_A.First; LB_Cursor : Cursor; Eigen_Vals : constant Real_Vector := Metric.Eigen_Values (Met); -- M.getEigenMetric GP : Basis_Blade; Result : Blade_List; begin -- List_A and List_B needed because To_Eigen_Basis returns an ArrayList -- because its result does not have to be a single BasisBlade. while Has_Element (LA_Cursor) loop LB_Cursor := List_B.First; while Has_Element (LB_Cursor) loop GP := Geometric_Product (Element (LA_Cursor), Element (LB_Cursor), Eigen_Vals); Add_Blade (Result, (GP)); Next (LB_Cursor); end loop; Next (LA_Cursor); end loop; Simplify (Result); Result := To_Metric_Basis (Result, Met); return Result; exception when others => Put_Line ("An exception occurred in Blade.Geometric_Product with Metric."); raise; end Geometric_Product; -- ------------------------------------------------------------------------ function Geometric_Product (BA, BB : Basis_Blade; Eigen_Vals : GA_Maths.Float_Array_Package.Real_Vector) return Basis_Blade is -- Eigen_Vals gives the metric for each basis vector -- BM is the meet (bitmap of annihilated vectors) -- Only retain vectors common to both blades BM : Unsigned_32 := Bitmap (BA) and Bitmap (BB); -- M.getEigenMetric Index : Integer := 1; New_Blade : Basis_Blade := Geometric_Product (BA, BB); -- Euclidean metric begin while BM /= 0 loop if (BM and 1) /= 0 then -- This basis vector is non-zero New_Blade.Weight := New_Blade.Weight * Eigen_Vals (Index); end if; -- Move right to next basis vector indicator -- BM := BM / 2; BM := Shift_Right (BM, 1); Index := Index + 1; end loop; if New_Blade.Weight = 0.0 then New_Blade := New_Basis_Blade; end if; return New_Blade; exception when others => Put_Line ("An exception occurred in Blade.Geometric_Product with Metric."); raise; end Geometric_Product; -- ------------------------------------------------------------------------ function GP_OP (BA, BB : Basis_Blade; Outer : Boolean) return Basis_Blade is OP_Blade : Basis_Blade; Sign : Float; begin if Outer and then (BA.Bitmap and BB.Bitmap) /= 0 then -- BA and BB are parallel; so their volume is zero OP_Blade := New_Basis_Blade (0, 0.0); -- return zero blade else -- compute geometric product -- if BA.Bitmap = BB.Bitmap, xor = 0, so Dot product part of MV -- else xor > 0 so Outer product part of MV Sign := Canonical_Reordering_Sign (BA.Bitmap, BB.Bitmap); OP_Blade := New_Blade (BA.Bitmap xor BB.Bitmap, Sign * BA.Weight * BB.Weight); end if; return OP_Blade; exception when others => Put_Line ("An exception occurred in Blade.GP_OP"); raise; end GP_OP; -- ------------------------------------------------------------------------ function Grade (BB : Basis_Blade) return Integer is begin return Bits.Bit_Count (BB.Bitmap); end Grade; -- ------------------------------------------------------------------------ function Grade_Inversion (B : Basis_Blade) return Basis_Blade is W : constant Float := Float (Minus_1_Power (Grade (B)) * Integer (B.Weight)); begin return New_Blade (B.Bitmap, W); end Grade_Inversion; -- ------------------------------------------------------------------------ function Inner_Product (BA, BB : Basis_Blade; Cont : Contraction_Type) return Basis_Blade is begin return Inner_Product_Filter (Grade (BA), Grade (BB), Geometric_Product (BA, BB), Cont); end Inner_Product; -- ------------------------------------------------------------------------ function Inner_Product (BA, BB : Basis_Blade; Met : Metric.Metric_Record; Cont : Contraction_Type) return Blade_List is GP : constant Blade_List := Geometric_Product (BA, BB, Met); begin return Inner_Product_Filter (Grade (BA), Grade (BB), GP, Cont); end Inner_Product; -- ------------------------------------------------------------------------ function Inner_Product_Filter (Grade_1, Grade_2 : Integer; BB : Basis_Blade; Cont : Contraction_Type) return Basis_Blade is IP_Blade : Basis_Blade; begin case Cont is when Left_Contraction => if (Grade_1 > Grade_2) or (Grade (BB) /= (Grade_2 - Grade_1)) then IP_Blade := New_Basis_Blade; else -- Grade_1 <= Grade_2 and Grade (BB) = Grade_2 - Grade_1 IP_Blade := BB; end if; when Right_Contraction => if (Grade_1 < Grade_2) or (Grade (BB) /= Grade_1 - Grade_2) then IP_Blade := New_Basis_Blade; else IP_Blade := BB; end if; when Hestenes_Inner_Product => if (Grade_1 = 0) or (Grade_2 = 0) then IP_Blade := New_Basis_Blade; elsif Abs (Grade_1 - Grade_2) = Grade (BB) then IP_Blade := BB; end if; when Modified_Hestenes_Inner_Product => if Abs (Grade_1 - Grade_2) = Grade (BB) then IP_Blade := BB; else IP_Blade := New_Basis_Blade; end if; end case; return IP_Blade; exception when others => Put_Line ("An exception occurred in Blade.Inner_Product_Filter"); raise; end Inner_Product_Filter; -- ------------------------------------------------------------------------ function Inner_Product_Filter (Grade_1, Grade_2 : Integer; Blades : Blade_List; Cont : Contraction_Type) return Blade_List is use Blade_List_Package; Blade_Cursor : Cursor := Blades.First; aBlade : Basis_Blade; New_Blades : Blade_List; begin while Has_Element (Blade_Cursor) loop -- Inner_Product_Filter returns either a null blade or Element (Blade_Cursor) aBlade := Inner_Product_Filter (Grade_1, Grade_2, Element (Blade_Cursor), Cont); if Weight (aBlade) /= 0.0 then Add_Blade (New_Blades, (aBlade)); end if; Next (Blade_Cursor); end loop; return New_Blades; exception when others => Put_Line ("An exception occurred in Blade.Inner_Product_Filter"); raise; end Inner_Product_Filter; -- ------------------------------------------------------------------------ function List_Length (Blades : Blade_List) return Integer is begin return Integer (Blades.Length); end List_Length; -- ------------------------------------------------------------------------ function Minus_1_Power (Power : Integer) return Integer is begin return (-1) ** Power; end Minus_1_Power; -- ------------------------------------------------------------------------ function New_Blade (Weight : Float := 1.0) return Basis_Blade is Blade : Basis_Blade; begin Blade.Weight := Weight; return Blade; end New_Blade; -- ------------------------------------------------------------------------ function New_Blade (Bitmap : Unsigned_32; Weight : Float := 1.0) return Basis_Blade is Blade : Basis_Blade; begin if Bitmap < 32 then Blade.Bitmap := Bitmap; Blade.Weight := Weight; else raise Blade_Exception with "Blade.New_Blade, invalid Bitmap" & Unsigned_32'Image (Bitmap); end if; return Blade; end New_Blade; -- ------------------------------------------------------------------------ function New_Basis_Blade (Bitmap : Unsigned_32; Weight : Float := 1.0) return Basis_Blade is Blade : Basis_Blade; begin if Bitmap < 32 then Blade.Bitmap := Bitmap; Blade.Weight := Weight; else raise Blade_Exception with "Blade.New_Basis_Blade, invalid Bitmap" & Unsigned_32'Image (Bitmap); end if; return Blade; end New_Basis_Blade; -- ------------------------------------------------------------------------ function New_Basis_Blade (Weight : Float := 0.0) return Basis_Blade is Blade : Basis_Blade; begin Blade.Bitmap := 0; Blade.Weight := Weight; return Blade; end New_Basis_Blade; -- ------------------------------------------------------------------------ function New_Basis_Blade (Index : BV_Base; Weight : Float := 1.0) return Basis_Blade is begin return (Index'Enum_Rep, Weight); end New_Basis_Blade; -- ------------------------------------------------------------------------ function New_Basis_Blade (Index : E2_Base; Weight : Float := 1.0) return Basis_Blade is begin return (Index'Enum_Rep, Weight); exception when others => Put_Line ("An exception occurred in Blade.New_Basis_Blade"); raise; end New_Basis_Blade; -- ------------------------------------------------------------------------ function New_Basis_Blade (Index : E3_Base; Weight : Float := 1.0) return Basis_Blade is begin return (Index'Enum_Rep, Weight); end New_Basis_Blade; -- ------------------------------------------------------------------------ function New_Basis_Blade (Index : C3_Base; Weight : Float := 1.0) return Basis_Blade is begin return (Index'Enum_Rep, Weight); end New_Basis_Blade; -- ------------------------------------------------------------------------ function New_Complex_Basis_Blade (Index : C3_Base; Weight : GA_Maths.Complex_Types.Complex := (0.0, 1.0)) return Complex_Basis_Blade is begin return (Index'Enum_Rep, Weight); end New_Complex_Basis_Blade; -- ------------------------------------------------------------------------ function New_Scalar_Blade (Weight : Float := 1.0) return Basis_Blade is Blade : Basis_Blade; begin Blade.Bitmap := 0; Blade.Weight := Weight; return Blade; end New_Scalar_Blade; -- ------------------------------------------------------------------------ function New_Zero_Blade return Basis_Blade is Blade : Basis_Blade; begin return Blade; end New_Zero_Blade; -- ------------------------------------------------------------------------ function Outer_Product (BA, BB : Basis_Blade) return Basis_Blade is begin return GP_OP (BA, BB, True); end Outer_Product; -- ------------------------------------------------------------------------ function Reverse_Blade (B : Basis_Blade) return Basis_Blade is G : constant Integer := Grade (B); -- Bit_Count (B.Bitmap) W : constant Float := Float (Minus_1_Power ((G * (G - 1)) / 2)) * B.Weight; begin return (B.Bitmap, W); end Reverse_Blade; -- ------------------------------------------------------------------------ procedure Simplify (Blades : in out Blade_List) is use Blade_List_Package; Current_Blade : Blade.Basis_Blade; Blade_B : Blade.Basis_Blade; Blade_Cursor : Cursor; Result : Blade_List; begin if List (Blades) /= Empty_List then Blade_Cursor := Blades.First; while Has_Element (Blade_Cursor) loop Blade_B := Element (Blade_Cursor); if Weight (Blade_B) = 0.0 then Delete (Blades, Blade_Cursor); else Next (Blade_Cursor); end if; end loop; if List (Blades) /= Empty_List then Blade_Sort_Package.Sort (List (Blades)); Blade_Cursor := Blades.First; Current_Blade := Element (Blade_Cursor); Next (Blade_Cursor); while Has_Element (Blade_Cursor) loop Blade_B := Element (Blade_Cursor); if Bitmap (Blade_B) = Bitmap (Current_Blade) then Current_Blade := New_Blade (Bitmap (Current_Blade), Weight (Current_Blade) + Weight (Blade_B)); else if Abs (Weight (Current_Blade)) > epsilon then Result.Append (Current_Blade); end if; Current_Blade := Blade_B; end if; Next (Blade_Cursor); end loop; if Abs (Weight (Current_Blade)) > epsilon then Result.Append (Current_Blade); end if; Blades := Result; end if; end if; end Simplify; -- ------------------------------------------------------------------------- function To_Eigen_Basis (BB : Basis_Blade; Met : Metric.Metric_Record) return Blade_List is begin return Transform_Basis (BB, GA_Maths.Float_Matrix (Metric.Eigen_Vectors (Met))); end To_Eigen_Basis; -- ------------------------------------------------------------------------ function To_Metric_Basis (BB : Basis_Blade; Met : Metric.Metric_Record) return Blade_List is begin return Transform_Basis (BB, GA_Maths.Float_Matrix (Metric.Inv_Eigen_Matrix (Met))); end To_Metric_Basis; -- ------------------------------------------------------------------------ function To_Metric_Basis (BL : Blade_List; Met : Metric.Metric_Record) return Blade_List is use Blade_List_Package; BL_Cursor : Cursor := BL.First; Tmp_List : Blade_List; TL_Cursor : Cursor; Result : Blade_List; begin -- GA_Utilities.Print_Blade_List ("Blade.To_Metric_Basis BL", BL); while Has_Element (BL_Cursor) loop Tmp_List.Clear; -- GA_Utilities.Print_Blade ("Blade.To_Metric_Basis blade", Element (BL_Cursor)); Tmp_List := To_Metric_Basis (Element (BL_Cursor), Met); -- GA_Utilities.Print_Blade_List ("Blade.To_Metric_Basis Tmp_List", Tmp_List); TL_Cursor := Tmp_List.First; while Has_Element (TL_Cursor) loop Result.Append (Element (TL_Cursor)); Next (TL_Cursor); end loop; Next (BL_Cursor); end loop; Simplify (Result); return Result; exception when others => Put_Line ("An exception occurred in Blade.To_Metric_Basis"); raise; end To_Metric_Basis; -- ------------------------------------------------------------------------ -- Transform_Basis transforms a Basis_Blade to a new basis -- Based on Metric.java ArrayList transform(BasisBlade a, DoubleMatrix2D M) function Transform_Basis (BA : Blade.Basis_Blade; Met : GA_Maths.Float_Matrix) return Blade_List is use Blade_List_Package; List_A : Blade_List; BM : Unsigned_32 := Bitmap (BA); Curs : Cursor; OP : Basis_Blade; Temp : Blade_List; I_Col : Integer := 1; Value : Float; begin -- New_Line; -- GA_Utilities.Print_Matrix ("Blade.Transform_Basis Met", Real_Matrix ((Met))); -- GA_Utilities.Print_Blade ("Blade.Transform_Basis BA", BA); -- Put_Line ("Blade.Transform_Basis Bitmap (BA)" & Unsigned_32'Image (BM)); -- start with just a scalar List_A.Append (New_Blade (Weight (BA))); -- convert each 1 bit to a list of blades -- Put_Line ("Blade.Transform_Basis 1st blade added"); while BM /= 0 loop -- Put_Line ("Blade.Transform_Basis BM" & Unsigned_32'Image (BM)); if (BM and 1) /= 0 then Temp.Clear; for Row in 1 .. Met'Length (1) loop -- Put_Line ("Blade.Transform_Basis Row, I_Col" & -- Integer'Image (Row) & Integer'Image (I_Col)); Value := Met (Row, I_Col); if Value /= 0.0 then -- Wedge column Col of the matrix with List_A Curs := List_A.First; while Has_Element (Curs) loop -- GA_Utilities.Print_Blade ("Blade.Transform_Basis Element (Curs)", Element (Curs)); OP := Outer_Product (Element (Curs), New_Basis_Blade (2 ** (Row - 1), Value)); Temp.Append (OP); Next (Curs); end loop; end if; end loop; -- Row List_A := Temp; end if; -- (BM and 1) /= 0 BM := Shift_Right (BM, 1); I_Col := I_Col + 1; end loop; -- BM /= 0 return List_A; exception when others => Put_Line ("An exception occurred in Blade.Transform_Basis"); raise; end Transform_Basis; -- ------------------------------------------------------------------------ procedure Update_Blade (BB : in out Basis_Blade; Weight : Float) is begin BB.Weight := Weight; exception when others => Put_Line ("An exception occurred in Blade.Update_Blade 1"); raise; end Update_Blade; -- ------------------------------------------------------------------------ procedure Update_Blade (BB : in out Basis_Blade; Bitmap : Unsigned_32) is begin if Bitmap < 32 then BB.Bitmap := Bitmap; else raise Blade_Exception with "Blade.Update_Blade invalid Bitmap."; end if; end Update_Blade; -- ------------------------------------------------------------------------ procedure Update_Blade (BB : in out Basis_Blade; Bitmap : Unsigned_32; Weight : Float) is begin if Bitmap < 32 then BB.Bitmap := Bitmap; BB.Weight := Weight; else raise Blade_Exception with "Blade.Update_Blade invalid Bitmap."; end if; end Update_Blade; -- ------------------------------------------------------------------------ function Weight (BB : Basis_Blade) return Float is begin return BB.Weight; end Weight; -- ------------------------------------------------------------------------ end Blade;
36.09543
128
0.493465
22d8e4bcaf979d7eb9d8cb22eaeddf15a3bc8424
1,713
ads
Ada
source/oasis/program-elements-real_range_specifications.ads
optikos/oasis
9f64d46d26d964790d69f9db681c874cfb3bf96d
[ "MIT" ]
null
null
null
source/oasis/program-elements-real_range_specifications.ads
optikos/oasis
9f64d46d26d964790d69f9db681c874cfb3bf96d
[ "MIT" ]
null
null
null
source/oasis/program-elements-real_range_specifications.ads
optikos/oasis
9f64d46d26d964790d69f9db681c874cfb3bf96d
[ "MIT" ]
2
2019-09-14T23:18:50.000Z
2019-10-02T10:11:40.000Z
-- Copyright (c) 2019 Maxim Reznik <[email protected]> -- -- SPDX-License-Identifier: MIT -- License-Filename: LICENSE ------------------------------------------------------------- with Program.Elements.Definitions; with Program.Lexical_Elements; with Program.Elements.Expressions; package Program.Elements.Real_Range_Specifications is pragma Pure (Program.Elements.Real_Range_Specifications); type Real_Range_Specification is limited interface and Program.Elements.Definitions.Definition; type Real_Range_Specification_Access is access all Real_Range_Specification'Class with Storage_Size => 0; not overriding function Lower_Bound (Self : Real_Range_Specification) return not null Program.Elements.Expressions.Expression_Access is abstract; not overriding function Upper_Bound (Self : Real_Range_Specification) return not null Program.Elements.Expressions.Expression_Access is abstract; type Real_Range_Specification_Text is limited interface; type Real_Range_Specification_Text_Access is access all Real_Range_Specification_Text'Class with Storage_Size => 0; not overriding function To_Real_Range_Specification_Text (Self : aliased in out Real_Range_Specification) return Real_Range_Specification_Text_Access is abstract; not overriding function Range_Token (Self : Real_Range_Specification_Text) return not null Program.Lexical_Elements.Lexical_Element_Access is abstract; not overriding function Double_Dot_Token (Self : Real_Range_Specification_Text) return not null Program.Lexical_Elements.Lexical_Element_Access is abstract; end Program.Elements.Real_Range_Specifications;
33.588235
75
0.767075
590117c39e063f565bdfe2435da9f165ad8a2cec
3,607
ads
Ada
tools/scitools/conf/understand/ada/ada95/s-fatgen.ads
brucegua/moocos
575c161cfa35e220f10d042e2e5ca18773691695
[ "Apache-2.0" ]
1
2020-01-20T21:26:46.000Z
2020-01-20T21:26:46.000Z
tools/scitools/conf/understand/ada/ada95/s-fatgen.ads
brucegua/moocos
575c161cfa35e220f10d042e2e5ca18773691695
[ "Apache-2.0" ]
null
null
null
tools/scitools/conf/understand/ada/ada95/s-fatgen.ads
brucegua/moocos
575c161cfa35e220f10d042e2e5ca18773691695
[ "Apache-2.0" ]
null
null
null
------------------------------------------------------------------------------ -- -- -- GNAT COMPILER COMPONENTS -- -- -- -- S Y S T E M . F A T _ G E N -- -- -- -- S p e c -- -- -- -- $Revision: 2 $ -- -- -- -- This specification comes from the Generic Primitive Functions standard. -- -- In accordance with the copyright of that document, you can freely copy -- -- and modify this specification, provided that if you do redistribute it, -- -- then any changes that you have made must be clearly indicated. -- -- -- ------------------------------------------------------------------------------ -- This generic package provides a target independent implementation of the -- floating-point attributes that denote functions. The implementations here -- are portable, but very slow. The runtime contains a set of instantiations -- of this package for all predefined floating-point types, and these should -- be replaced by efficient assembly language code where possible. generic type T is digits <>; package System.Fat_Gen is subtype UI is Integer; -- The runtime representation of universal integer for the purposes of -- this package is integer. The expander generates conversions for the -- actual type used. For functions returning universal integer, there -- is no problem, since the result always is in range of integer. For -- input arguments, the expander has to do some special casing to deal -- with the (very annoying!) cases of out of range values. If we used -- Long_Long_Integer to represent universal, then there would be no -- problem, but the resulting inefficiency would be annoying. function Adjacent (X, Towards : T) return T; function Ceiling (X : T) return T; function Compose (Fraction : T; Exponent : UI) return T; function Copy_Sign (Value, Sign : T) return T; function Exponent (X : T) return UI; function Floor (X : T) return T; function Fraction (X : T) return T; function Leading_Part (X : T; Radix_Digits : UI) return T; function Machine (X : T) return T; function Model (X : T) return T; function Pred (X : T) return T; function Remainder (X, Y : T) return T; function Rounding (X : T) return T; function Scaling (X : T; Adjustment : UI) return T; function Succ (X : T) return T; function Truncation (X : T) return T; function Unbiased_Rounding (X : T) return T; private pragma Inline (Machine); pragma Inline (Model); end System.Fat_Gen;
46.24359
78
0.447741
129bbf9c3dcd86369a97152ac945c7c8fc3eea09
667
adb
Ada
source/directories/machine-w64-mingw32/s-natcre.adb
ytomino/drake
4e4bdcd8b8e23a11a29b31d3a8861fdf60090ea2
[ "MIT" ]
33
2015-04-04T09:19:36.000Z
2021-11-10T05:33:34.000Z
source/directories/machine-w64-mingw32/s-natcre.adb
ytomino/drake
4e4bdcd8b8e23a11a29b31d3a8861fdf60090ea2
[ "MIT" ]
8
2017-11-14T13:05:07.000Z
2018-08-09T15:28:49.000Z
source/directories/machine-w64-mingw32/s-natcre.adb
ytomino/drake
4e4bdcd8b8e23a11a29b31d3a8861fdf60090ea2
[ "MIT" ]
9
2015-02-03T17:09:53.000Z
2021-11-12T01:16:05.000Z
with System.Zero_Terminated_WStrings; with C.winbase; with C.windef; with C.winnt; package body System.Native_Credentials is use type C.size_t; use type C.windef.WINBOOL; function User_Name return String is Result : aliased C.winnt.WCHAR_array (0 .. C.windef.MAX_PATH - 1); Length : aliased C.windef.DWORD := Result'Size; begin if C.winbase.GetUserName (Result (0)'Access, Length'Access) = C.windef.FALSE then raise Constraint_Error; -- ??? end if; return Zero_Terminated_WStrings.Value ( Result (0)'Access, C.size_t (Length) - 1); end User_Name; end System.Native_Credentials;
27.791667
72
0.668666
068ab88db44cc9ea35055c5a156ee63237b92c58
1,955
ads
Ada
src/ewok-sleep.ads
vdh-anssi/ewok-kernel
9a88dcae16659c212c4123b7a9272c9dfa51f85a
[ "Apache-2.0" ]
65
2018-09-26T09:10:11.000Z
2022-01-30T21:17:37.000Z
src/ewok-sleep.ads
vdh-anssi/ewok-kernel
9a88dcae16659c212c4123b7a9272c9dfa51f85a
[ "Apache-2.0" ]
22
2019-04-07T15:15:54.000Z
2020-10-15T12:45:54.000Z
src/ewok-sleep.ads
vdh-anssi/ewok-kernel
9a88dcae16659c212c4123b7a9272c9dfa51f85a
[ "Apache-2.0" ]
10
2018-09-27T09:43:08.000Z
2021-01-29T22:50:17.000Z
-- -- Copyright 2018 The wookey project team <[email protected]> -- - Ryad Benadjila -- - Arnauld Michelizza -- - Mathieu Renard -- - Philippe Thierry -- - Philippe Trebuchet -- -- 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. -- -- with config.applications; use config.applications; with ewok.exported.sleep; use ewok.exported.sleep; with ewok.tasks; with m4.systick; package ewok.sleep with spark_mode => on is awakening_time : array (t_real_task_id'range) of m4.systick.t_tick := (others => 0); -- Make the task sleeping and not executable for the given time. -- Only external events can awake the task during this period unless -- SLEEP_MODE_DEEP is selected. procedure sleeping (task_id : in t_real_task_id; ms : in milliseconds; mode : in t_sleep_mode) with global => (Output => awakening_time); -- For each task, check if it's sleeping time is over procedure check_is_awoke with global => (In_Out => (awakening_time, ewok.tasks.tasks_list)); -- Try to awake a task procedure try_waking_up (task_id : in t_real_task_id) with global => (In_Out => (awakening_time, ewok.tasks.tasks_list)); -- Check if a task is currently sleeping function is_sleeping (task_id : in t_real_task_id) return boolean with global => (Input => awakening_time); end ewok.sleep;
30.546875
79
0.678261
3dc74be1cdd77d4fb909752f427b7e0b4c8c6141
1,285
ads
Ada
source/machine-apple-darwin/s-sysall.ads
ytomino/drake
4e4bdcd8b8e23a11a29b31d3a8861fdf60090ea2
[ "MIT" ]
33
2015-04-04T09:19:36.000Z
2021-11-10T05:33:34.000Z
source/machine-apple-darwin/s-sysall.ads
ytomino/drake
4e4bdcd8b8e23a11a29b31d3a8861fdf60090ea2
[ "MIT" ]
8
2017-11-14T13:05:07.000Z
2018-08-09T15:28:49.000Z
source/machine-apple-darwin/s-sysall.ads
ytomino/drake
4e4bdcd8b8e23a11a29b31d3a8861fdf60090ea2
[ "MIT" ]
9
2015-02-03T17:09:53.000Z
2021-11-12T01:16:05.000Z
pragma License (Unrestricted); -- runtime unit specialized for POSIX (Darwin, FreeBSD, or Linux) with System.Storage_Elements; package System.System_Allocators is pragma Preelaborate; -- heap Minimum_System_Allocator_Alignment : constant := Standard'Address_Size / Standard'Storage_Unit; function Allocate ( Size : Storage_Elements.Storage_Count) return Address; -- Null_Address if it failed function Allocate ( Size : Storage_Elements.Storage_Count; Alignment : Storage_Elements.Storage_Count) return Address; procedure Free (Storage_Address : Address); function Reallocate ( Storage_Address : Address; Size : Storage_Elements.Storage_Count) return Address; -- Null_Address if it failed -- memory mapping function Page_Size return Storage_Elements.Storage_Count; function Map ( Storage_Address : Address; -- not fixed but hint Size : Storage_Elements.Storage_Count) return Address; -- Null_Address if it failed procedure Unmap ( Storage_Address : Address; Size : Storage_Elements.Storage_Count); -- Note: This package name comes from GNAT's implementation-defined -- attribute Standard'System_Allocator_Alignment. end System.System_Allocators;
29.883721
71
0.729183
c7ddfa541d8623b75f9e589032328de20c7a50d5
5,092
adb
Ada
tools-src/gnu/gcc/gcc/ada/a-tideio.adb
modern-tomato/tomato
96f09fab4929c6ddde5c9113f1b2476ad37133c4
[ "FSFAP" ]
80
2015-01-02T10:14:04.000Z
2021-06-07T06:29:49.000Z
tools-src/gnu/gcc/gcc/ada/a-tideio.adb
modern-tomato/tomato
96f09fab4929c6ddde5c9113f1b2476ad37133c4
[ "FSFAP" ]
9
2015-05-14T11:03:12.000Z
2018-01-04T07:12:58.000Z
tools-src/gnu/gcc/gcc/ada/a-tideio.adb
modern-tomato/tomato
96f09fab4929c6ddde5c9113f1b2476ad37133c4
[ "FSFAP" ]
69
2015-01-02T10:45:56.000Z
2021-09-06T07:52:13.000Z
------------------------------------------------------------------------------ -- -- -- GNAT RUNTIME COMPONENTS -- -- -- -- A D A . T E X T _ I O . D E C I M A L _ I O -- -- -- -- B o d y -- -- -- -- $Revision$ -- -- -- Copyright (C) 1992-1999 Free Software Foundation, Inc. -- -- -- -- GNAT 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. GNAT 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 GNAT; 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. -- -- -- -- GNAT was originally developed by the GNAT team at New York University. -- -- Extensive contributions were provided by Ada Core Technologies Inc. -- -- -- ------------------------------------------------------------------------------ with Ada.Text_IO.Decimal_Aux; package body Ada.Text_IO.Decimal_IO is package Aux renames Ada.Text_IO.Decimal_Aux; Scale : constant Integer := Num'Scale; --------- -- Get -- --------- procedure Get (File : in File_Type; Item : out Num; Width : in Field := 0) is pragma Unsuppress (Range_Check); begin if Num'Size > Integer'Size then Item := Num'Fixed_Value (Aux.Get_LLD (File, Width, Scale)); else Item := Num'Fixed_Value (Aux.Get_Dec (File, Width, Scale)); end if; exception when Constraint_Error => raise Data_Error; end Get; procedure Get (Item : out Num; Width : in Field := 0) is begin Get (Current_In, Item, Width); end Get; procedure Get (From : in String; Item : out Num; Last : out Positive) is pragma Unsuppress (Range_Check); begin if Num'Size > Integer'Size then Item := Num'Fixed_Value (Aux.Gets_LLD (From, Last'Unrestricted_Access, Scale)); else Item := Num'Fixed_Value (Aux.Gets_Dec (From, Last'Unrestricted_Access, Scale)); end if; exception when Constraint_Error => raise Data_Error; end Get; --------- -- Put -- --------- procedure Put (File : in File_Type; Item : in Num; Fore : in Field := Default_Fore; Aft : in Field := Default_Aft; Exp : in Field := Default_Exp) is begin if Num'Size > Integer'Size then Aux.Put_LLD (File, Long_Long_Integer'Integer_Value (Item), Fore, Aft, Exp, Scale); else Aux.Put_Dec (File, Integer'Integer_Value (Item), Fore, Aft, Exp, Scale); end if; end Put; procedure Put (Item : in Num; Fore : in Field := Default_Fore; Aft : in Field := Default_Aft; Exp : in Field := Default_Exp) is begin Put (Current_Out, Item, Fore, Aft, Exp); end Put; procedure Put (To : out String; Item : in Num; Aft : in Field := Default_Aft; Exp : in Field := Default_Exp) is begin if Num'Size > Integer'Size then Aux.Puts_LLD (To, Long_Long_Integer'Integer_Value (Item), Aft, Exp, Scale); else Aux.Puts_Dec (To, Integer'Integer_Value (Item), Aft, Exp, Scale); end if; end Put; end Ada.Text_IO.Decimal_IO;
35.608392
78
0.475059
c7a067c523f0cf5b5c985f6aaa883c0f14773cd1
2,758
adb
Ada
examples/MicroBit_v2/music/src/main.adb
BaderKashkash/Ada_Drivers_Library
027f0982c033a45a490b262080a9ede8c6adbc1c
[ "BSD-3-Clause" ]
1
2022-01-10T13:58:36.000Z
2022-01-10T13:58:36.000Z
examples/MicroBit_v2/music/src/main.adb
BaderKashkash/Ada_Drivers_Library
027f0982c033a45a490b262080a9ede8c6adbc1c
[ "BSD-3-Clause" ]
null
null
null
examples/MicroBit_v2/music/src/main.adb
BaderKashkash/Ada_Drivers_Library
027f0982c033a45a490b262080a9ede8c6adbc1c
[ "BSD-3-Clause" ]
null
null
null
------------------------------------------------------------------------------ -- -- -- Copyright (C) 2018, AdaCore -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions are -- -- met: -- -- 1. Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- 2. Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in -- -- the documentation and/or other materials provided with the -- -- distribution. -- -- 3. Neither the name of the copyright holder nor the names of its -- -- contributors may be used to endorse or promote products derived -- -- from this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -- -- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -- -- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -- -- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -- -- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -- -- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ with MicroBit.Music; use MicroBit.Music; procedure Main is My_Little_Melody : constant MicroBit.Music.Melody := ((C4, 400), (G3, 800), (B3, 400), (Rest, 400), (A3, 400), (G3, 400)); begin -- Play the little melody on the internal speaker MicroBit.Music.Play (27, My_Little_Melody); --note that this keeps on looping! end Main;
58.680851
83
0.517041
22492b2155e368176d7ea4f48618e03d1cf4b70b
1,854
ads
Ada
Hardware/ADS Gerbers/Oscar_Romeu_mmGerbers_wrk/workspace.ads
oscaromeu/FMCW-Radar
1e96d583ef888cb8a2172d1d68b78193596b1eff
[ "MIT" ]
null
null
null
Hardware/ADS Gerbers/Oscar_Romeu_mmGerbers_wrk/workspace.ads
oscaromeu/FMCW-Radar
1e96d583ef888cb8a2172d1d68b78193596b1eff
[ "MIT" ]
null
null
null
Hardware/ADS Gerbers/Oscar_Romeu_mmGerbers_wrk/workspace.ads
oscaromeu/FMCW-Radar
1e96d583ef888cb8a2172d1d68b78193596b1eff
[ "MIT" ]
null
null
null
<ADSWorkspace Revision="2" Version="100"> <Workspace Name=""> <Library Name="ads_standard_layers" /> <Library Name="adstechlib" /> <Library Name="ads_schematic_layers" /> <Library Name="empro_standard_layers" /> <Library Name="ads_standard_layers_ic" /> <Library Name="ads_schematic_layers_ic" /> <Library Name="ads_schematic_ports_ic" /> <Library Name="ads_rflib" /> <Library Name="ads_sources" /> <Library Name="ads_simulation" /> <Library Name="ads_tlines" /> <Library Name="ads_bondwires" /> <Library Name="ads_datacmps" /> <Library Name="ads_behavioral" /> <Library Name="ads_textfonts" /> <Library Name="ads_common_cmps" /> <Library Name="ads_designs" /> <Library Name="ads_verification_test_bench" /> <Library Name="Oscar_Romeu_mmGerbers_lib" /> <Cell Name="Oscar_Romeu_mmGerbers_lib:GainBlock" /> <Log Name="readgbr.log" /> <Log Name="search_history.log" /> <Log Name="writegbr.log" /> <Preferences Name="layout.prf" /> <Preferences Name="Oscar_Romeu_mmGerbers_lib_lay.prf" /> <Preferences Name="schematic.prf" /> <LibraryDefs Name="lib.defs" /> <ConfigFile Name="de_sim.cfg" /> <ConfigFile Name="hpeesofsim.cfg" /> <Layer_Preference Name="ads_standard_layers.layerprf" /> <Layer_Preference Name="Oscar_Romeu_mmGerbers_lib.layerprf" /> <Cell Name="Oscar_Romeu_mmGerbers_lib:PowerDivider" /> <Cell Name="Oscar_Romeu_mmGerbers_lib:PowerDividerOpen" /> <Cell Name="Oscar_Romeu_mmGerbers_lib:PowerDividerShort" /> <Cell Name="Oscar_Romeu_mmGerbers_lib:PowerDividerLoad" /> <Cell Name="Oscar_Romeu_mmGerbers_lib:RadarFMCW" /> </Workspace> </ADSWorkspace>
45.219512
70
0.642395
c7c17c243d147ecad09034da7faba25d2b0a96ae
18,268
ads
Ada
arch/ARM/STM32/svd/stm32wl5x_cm0/stm32_svd-hsem.ads
morbos/Ada_Drivers_Library
a4ab26799be60997c38735f4056160c4af597ef7
[ "BSD-3-Clause" ]
2
2018-05-16T03:56:39.000Z
2019-07-31T13:53:56.000Z
arch/ARM/STM32/svd/stm32wl5x_cm0/stm32_svd-hsem.ads
morbos/Ada_Drivers_Library
a4ab26799be60997c38735f4056160c4af597ef7
[ "BSD-3-Clause" ]
null
null
null
arch/ARM/STM32/svd/stm32wl5x_cm0/stm32_svd-hsem.ads
morbos/Ada_Drivers_Library
a4ab26799be60997c38735f4056160c4af597ef7
[ "BSD-3-Clause" ]
null
null
null
-- This spec has been automatically generated from STM32WL5x_CM0P.svd pragma Restrictions (No_Elaboration_Code); pragma Ada_2012; pragma Style_Checks (Off); with HAL; with System; package STM32_SVD.HSEM is pragma Preelaborate; --------------- -- Registers -- --------------- subtype HSEM_R_PROCID_Field is HAL.UInt8; subtype HSEM_R_COREID_Field is HAL.UInt4; -- HSEM register HSEM_R0 HSEM_R31 type HSEM_R_Register is record -- Semaphore ProcessID PROCID : HSEM_R_PROCID_Field := 16#0#; -- COREID COREID : HSEM_R_COREID_Field := 16#0#; -- unspecified Reserved_12_30 : HAL.UInt19 := 16#0#; -- Lock indication LOCK : Boolean := False; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for HSEM_R_Register use record PROCID at 0 range 0 .. 7; COREID at 0 range 8 .. 11; Reserved_12_30 at 0 range 12 .. 30; LOCK at 0 range 31 .. 31; end record; subtype HSEM_RLR_PROCID_Field is HAL.UInt8; subtype HSEM_RLR_COREID_Field is HAL.UInt4; -- HSEM Read lock register type HSEM_RLR_Register is record -- Read-only. Semaphore ProcessID PROCID : HSEM_RLR_PROCID_Field; -- Read-only. COREID COREID : HSEM_RLR_COREID_Field; -- unspecified Reserved_12_30 : HAL.UInt19; -- Read-only. Lock indication LOCK : Boolean; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for HSEM_RLR_Register use record PROCID at 0 range 0 .. 7; COREID at 0 range 8 .. 11; Reserved_12_30 at 0 range 12 .. 30; LOCK at 0 range 31 .. 31; end record; -- HSEM_C1IER_ISE array type HSEM_C1IER_ISE_Field_Array is array (0 .. 15) of Boolean with Component_Size => 1, Size => 16; -- Type definition for HSEM_C1IER_ISE type HSEM_C1IER_ISE_Field (As_Array : Boolean := False) is record case As_Array is when False => -- ISE as a value Val : HAL.UInt16; when True => -- ISE as an array Arr : HSEM_C1IER_ISE_Field_Array; end case; end record with Unchecked_Union, Size => 16; for HSEM_C1IER_ISE_Field use record Val at 0 range 0 .. 15; Arr at 0 range 0 .. 15; end record; -- HSEM Interrupt enable register type HSEM_C1IER_Register is record -- Interrupt semaphore n enable bit ISE : HSEM_C1IER_ISE_Field := (As_Array => False, Val => 16#0#); -- unspecified Reserved_16_31 : HAL.UInt16 := 16#0#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for HSEM_C1IER_Register use record ISE at 0 range 0 .. 15; Reserved_16_31 at 0 range 16 .. 31; end record; -- HSEM_C1ICR_ISC array type HSEM_C1ICR_ISC_Field_Array is array (0 .. 15) of Boolean with Component_Size => 1, Size => 16; -- Type definition for HSEM_C1ICR_ISC type HSEM_C1ICR_ISC_Field (As_Array : Boolean := False) is record case As_Array is when False => -- ISC as a value Val : HAL.UInt16; when True => -- ISC as an array Arr : HSEM_C1ICR_ISC_Field_Array; end case; end record with Unchecked_Union, Size => 16; for HSEM_C1ICR_ISC_Field use record Val at 0 range 0 .. 15; Arr at 0 range 0 .. 15; end record; -- HSEM Interrupt clear register type HSEM_C1ICR_Register is record -- Interrupt(N) semaphore n clear bit ISC : HSEM_C1ICR_ISC_Field := (As_Array => False, Val => 16#0#); -- unspecified Reserved_16_31 : HAL.UInt16 := 16#0#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for HSEM_C1ICR_Register use record ISC at 0 range 0 .. 15; Reserved_16_31 at 0 range 16 .. 31; end record; -- HSEM_C1ISR_ISF array type HSEM_C1ISR_ISF_Field_Array is array (0 .. 15) of Boolean with Component_Size => 1, Size => 16; -- Type definition for HSEM_C1ISR_ISF type HSEM_C1ISR_ISF_Field (As_Array : Boolean := False) is record case As_Array is when False => -- ISF as a value Val : HAL.UInt16; when True => -- ISF as an array Arr : HSEM_C1ISR_ISF_Field_Array; end case; end record with Unchecked_Union, Size => 16; for HSEM_C1ISR_ISF_Field use record Val at 0 range 0 .. 15; Arr at 0 range 0 .. 15; end record; -- HSEM Interrupt status register type HSEM_C1ISR_Register is record -- Read-only. Interrupt(N) semaphore n status bit before enable (mask) ISF : HSEM_C1ISR_ISF_Field; -- unspecified Reserved_16_31 : HAL.UInt16; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for HSEM_C1ISR_Register use record ISF at 0 range 0 .. 15; Reserved_16_31 at 0 range 16 .. 31; end record; -- HSEM_C1MISR_MISF array type HSEM_C1MISR_MISF_Field_Array is array (0 .. 15) of Boolean with Component_Size => 1, Size => 16; -- Type definition for HSEM_C1MISR_MISF type HSEM_C1MISR_MISF_Field (As_Array : Boolean := False) is record case As_Array is when False => -- MISF as a value Val : HAL.UInt16; when True => -- MISF as an array Arr : HSEM_C1MISR_MISF_Field_Array; end case; end record with Unchecked_Union, Size => 16; for HSEM_C1MISR_MISF_Field use record Val at 0 range 0 .. 15; Arr at 0 range 0 .. 15; end record; -- HSEM Masked interrupt status register type HSEM_C1MISR_Register is record -- Read-only. masked interrupt(N) semaphore n status bit after enable -- (mask) MISF : HSEM_C1MISR_MISF_Field; -- unspecified Reserved_16_31 : HAL.UInt16; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for HSEM_C1MISR_Register use record MISF at 0 range 0 .. 15; Reserved_16_31 at 0 range 16 .. 31; end record; -- HSEM_C2IER_ISE array type HSEM_C2IER_ISE_Field_Array is array (0 .. 15) of Boolean with Component_Size => 1, Size => 16; -- Type definition for HSEM_C2IER_ISE type HSEM_C2IER_ISE_Field (As_Array : Boolean := False) is record case As_Array is when False => -- ISE as a value Val : HAL.UInt16; when True => -- ISE as an array Arr : HSEM_C2IER_ISE_Field_Array; end case; end record with Unchecked_Union, Size => 16; for HSEM_C2IER_ISE_Field use record Val at 0 range 0 .. 15; Arr at 0 range 0 .. 15; end record; -- HSEM Interrupt enable register type HSEM_C2IER_Register is record -- Interrupt semaphore n enable bit ISE : HSEM_C2IER_ISE_Field := (As_Array => False, Val => 16#0#); -- unspecified Reserved_16_31 : HAL.UInt16 := 16#0#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for HSEM_C2IER_Register use record ISE at 0 range 0 .. 15; Reserved_16_31 at 0 range 16 .. 31; end record; -- HSEM_C2ICR_ISC array type HSEM_C2ICR_ISC_Field_Array is array (0 .. 15) of Boolean with Component_Size => 1, Size => 16; -- Type definition for HSEM_C2ICR_ISC type HSEM_C2ICR_ISC_Field (As_Array : Boolean := False) is record case As_Array is when False => -- ISC as a value Val : HAL.UInt16; when True => -- ISC as an array Arr : HSEM_C2ICR_ISC_Field_Array; end case; end record with Unchecked_Union, Size => 16; for HSEM_C2ICR_ISC_Field use record Val at 0 range 0 .. 15; Arr at 0 range 0 .. 15; end record; -- HSEM Interrupt clear register type HSEM_C2ICR_Register is record -- Read-only. Interrupt(N) semaphore n clear bit ISC : HSEM_C2ICR_ISC_Field; -- unspecified Reserved_16_31 : HAL.UInt16; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for HSEM_C2ICR_Register use record ISC at 0 range 0 .. 15; Reserved_16_31 at 0 range 16 .. 31; end record; -- HSEM_C2ISR_ISF array type HSEM_C2ISR_ISF_Field_Array is array (0 .. 15) of Boolean with Component_Size => 1, Size => 16; -- Type definition for HSEM_C2ISR_ISF type HSEM_C2ISR_ISF_Field (As_Array : Boolean := False) is record case As_Array is when False => -- ISF as a value Val : HAL.UInt16; when True => -- ISF as an array Arr : HSEM_C2ISR_ISF_Field_Array; end case; end record with Unchecked_Union, Size => 16; for HSEM_C2ISR_ISF_Field use record Val at 0 range 0 .. 15; Arr at 0 range 0 .. 15; end record; -- HSEM Interrupt status register type HSEM_C2ISR_Register is record -- Read-only. Interrupt(N) semaphore n status bit before enable (mask) ISF : HSEM_C2ISR_ISF_Field; -- unspecified Reserved_16_31 : HAL.UInt16; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for HSEM_C2ISR_Register use record ISF at 0 range 0 .. 15; Reserved_16_31 at 0 range 16 .. 31; end record; -- HSEM_C2MISR_MISF array type HSEM_C2MISR_MISF_Field_Array is array (0 .. 15) of Boolean with Component_Size => 1, Size => 16; -- Type definition for HSEM_C2MISR_MISF type HSEM_C2MISR_MISF_Field (As_Array : Boolean := False) is record case As_Array is when False => -- MISF as a value Val : HAL.UInt16; when True => -- MISF as an array Arr : HSEM_C2MISR_MISF_Field_Array; end case; end record with Unchecked_Union, Size => 16; for HSEM_C2MISR_MISF_Field use record Val at 0 range 0 .. 15; Arr at 0 range 0 .. 15; end record; -- HSEM Masked interrupt status register type HSEM_C2MISR_Register is record -- Read-only. masked interrupt(N) semaphore n status bit after enable -- (mask) MISF : HSEM_C2MISR_MISF_Field; -- unspecified Reserved_16_31 : HAL.UInt16; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for HSEM_C2MISR_Register use record MISF at 0 range 0 .. 15; Reserved_16_31 at 0 range 16 .. 31; end record; subtype HSEM_CR_COREID_Field is HAL.UInt4; subtype HSEM_CR_KEY_Field is HAL.UInt16; -- HSEM Clear register type HSEM_CR_Register is record -- unspecified Reserved_0_7 : HAL.UInt8 := 16#0#; -- Write-only. COREID COREID : HSEM_CR_COREID_Field := 16#0#; -- unspecified Reserved_12_15 : HAL.UInt4 := 16#0#; -- Write-only. Semaphore clear Key KEY : HSEM_CR_KEY_Field := 16#0#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for HSEM_CR_Register use record Reserved_0_7 at 0 range 0 .. 7; COREID at 0 range 8 .. 11; Reserved_12_15 at 0 range 12 .. 15; KEY at 0 range 16 .. 31; end record; subtype HSEM_KEYR_KEY_Field is HAL.UInt16; -- HSEM Interrupt clear register type HSEM_KEYR_Register is record -- unspecified Reserved_0_15 : HAL.UInt16 := 16#0#; -- Semaphore Clear Key KEY : HSEM_KEYR_KEY_Field := 16#0#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for HSEM_KEYR_Register use record Reserved_0_15 at 0 range 0 .. 15; KEY at 0 range 16 .. 31; end record; ----------------- -- Peripherals -- ----------------- -- Hardware semaphore type HSEM_Peripheral is record -- HSEM register HSEM_R0 HSEM_R31 HSEM_R0 : aliased HSEM_R_Register; -- HSEM register HSEM_R0 HSEM_R31 HSEM_R1 : aliased HSEM_R_Register; -- HSEM register HSEM_R0 HSEM_R31 HSEM_R2 : aliased HSEM_R_Register; -- HSEM register HSEM_R0 HSEM_R31 HSEM_R3 : aliased HSEM_R_Register; -- HSEM register HSEM_R0 HSEM_R31 HSEM_R4 : aliased HSEM_R_Register; -- HSEM register HSEM_R0 HSEM_R31 HSEM_R5 : aliased HSEM_R_Register; -- HSEM register HSEM_R0 HSEM_R31 HSEM_R6 : aliased HSEM_R_Register; -- HSEM register HSEM_R0 HSEM_R31 HSEM_R7 : aliased HSEM_R_Register; -- HSEM register HSEM_R0 HSEM_R31 HSEM_R8 : aliased HSEM_R_Register; -- HSEM register HSEM_R0 HSEM_R31 HSEM_R9 : aliased HSEM_R_Register; -- HSEM register HSEM_R0 HSEM_R31 HSEM_R10 : aliased HSEM_R_Register; -- HSEM register HSEM_R0 HSEM_R31 HSEM_R11 : aliased HSEM_R_Register; -- HSEM register HSEM_R0 HSEM_R31 HSEM_R12 : aliased HSEM_R_Register; -- HSEM register HSEM_R0 HSEM_R31 HSEM_R13 : aliased HSEM_R_Register; -- HSEM register HSEM_R0 HSEM_R31 HSEM_R14 : aliased HSEM_R_Register; -- HSEM register HSEM_R0 HSEM_R31 HSEM_R15 : aliased HSEM_R_Register; -- HSEM Read lock register HSEM_RLR0 : aliased HSEM_RLR_Register; -- HSEM Read lock register HSEM_RLR1 : aliased HSEM_RLR_Register; -- HSEM Read lock register HSEM_RLR2 : aliased HSEM_RLR_Register; -- HSEM Read lock register HSEM_RLR3 : aliased HSEM_RLR_Register; -- HSEM Read lock register HSEM_RLR4 : aliased HSEM_RLR_Register; -- HSEM Read lock register HSEM_RLR5 : aliased HSEM_RLR_Register; -- HSEM Read lock register HSEM_RLR6 : aliased HSEM_RLR_Register; -- HSEM Read lock register HSEM_RLR7 : aliased HSEM_RLR_Register; -- HSEM Read lock register HSEM_RLR8 : aliased HSEM_RLR_Register; -- HSEM Read lock register HSEM_RLR9 : aliased HSEM_RLR_Register; -- HSEM Read lock register HSEM_RLR10 : aliased HSEM_RLR_Register; -- HSEM Read lock register HSEM_RLR11 : aliased HSEM_RLR_Register; -- HSEM Read lock register HSEM_RLR12 : aliased HSEM_RLR_Register; -- HSEM Read lock register HSEM_RLR13 : aliased HSEM_RLR_Register; -- HSEM Read lock register HSEM_RLR14 : aliased HSEM_RLR_Register; -- HSEM Read lock register HSEM_RLR15 : aliased HSEM_RLR_Register; -- HSEM Interrupt enable register HSEM_C1IER : aliased HSEM_C1IER_Register; -- HSEM Interrupt clear register HSEM_C1ICR : aliased HSEM_C1ICR_Register; -- HSEM Interrupt status register HSEM_C1ISR : aliased HSEM_C1ISR_Register; -- HSEM Masked interrupt status register HSEM_C1MISR : aliased HSEM_C1MISR_Register; -- HSEM Interrupt enable register HSEM_C2IER : aliased HSEM_C2IER_Register; -- HSEM Interrupt clear register HSEM_C2ICR : aliased HSEM_C2ICR_Register; -- HSEM Interrupt status register HSEM_C2ISR : aliased HSEM_C2ISR_Register; -- HSEM Masked interrupt status register HSEM_C2MISR : aliased HSEM_C2MISR_Register; -- HSEM Clear register HSEM_CR : aliased HSEM_CR_Register; -- HSEM Interrupt clear register HSEM_KEYR : aliased HSEM_KEYR_Register; end record with Volatile; for HSEM_Peripheral use record HSEM_R0 at 16#0# range 0 .. 31; HSEM_R1 at 16#4# range 0 .. 31; HSEM_R2 at 16#8# range 0 .. 31; HSEM_R3 at 16#C# range 0 .. 31; HSEM_R4 at 16#10# range 0 .. 31; HSEM_R5 at 16#14# range 0 .. 31; HSEM_R6 at 16#18# range 0 .. 31; HSEM_R7 at 16#1C# range 0 .. 31; HSEM_R8 at 16#20# range 0 .. 31; HSEM_R9 at 16#24# range 0 .. 31; HSEM_R10 at 16#28# range 0 .. 31; HSEM_R11 at 16#2C# range 0 .. 31; HSEM_R12 at 16#30# range 0 .. 31; HSEM_R13 at 16#34# range 0 .. 31; HSEM_R14 at 16#38# range 0 .. 31; HSEM_R15 at 16#3C# range 0 .. 31; HSEM_RLR0 at 16#80# range 0 .. 31; HSEM_RLR1 at 16#84# range 0 .. 31; HSEM_RLR2 at 16#88# range 0 .. 31; HSEM_RLR3 at 16#8C# range 0 .. 31; HSEM_RLR4 at 16#90# range 0 .. 31; HSEM_RLR5 at 16#94# range 0 .. 31; HSEM_RLR6 at 16#98# range 0 .. 31; HSEM_RLR7 at 16#9C# range 0 .. 31; HSEM_RLR8 at 16#A0# range 0 .. 31; HSEM_RLR9 at 16#A4# range 0 .. 31; HSEM_RLR10 at 16#A8# range 0 .. 31; HSEM_RLR11 at 16#AC# range 0 .. 31; HSEM_RLR12 at 16#B0# range 0 .. 31; HSEM_RLR13 at 16#B4# range 0 .. 31; HSEM_RLR14 at 16#B8# range 0 .. 31; HSEM_RLR15 at 16#BC# range 0 .. 31; HSEM_C1IER at 16#100# range 0 .. 31; HSEM_C1ICR at 16#104# range 0 .. 31; HSEM_C1ISR at 16#108# range 0 .. 31; HSEM_C1MISR at 16#10C# range 0 .. 31; HSEM_C2IER at 16#110# range 0 .. 31; HSEM_C2ICR at 16#114# range 0 .. 31; HSEM_C2ISR at 16#118# range 0 .. 31; HSEM_C2MISR at 16#11C# range 0 .. 31; HSEM_CR at 16#140# range 0 .. 31; HSEM_KEYR at 16#144# range 0 .. 31; end record; -- Hardware semaphore HSEM_Periph : aliased HSEM_Peripheral with Import, Address => HSEM_Base; end STM32_SVD.HSEM;
32.275618
77
0.610247
1a245c2a3a39e346c2b0a00b25b65cd39eec8f31
1,076
adb
Ada
tests/syntax_examples/src/operator_subprogram_calls.adb
TNO/Dependency_Graph_Extractor-Ada
cfcc9132cf181e4db5139c14150f221efa69a6d6
[ "BSD-3-Clause" ]
1
2022-03-08T13:00:47.000Z
2022-03-08T13:00:47.000Z
src/tools/Dependency_Graph_Extractor/tests/Syntax_Examples/src/operator_subprogram_calls.adb
selroc/Renaissance-Ada
39230b34aced4a9d83831be346ca103136c53715
[ "BSD-3-Clause" ]
null
null
null
src/tools/Dependency_Graph_Extractor/tests/Syntax_Examples/src/operator_subprogram_calls.adb
selroc/Renaissance-Ada
39230b34aced4a9d83831be346ca103136c53715
[ "BSD-3-Clause" ]
null
null
null
package body Operator_Subprogram_Calls is type R is record I : Integer; end record; function "<"(P1 : R; P2 : R) return Boolean; procedure Test is R1 : R := (I => 42); R2 : R := (I => 42); function Foo(I1 : R; I2 : R) return Boolean renames "<"; begin if (R1 < R2) and Foo(R1, R2) then null; end if; end Test; function "<"(P1 : R; P2 : R) return Boolean is function Foo(I1 : Integer; I2 : Integer) return Boolean renames "<"; begin return Foo(P1.I, P2.I); end "<"; function "<="(P1 : R; P2 : R) return Boolean; procedure Test2 is R1 : R := (I => 42); R2 : R := (I => 42); function Foo(I1 : R; I2 : R) return Boolean renames "<="; begin if (R1 <= R2) and Foo(R1, R2) then null; end if; end Test2; function "<="(P1 : R; P2 : R) return Boolean is function Foo(I1 : Integer; I2 : Integer) return Boolean renames "<="; begin return Foo(P1.I, P2.I); end "<="; end Operator_Subprogram_Calls;
23.911111
75
0.524164
c798b5fb2f5f82ea8ea64301309b948591355d01
823
ads
Ada
firmware/coreboot/3rdparty/libgfxinit/common/hw-gfx-i2c.ads
fabiojna02/OpenCellular
45b6a202d6b2e2485c89955b9a6da920c4d56ddb
[ "CC-BY-4.0", "BSD-3-Clause" ]
1
2019-02-05T09:50:07.000Z
2019-02-05T09:50:07.000Z
firmware/coreboot/3rdparty/libgfxinit/common/hw-gfx-i2c.ads
aimin-wang/OpenCellular
5308146bf7edf43cc81c0e4d15305b711117070a
[ "CC-BY-4.0", "BSD-3-Clause" ]
13
2018-10-12T21:29:09.000Z
2018-10-25T20:06:51.000Z
firmware/coreboot/3rdparty/libgfxinit/common/hw-gfx-i2c.ads
aimin-wang/OpenCellular
5308146bf7edf43cc81c0e4d15305b711117070a
[ "CC-BY-4.0", "BSD-3-Clause" ]
null
null
null
-- -- Copyright (C) 2015 secunet Security Networks AG -- -- This program is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation; either version 2 of the License, or -- (at your option) any later version. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU General Public License for more details. -- package HW.GFX.I2C is type Transfer_Address is mod 2 ** 7; subtype Transfer_Length is Natural range 0 .. 128; subtype Transfer_Index is Natural range 0 .. Transfer_Length'Last - 1; subtype Transfer_Data is Buffer (Transfer_Index); end HW.GFX.I2C;
35.782609
73
0.747266
22bc466265643e61dab7415156fc1668fb6ce4cf
5,780
adb
Ada
3-mid/opengl/source/opengl.adb
charlie5/lace
e9b7dc751d500ff3f559617a6fc3089ace9dc134
[ "0BSD" ]
20
2015-11-04T09:23:59.000Z
2022-01-14T10:21:42.000Z
3-mid/opengl/source/opengl.adb
charlie5/lace
e9b7dc751d500ff3f559617a6fc3089ace9dc134
[ "0BSD" ]
2
2015-11-04T17:05:56.000Z
2015-12-08T03:16:13.000Z
3-mid/opengl/source/opengl.adb
charlie5/lace
e9b7dc751d500ff3f559617a6fc3089ace9dc134
[ "0BSD" ]
1
2015-12-07T12:53:52.000Z
2015-12-07T12:53:52.000Z
with ada.Strings.Hash, ada.unchecked_Conversion; package body openGL is ------------ -- Profiles -- function Profile return profile_Kind is separate; ----------- -- Vectors -- function Scaled (Self : in Vector_3; By : in Vector_3) return Vector_3 is begin return (Self (1) * By (1), Self (2) * By (2), Self (3) * By (3)); end Scaled; function Scaled (Self : in Vector_3_array; By : in Vector_3) return Vector_3_array is Result : Vector_3_array (Self'Range); begin for i in Result'Range loop Result (i) := Scaled (Self (i), By); end loop; return Result; end Scaled; function to_Vector_3_array (Self : Vector_2_array) return Vector_3_array is the_Array : Vector_3_array (1 .. Self'Length); begin for i in Self'Range loop the_Array (Index_t (i)) := Vector_3 (Self (i) & 0.0); end loop; return the_Array; end to_Vector_3_array; ---------- -- Colors -- function to_color_Value (Self : in unit_Interval) return color_Value is Value : constant Real := Real'Rounding (Self * 255.0); begin return color_Value (Value); end to_color_Value; function to_Real (Self : in color_Value) return unit_Interval is begin return Real (Self) / 255.0; end to_Real; function to_Color (R, G, B : in unit_Interval) return Color is begin return (to_color_Value (R), to_color_Value (G), to_color_Value (B)); end to_Color; ------------- -- Heightmap -- function Scaled (Self : in height_Map; By : in Real) return height_Map is begin return Result : height_Map := Self do scale (Result, By); end return; end scaled; procedure scale (Self : in out height_Map; By : in Real) is begin for Row in Self'Range (1) loop for Col in Self'Range (1) loop Self (Row, Col) := Self (Row, Col) * By; end loop; end loop; end scale; function height_Extent (Self : in height_Map) return Vector_2 is Min : Real := Real'Last; Max : Real := Real'First; begin for Row in Self'Range (1) loop for Col in Self'Range (2) loop Min := Real'Min (Min, Self (Row, Col)); Max := Real'Max (Max, Self (Row, Col)); end loop; end loop; return (Min, Max); end height_Extent; function Region (Self : in height_Map; Rows, Cols : in index_Pair) return height_Map is Width : constant Index_t := Index_t (Rows (2) - Rows (1)); Height : constant Index_t := Index_t (Cols (2) - Cols (1)); the_Region : openGL.height_Map (1 .. Width + 1, 1 .. Height + 1); begin for Row in the_Region'Range (1) loop for Col in the_Region'Range (2) loop the_Region (Row, Col) := Self (Row + Rows (1) - 1, Col + Cols (1) - 1); end loop; end loop; return the_Region; end Region; ---------- -- Assets -- function to_Asset (Self : in String) return asset_Name is the_Name : String (asset_Name'Range); begin the_Name (1 .. Self'Length) := Self; the_Name (Self'Length + 1 .. the_Name'Last) := (others => ' '); return asset_Name (the_Name); end to_Asset; function to_String (Self : in asset_Name) return String is begin for Each in reverse Self'Range loop if Self (Each) /= ' ' then return String (Self (1 .. Each)); end if; end loop; return ""; end to_String; function Hash (Self : in asset_Name) return ada.Containers.Hash_type is begin return ada.Strings.Hash (to_String (Self)); end Hash; --------- -- Bounds -- function bounding_Box_of (Self : Sites) return Bounds is Result : Bounds := null_Bounds; begin for Each in Self'Range loop Result.Box.Lower (1) := Real'Min (Result.Box.Lower (1), Self (Each)(1)); Result.Box.Lower (2) := Real'Min (Result.Box.Lower (2), Self (Each)(2)); Result.Box.Lower (3) := Real'Min (Result.Box.Lower (3), Self (Each)(3)); Result.Box.Upper (1) := Real'Max (Result.Box.Upper (1), Self (Each)(1)); Result.Box.Upper (2) := Real'Max (Result.Box.Upper (2), Self (Each)(2)); Result.Box.Upper (3) := Real'Max (Result.Box.Upper (3), Self (Each)(3)); Result.Ball := Real'Max (Result.Ball, abs Self (Each)); end loop; return Result; end bounding_Box_of; procedure set_Ball_from_Box (Self : in out Bounds) is begin Self.Ball := Real'Max (abs Self.Box.Lower, abs Self.Box.Upper); end set_Ball_from_Box; --------- -- Images -- function to_Image (From : in lucid_Image) return Image is the_Image : Image (From'Range (1), From'Range (2)); begin for Row in From'Range (1) loop for Col in From'Range (2) loop the_Image (Row, Col) := From (Row, Col).Primary; end loop; end loop; return the_Image; end to_Image; ------------ -- safe_Real -- protected body safe_Real is procedure Value_is (Now : in Real) is begin the_Value := Now; end Value_is; function Value return Real is begin return the_Value; end Value; end safe_Real; end openGL;
21.328413
89
0.537543
41768d142a612365cd08bdcfdeb6d30e2cb9b736
1,402
ads
Ada
tier-1/xcb/source/thin/xcb-xcb_alloc_named_color_cookie_t.ads
charlie5/cBound
741be08197a61ad9c72553e3302f3b669902216d
[ "0BSD" ]
2
2015-11-12T11:16:20.000Z
2021-08-24T22:32:04.000Z
tier-1/xcb/source/thin/xcb-xcb_alloc_named_color_cookie_t.ads
charlie5/cBound
741be08197a61ad9c72553e3302f3b669902216d
[ "0BSD" ]
1
2018-06-05T05:19:35.000Z
2021-11-20T01:13:23.000Z
tier-1/xcb/source/thin/xcb-xcb_alloc_named_color_cookie_t.ads
charlie5/cBound
741be08197a61ad9c72553e3302f3b669902216d
[ "0BSD" ]
null
null
null
-- This file is generated by SWIG. Please do not modify by hand. -- with Interfaces.C; with Interfaces.C; with Interfaces.C.Pointers; package xcb.xcb_alloc_named_color_cookie_t is -- Item -- type Item is record sequence : aliased Interfaces.C.unsigned; end record; -- Item_Array -- type Item_Array is array (Interfaces.C .size_t range <>) of aliased xcb.xcb_alloc_named_color_cookie_t .Item; -- Pointer -- package C_Pointers is new Interfaces.C.Pointers (Index => Interfaces.C.size_t, Element => xcb.xcb_alloc_named_color_cookie_t.Item, Element_Array => xcb.xcb_alloc_named_color_cookie_t.Item_Array, Default_Terminator => (others => <>)); subtype Pointer is C_Pointers.Pointer; -- Pointer_Array -- type Pointer_Array is array (Interfaces.C .size_t range <>) of aliased xcb.xcb_alloc_named_color_cookie_t .Pointer; -- Pointer_Pointer -- package C_Pointer_Pointers is new Interfaces.C.Pointers (Index => Interfaces.C.size_t, Element => xcb.xcb_alloc_named_color_cookie_t.Pointer, Element_Array => xcb.xcb_alloc_named_color_cookie_t.Pointer_Array, Default_Terminator => null); subtype Pointer_Pointer is C_Pointer_Pointers.Pointer; end xcb.xcb_alloc_named_color_cookie_t;
26.45283
77
0.669757
57e4cb89fa33bfb18dd2e1449cc689e5a1cdcfd7
4,210
ada
Ada
gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/ce/ce2111e.ada
best08618/asylo
5a520a9f5c461ede0f32acc284017b737a43898c
[ "Apache-2.0" ]
7
2020-05-02T17:34:05.000Z
2021-10-17T10:15:18.000Z
gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/ce/ce2111e.ada
best08618/asylo
5a520a9f5c461ede0f32acc284017b737a43898c
[ "Apache-2.0" ]
null
null
null
gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/ce/ce2111e.ada
best08618/asylo
5a520a9f5c461ede0f32acc284017b737a43898c
[ "Apache-2.0" ]
2
2020-07-27T00:22:36.000Z
2021-04-01T09:41:02.000Z
-- CE2111E.ADA -- Grant of Unlimited Rights -- -- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687, -- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained -- unlimited rights in the software and documentation contained herein. -- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making -- this public release, the Government intends to confer upon all -- recipients unlimited rights equal to those held by the Government. -- These rights include rights to use, duplicate, release or disclose the -- released technical data and computer software in whole or in part, in -- any manner and for any purpose whatsoever, and to have or permit others -- to do so. -- -- DISCLAIMER -- -- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR -- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED -- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE -- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE -- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A -- PARTICULAR PURPOSE OF SAID MATERIAL. --* -- OBJECTIVE: -- CHECK THAT THE FILE REMAINS OPEN AFTER A RESET. -- THIS OBJECTIVE IS BEING INTERPRETED AS : CHECK THAT A FILE -- REMAINS OPEN AFTER AN ATTEMPT TO RESET. -- APPLICABILITY CRITERIA: -- THIS TEST IS APPLICABLE ONLY TO IMPLEMENTATIONS WHICH SUPPORT -- DIRECT FILES. -- HISTORY: -- DLD 08/13/82 -- SPS 11/09/82 -- JBG 03/24/83 -- EG 05/28/85 -- JLH 07/23/87 REWROTE TEST ALGORITHM. WITH REPORT; USE REPORT; WITH DIRECT_IO; PROCEDURE CE2111E IS PACKAGE DIR_IO IS NEW DIRECT_IO (INTEGER); USE DIR_IO; DIR_FILE : DIR_IO.FILE_TYPE; VAR1 : INTEGER := 5; INCOMPLETE : EXCEPTION; BEGIN TEST ("CE2111E", "CHECK THAT THE FILE REMAINS OPEN AFTER A RESET"); -- CREATE DIRECT TEST FILE BEGIN CREATE (DIR_FILE, OUT_FILE, LEGAL_FILE_NAME); WRITE (DIR_FILE, VAR1); CLOSE (DIR_FILE); EXCEPTION WHEN USE_ERROR | NAME_ERROR => NOT_APPLICABLE ("DIRECT FILES NOT SUPPORTED"); RAISE INCOMPLETE; END; -- OPEN FILE BEGIN OPEN (DIR_FILE, IN_FILE, LEGAL_FILE_NAME); EXCEPTION WHEN USE_ERROR => NOT_APPLICABLE ("OPEN WITH IN_FILE MODE NOT SUPPORTED " & "FOR DIR_IO"); RAISE INCOMPLETE; END; -- RESET FILE BEGIN RESET (DIR_FILE); EXCEPTION WHEN USE_ERROR => NULL; END; IF IS_OPEN (DIR_FILE) THEN CLOSE (DIR_FILE); ELSE FAILED ("RESET FOR IN_FILE, CLOSED FILE"); END IF; -- RE-OPEN AS OUT_FILE AND REPEAT TEST BEGIN OPEN (DIR_FILE, OUT_FILE, LEGAL_FILE_NAME); EXCEPTION WHEN USE_ERROR => NOT_APPLICABLE ("OPEN WITH OUT_FILE MODE NOT " & "SUPPORTED FOR DIR_IO"); RAISE INCOMPLETE; END; BEGIN RESET (DIR_FILE); EXCEPTION WHEN USE_ERROR => NULL; END; IF IS_OPEN (DIR_FILE) THEN CLOSE (DIR_FILE); ELSE FAILED ("RESET FOR OUT_FILE, CLOSED FILE"); END IF; -- RE-OPEN AS IN_OUT FILE AND REPEAT TEST BEGIN OPEN (DIR_FILE, INOUT_FILE, LEGAL_FILE_NAME); EXCEPTION WHEN USE_ERROR => NOT_APPLICABLE ("OPEN WITH IN_OUT FILE MODE NOT " & "SUPPORTED FOR DIR_IO"); RAISE INCOMPLETE; END; BEGIN RESET (DIR_FILE); EXCEPTION WHEN USE_ERROR => NULL; END; IF IS_OPEN (DIR_FILE) THEN BEGIN DELETE (DIR_FILE); EXCEPTION WHEN USE_ERROR => NULL; END; ELSE FAILED ("RESET FOR INOUT_FILE, CLOSED FILE"); END IF; RESULT; EXCEPTION WHEN INCOMPLETE => RESULT; END CE2111E;
26.815287
79
0.580998
58f0314025339b9216af57dc4468c76a95ead16c
933
adb
Ada
src/gdb/gdb-8.3/gdb/testsuite/gdb.ada/mi_ref_changeable/pck.adb
alrooney/unum-sdk
bbccb10b0cd3500feccbbef22e27ea111c3d18eb
[ "Apache-2.0" ]
31
2018-08-01T21:25:24.000Z
2022-02-14T07:52:34.000Z
src/gdb/gdb-8.3/gdb/testsuite/gdb.ada/mi_ref_changeable/pck.adb
alrooney/unum-sdk
bbccb10b0cd3500feccbbef22e27ea111c3d18eb
[ "Apache-2.0" ]
40
2018-12-03T19:48:52.000Z
2021-03-10T06:34:26.000Z
src/gdb/gdb-8.3/gdb/testsuite/gdb.ada/mi_ref_changeable/pck.adb
alrooney/unum-sdk
bbccb10b0cd3500feccbbef22e27ea111c3d18eb
[ "Apache-2.0" ]
20
2018-11-16T21:19:22.000Z
2021-10-18T23:08:24.000Z
-- Copyright 2018-2019 Free Software Foundation, Inc. -- -- This program is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation; either version 3 of the License, or -- (at your option) any later version. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT 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 -- along with this program. If not, see <http://www.gnu.org/licenses/>. package body Pck is procedure Do_Nothing (A : System.Address) is begin null; end Do_Nothing; function Get_Name return String is begin return "Some kind of string"; end Get_Name; end Pck;
34.555556
73
0.723473
c7cd37ec225e877527d8e609edcb8e642b35dd5f
2,220
ads
Ada
resources/scripts/api/github.ads
mehrdad-shokri/amass
bf4df987c63d0509bf3e94cba2e4448855fc0805
[ "Apache-2.0" ]
1
2021-03-27T09:57:11.000Z
2021-03-27T09:57:11.000Z
resources/scripts/api/github.ads
rishuranjanofficial/Amass
a7e3d07febafae6220032121a1b1c4f508e16ec0
[ "Apache-2.0" ]
null
null
null
resources/scripts/api/github.ads
rishuranjanofficial/Amass
a7e3d07febafae6220032121a1b1c4f508e16ec0
[ "Apache-2.0" ]
null
null
null
-- Copyright 2017 Jeff Foley. All rights reserved. -- Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file. local json = require("json") name = "GitHub" type = "api" function start() setratelimit(7) end function vertical(ctx, domain) if (api == nil or api.key == nil or api.key == "") then return end for i=1,100 do local resp local vurl = buildurl(domain, i) -- Check if the response data is in the graph database if (api.ttl ~= nil and api.ttl > 0) then resp = obtain_response(vurl, api.ttl) end if (resp == nil or resp == "") then local err resp, err = request({ url=vurl, headers={ ['Authorization']="token " .. api.key, ['Content-Type']="application/json", }, }) if (err ~= nil and err ~= "") then return end if (api.ttl ~= nil and api.ttl > 0) then cache_response(vurl, resp) end end local d = json.decode(resp) if (d == nil or d['total_count'] == 0 or #(d.items) == 0) then return end for i, item in pairs(d.items) do search_item(ctx, item) end active(ctx) checkratelimit() end end function search_item(ctx, item) local info, err = request({ url=item.url, headers={['Content-Type']="application/json"}, }) if (err ~= nil and err ~= "") then return end local data = json.decode(info) if (data == nil or data['download_url'] == nil) then return end local content, err = request({url=data['download_url']}) if err == nil then sendnames(ctx, content) end end function buildurl(domain, pagenum) return "https://api.github.com/search/code?q=\"" .. domain .. "\"&page=" .. pagenum .. "&per_page=100" end function sendnames(ctx, content) local names = find(content, subdomainre) if names == nil then return end for i, v in pairs(names) do newname(ctx, v) end end
23.870968
106
0.531081
1a5cd12a7fe100b365892be843969604c065abbe
1,262
ads
Ada
tests/src/sha2_streams_tests.ads
AntonMeep/sha2
73c2cd73e440b1e36d1b5c8b741fcb0e3fc4046c
[ "0BSD" ]
null
null
null
tests/src/sha2_streams_tests.ads
AntonMeep/sha2
73c2cd73e440b1e36d1b5c8b741fcb0e3fc4046c
[ "0BSD" ]
null
null
null
tests/src/sha2_streams_tests.ads
AntonMeep/sha2
73c2cd73e440b1e36d1b5c8b741fcb0e3fc4046c
[ "0BSD" ]
null
null
null
with AUnit.Test_Fixtures; with AUnit.Test_Suites; package SHA2_Streams_Tests is function Suite return AUnit.Test_Suites.Access_Test_Suite; private type Fixture is new AUnit.Test_Fixtures.Test_Fixture with null record; procedure SHA2_224_Test (Object : in out Fixture); procedure SHA2_224_One_Million_Test (Object : in out Fixture); procedure SHA2_224_Extremely_Long_Test (Object : in out Fixture); procedure SHA2_256_Test (Object : in out Fixture); procedure SHA2_256_One_Million_Test (Object : in out Fixture); procedure SHA2_256_Extremely_Long_Test (Object : in out Fixture); procedure SHA2_384_Test (Object : in out Fixture); procedure SHA2_384_One_Million_Test (Object : in out Fixture); procedure SHA2_384_Extremely_Long_Test (Object : in out Fixture); procedure SHA2_512_Test (Object : in out Fixture); procedure SHA2_512_One_Million_Test (Object : in out Fixture); procedure SHA2_512_Extremely_Long_Test (Object : in out Fixture); procedure SHA2_512_224_Test (Object : in out Fixture); procedure SHA2_512_224_One_Million_Test (Object : in out Fixture); procedure SHA2_512_256_Test (Object : in out Fixture); procedure SHA2_512_256_One_Million_Test (Object : in out Fixture); end SHA2_Streams_Tests;
48.538462
73
0.790016
c7ac84dd790774ab6103cd313834898e69ceea85
793
ads
Ada
Read Only/gdb-7.12.1/gdb/testsuite/gdb.ada/str_ref_cmp/pck.ads
samyvic/OS-Project
1622bc1641876584964effd91d65ef02e92728e1
[ "Apache-2.0" ]
null
null
null
Read Only/gdb-7.12.1/gdb/testsuite/gdb.ada/str_ref_cmp/pck.ads
samyvic/OS-Project
1622bc1641876584964effd91d65ef02e92728e1
[ "Apache-2.0" ]
null
null
null
Read Only/gdb-7.12.1/gdb/testsuite/gdb.ada/str_ref_cmp/pck.ads
samyvic/OS-Project
1622bc1641876584964effd91d65ef02e92728e1
[ "Apache-2.0" ]
null
null
null
-- Copyright 2008-2017 Free Software Foundation, Inc. -- -- This program is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation; either version 3 of the License, or -- (at your option) any later version. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT 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 -- along with this program. If not, see <http://www.gnu.org/licenses/>. package Pck is String_Var : String := "Hello from package Pck"; end Pck;
37.761905
73
0.732661
5742129fbec318cd1ca5b125f8f0ff932b75b428
3,685
adb
Ada
regtests/el-beans-tests.adb
jquorning/ada-el
b0b07da093ac6109286404cb54a62a9a93816610
[ "Apache-2.0" ]
6
2015-01-18T23:04:00.000Z
2022-01-26T12:34:07.000Z
regtests/el-beans-tests.adb
jquorning/ada-el
b0b07da093ac6109286404cb54a62a9a93816610
[ "Apache-2.0" ]
1
2022-01-30T20:46:16.000Z
2022-01-30T20:46:16.000Z
regtests/el-beans-tests.adb
jquorning/ada-el
b0b07da093ac6109286404cb54a62a9a93816610
[ "Apache-2.0" ]
2
2021-01-06T08:27:49.000Z
2022-01-30T19:33:41.000Z
----------------------------------------------------------------------- -- EL.Beans.Tests - Testsuite for EL.Beans -- Copyright (C) 2011, 2018 Stephane Carrez -- Written by Stephane Carrez ([email protected]) -- -- 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. ----------------------------------------------------------------------- with Util.Test_Caller; with Test_Bean; with Util.Beans.Objects; with EL.Contexts.Default; package body EL.Beans.Tests is use Util.Tests; use Test_Bean; package Caller is new Util.Test_Caller (Test, "EL.Beans"); procedure Add_Tests (Suite : in Util.Tests.Access_Test_Suite) is begin Caller.Add_Test (Suite, "Test EL.Beans.Add_Parameter", Test_Add_Parameter'Access); Caller.Add_Test (Suite, "Test EL.Beans.Initialize", Test_Initialize'Access); end Add_Tests; -- ------------------------------ -- Test Add_Parameter -- ------------------------------ procedure Test_Add_Parameter (T : in out Test) is P : Param_Vectors.Vector; Context : EL.Contexts.Default.Default_Context; begin -- Add a constant parameter. Add_Parameter (Container => P, Name => "firstName", Value => "my name", Context => Context); Assert_Equals (T, 1, Integer (P.Length), "Parameter was not added"); T.Assert_Equals ("firstName", P.Element (1).Name, "Invalid parameter name"); T.Assert (P.Element (1).Value.Is_Constant, "Value should be a constant"); T.Assert_Equals ("my name", Util.Beans.Objects.To_String (P.Element (1).Value.Get_Value (Context)), "Invalid value"); -- Add an expression parameter. Add_Parameter (Container => P, Name => "lastName", Value => "#{name}", Context => Context); Assert_Equals (T, 2, Integer (P.Length), "Parameter was not added"); end Test_Add_Parameter; -- ------------------------------ -- Test the Initialize procedure with a set of expressions -- ------------------------------ procedure Test_Initialize (T : in out Test) is P : Param_Vectors.Vector; Context : EL.Contexts.Default.Default_Context; User : Person_Access := Create_Person ("Joe", "Black", 42); Bean : Person_Access := Create_Person ("", "", 0); begin Context.Set_Variable ("user", User); Add_Parameter (P, "firstName", "#{user.firstName}", Context); Add_Parameter (P, "lastName", "#{user.lastName}", Context); Add_Parameter (P, "age", "#{user.age + 2}", Context); Initialize (Bean.all, P, Context); T.Assert_Equals ("Joe", Bean.First_Name, "First name not initialized"); T.Assert_Equals ("Black", Bean.Last_Name, "Last name not initialized"); Assert_Equals (T, 44, Integer (Bean.Age), "Age was not initialized"); Free (Bean); Free (User); end Test_Initialize; end EL.Beans.Tests;
41.404494
95
0.564722
c7d07db4034962402c41ec4823945cbcb0ceaf0a
4,733
ads
Ada
source/amf/utp/amf-utp-suts-collections.ads
svn2github/matreshka
9d222b3ad9da508855fb1f5adbe5e8a4fad4c530
[ "BSD-3-Clause" ]
24
2016-11-29T06:59:41.000Z
2021-08-30T11:55:16.000Z
source/amf/utp/amf-utp-suts-collections.ads
svn2github/matreshka
9d222b3ad9da508855fb1f5adbe5e8a4fad4c530
[ "BSD-3-Clause" ]
2
2019-01-16T05:15:20.000Z
2019-02-03T10:03:32.000Z
source/amf/utp/amf-utp-suts-collections.ads
svn2github/matreshka
9d222b3ad9da508855fb1f5adbe5e8a4fad4c530
[ "BSD-3-Clause" ]
4
2017-07-18T07:11:05.000Z
2020-06-21T03:02:25.000Z
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Ada Modeling Framework -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2012, Vadim Godunko <[email protected]> -- -- All rights reserved. -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions -- -- are met: -- -- -- -- * Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- -- -- * Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in the -- -- documentation and/or other materials provided with the distribution. -- -- -- -- * Neither the name of the Vadim Godunko, IE nor the names of its -- -- contributors may be used to endorse or promote products derived from -- -- this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -- -- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -- -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -- -- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -- -- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ -- $Revision$ $Date$ ------------------------------------------------------------------------------ -- This file is generated, don't edit it. ------------------------------------------------------------------------------ with AMF.Generic_Collections; package AMF.Utp.SUTs.Collections is pragma Preelaborate; package Utp_SUT_Collections is new AMF.Generic_Collections (Utp_SUT, Utp_SUT_Access); type Set_Of_Utp_SUT is new Utp_SUT_Collections.Set with null record; Empty_Set_Of_Utp_SUT : constant Set_Of_Utp_SUT; type Ordered_Set_Of_Utp_SUT is new Utp_SUT_Collections.Ordered_Set with null record; Empty_Ordered_Set_Of_Utp_SUT : constant Ordered_Set_Of_Utp_SUT; type Bag_Of_Utp_SUT is new Utp_SUT_Collections.Bag with null record; Empty_Bag_Of_Utp_SUT : constant Bag_Of_Utp_SUT; type Sequence_Of_Utp_SUT is new Utp_SUT_Collections.Sequence with null record; Empty_Sequence_Of_Utp_SUT : constant Sequence_Of_Utp_SUT; private Empty_Set_Of_Utp_SUT : constant Set_Of_Utp_SUT := (Utp_SUT_Collections.Set with null record); Empty_Ordered_Set_Of_Utp_SUT : constant Ordered_Set_Of_Utp_SUT := (Utp_SUT_Collections.Ordered_Set with null record); Empty_Bag_Of_Utp_SUT : constant Bag_Of_Utp_SUT := (Utp_SUT_Collections.Bag with null record); Empty_Sequence_Of_Utp_SUT : constant Sequence_Of_Utp_SUT := (Utp_SUT_Collections.Sequence with null record); end AMF.Utp.SUTs.Collections;
51.445652
78
0.488063
c7d905e658c524bb88cda0452b9b1d3eac68cf8b
3,436
adb
Ada
source/nodes/program-nodes-null_components.adb
optikos/oasis
9f64d46d26d964790d69f9db681c874cfb3bf96d
[ "MIT" ]
null
null
null
source/nodes/program-nodes-null_components.adb
optikos/oasis
9f64d46d26d964790d69f9db681c874cfb3bf96d
[ "MIT" ]
null
null
null
source/nodes/program-nodes-null_components.adb
optikos/oasis
9f64d46d26d964790d69f9db681c874cfb3bf96d
[ "MIT" ]
2
2019-09-14T23:18:50.000Z
2019-10-02T10:11:40.000Z
-- Copyright (c) 2019 Maxim Reznik <[email protected]> -- -- SPDX-License-Identifier: MIT -- License-Filename: LICENSE ------------------------------------------------------------- package body Program.Nodes.Null_Components is function Create (Null_Token : not null Program.Lexical_Elements .Lexical_Element_Access; Semicolon_Token : not null Program.Lexical_Elements .Lexical_Element_Access) return Null_Component is begin return Result : Null_Component := (Null_Token => Null_Token, Semicolon_Token => Semicolon_Token, Enclosing_Element => null) do Initialize (Result); end return; end Create; function Create (Is_Part_Of_Implicit : Boolean := False; Is_Part_Of_Inherited : Boolean := False; Is_Part_Of_Instance : Boolean := False) return Implicit_Null_Component is begin return Result : Implicit_Null_Component := (Is_Part_Of_Implicit => Is_Part_Of_Implicit, Is_Part_Of_Inherited => Is_Part_Of_Inherited, Is_Part_Of_Instance => Is_Part_Of_Instance, Enclosing_Element => null) do Initialize (Result); end return; end Create; overriding function Null_Token (Self : Null_Component) return not null Program.Lexical_Elements.Lexical_Element_Access is begin return Self.Null_Token; end Null_Token; overriding function Semicolon_Token (Self : Null_Component) return not null Program.Lexical_Elements.Lexical_Element_Access is begin return Self.Semicolon_Token; end Semicolon_Token; overriding function Is_Part_Of_Implicit (Self : Implicit_Null_Component) return Boolean is begin return Self.Is_Part_Of_Implicit; end Is_Part_Of_Implicit; overriding function Is_Part_Of_Inherited (Self : Implicit_Null_Component) return Boolean is begin return Self.Is_Part_Of_Inherited; end Is_Part_Of_Inherited; overriding function Is_Part_Of_Instance (Self : Implicit_Null_Component) return Boolean is begin return Self.Is_Part_Of_Instance; end Is_Part_Of_Instance; procedure Initialize (Self : aliased in out Base_Null_Component'Class) is begin null; end Initialize; overriding function Is_Null_Component_Element (Self : Base_Null_Component) return Boolean is pragma Unreferenced (Self); begin return True; end Is_Null_Component_Element; overriding function Is_Definition_Element (Self : Base_Null_Component) return Boolean is pragma Unreferenced (Self); begin return True; end Is_Definition_Element; overriding procedure Visit (Self : not null access Base_Null_Component; Visitor : in out Program.Element_Visitors.Element_Visitor'Class) is begin Visitor.Null_Component (Self); end Visit; overriding function To_Null_Component_Text (Self : aliased in out Null_Component) return Program.Elements.Null_Components.Null_Component_Text_Access is begin return Self'Unchecked_Access; end To_Null_Component_Text; overriding function To_Null_Component_Text (Self : aliased in out Implicit_Null_Component) return Program.Elements.Null_Components.Null_Component_Text_Access is pragma Unreferenced (Self); begin return null; end To_Null_Component_Text; end Program.Nodes.Null_Components;
29.118644
79
0.710128
c71b4bf23db83d11c6b1c314f03f7241b3593ef8
5,362
adb
Ada
Validation/pyFrame3DD-master/gcc-master/gcc/ada/libgnat/a-tiinio.adb
djamal2727/Main-Bearing-Analytical-Model
2f00c2219c71be0175c6f4f8f1d4cca231d97096
[ "Apache-2.0" ]
null
null
null
Validation/pyFrame3DD-master/gcc-master/gcc/ada/libgnat/a-tiinio.adb
djamal2727/Main-Bearing-Analytical-Model
2f00c2219c71be0175c6f4f8f1d4cca231d97096
[ "Apache-2.0" ]
null
null
null
Validation/pyFrame3DD-master/gcc-master/gcc/ada/libgnat/a-tiinio.adb
djamal2727/Main-Bearing-Analytical-Model
2f00c2219c71be0175c6f4f8f1d4cca231d97096
[ "Apache-2.0" ]
null
null
null
------------------------------------------------------------------------------ -- -- -- GNAT RUN-TIME COMPONENTS -- -- -- -- A D A . T E X T _ I O . I N T E G E R _ I O -- -- -- -- B o d y -- -- -- -- Copyright (C) 1992-2020, Free Software Foundation, Inc. -- -- -- -- GNAT 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 3, or (at your option) any later ver- -- -- sion. GNAT 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. -- -- -- -- As a special exception under Section 7 of GPL version 3, you are granted -- -- additional permissions described in the GCC Runtime Library Exception, -- -- version 3.1, as published by the Free Software Foundation. -- -- -- -- You should have received a copy of the GNU General Public License and -- -- a copy of the GCC Runtime Library Exception along with this program; -- -- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- -- <http://www.gnu.org/licenses/>. -- -- -- -- GNAT was originally developed by the GNAT team at New York University. -- -- Extensive contributions were provided by Ada Core Technologies Inc. -- -- -- ------------------------------------------------------------------------------ with Ada.Text_IO.Integer_Aux; package body Ada.Text_IO.Integer_IO is package Aux renames Ada.Text_IO.Integer_Aux; Need_LLI : constant Boolean := Num'Base'Size > Integer'Size; -- Throughout this generic body, we distinguish between the case where type -- Integer is acceptable, and where a Long_Long_Integer is needed. This -- Boolean is used to test for these cases and since it is a constant, only -- code for the relevant case will be included in the instance. --------- -- Get -- --------- procedure Get (File : File_Type; Item : out Num; Width : Field := 0) is -- We depend on a range check to get Data_Error pragma Unsuppress (Range_Check); pragma Unsuppress (Overflow_Check); begin if Need_LLI then Aux.Get_LLI (File, Long_Long_Integer (Item), Width); else Aux.Get_Int (File, Integer (Item), Width); end if; exception when Constraint_Error => raise Data_Error; end Get; procedure Get (Item : out Num; Width : Field := 0) is -- We depend on a range check to get Data_Error pragma Unsuppress (Range_Check); pragma Unsuppress (Overflow_Check); begin if Need_LLI then Aux.Get_LLI (Current_In, Long_Long_Integer (Item), Width); else Aux.Get_Int (Current_In, Integer (Item), Width); end if; exception when Constraint_Error => raise Data_Error; end Get; procedure Get (From : String; Item : out Num; Last : out Positive) is -- We depend on a range check to get Data_Error pragma Unsuppress (Range_Check); pragma Unsuppress (Overflow_Check); begin if Need_LLI then Aux.Gets_LLI (From, Long_Long_Integer (Item), Last); else Aux.Gets_Int (From, Integer (Item), Last); end if; exception when Constraint_Error => raise Data_Error; end Get; --------- -- Put -- --------- procedure Put (File : File_Type; Item : Num; Width : Field := Default_Width; Base : Number_Base := Default_Base) is begin if Need_LLI then Aux.Put_LLI (File, Long_Long_Integer (Item), Width, Base); else Aux.Put_Int (File, Integer (Item), Width, Base); end if; end Put; procedure Put (Item : Num; Width : Field := Default_Width; Base : Number_Base := Default_Base) is begin if Need_LLI then Aux.Put_LLI (Current_Out, Long_Long_Integer (Item), Width, Base); else Aux.Put_Int (Current_Out, Integer (Item), Width, Base); end if; end Put; procedure Put (To : out String; Item : Num; Base : Number_Base := Default_Base) is begin if Need_LLI then Aux.Puts_LLI (To, Long_Long_Integer (Item), Base); else Aux.Puts_Int (To, Integer (Item), Base); end if; end Put; end Ada.Text_IO.Integer_IO;
34.593548
79
0.500559
c7aa66b7ac8ee014aeb21124d64a1acf03aa5e99
1,023
ada
Ada
Task/Averages-Pythagorean-means/Ada/averages-pythagorean-means-2.ada
mullikine/RosettaCodeData
4f0027c6ce83daa36118ee8b67915a13cd23ab67
[ "Info-ZIP" ]
1
2018-11-09T22:08:38.000Z
2018-11-09T22:08:38.000Z
Task/Averages-Pythagorean-means/Ada/averages-pythagorean-means-2.ada
mullikine/RosettaCodeData
4f0027c6ce83daa36118ee8b67915a13cd23ab67
[ "Info-ZIP" ]
null
null
null
Task/Averages-Pythagorean-means/Ada/averages-pythagorean-means-2.ada
mullikine/RosettaCodeData
4f0027c6ce83daa36118ee8b67915a13cd23ab67
[ "Info-ZIP" ]
1
2018-11-09T22:08:40.000Z
2018-11-09T22:08:40.000Z
with Ada.Numerics.Generic_Elementary_Functions; package body Pythagorean_Means is package Math is new Ada.Numerics.Generic_Elementary_Functions (Float); function "**" (Left, Right : Float) return Float renames Math."**"; function Arithmetic_Mean (Data : Set) return Float is Sum : Float := 0.0; begin for I in Data'Range loop Sum := Sum + Data (I); end loop; return Sum / Float (Data'Length); end Arithmetic_Mean; function Geometric_Mean (Data : Set) return Float is Product : Float := 1.0; begin for I in Data'Range loop Product := Product * Data (I); end loop; return Product**(1.0/Float(Data'Length)); end Geometric_Mean; function Harmonic_Mean (Data : Set) return Float is Reciprocal_Sum : Float := 0.0; begin for I in Data'Range loop Reciprocal_Sum := Reciprocal_Sum + Data (I)**(-1); end loop; return Float (Data'Length) / Reciprocal_Sum; end Harmonic_Mean; end Pythagorean_Means;
30.088235
73
0.650049
29eba18133b48c4959346cec86230b9b010a6b1f
139
ads
Ada
drivers/forward_ad-hamiltonian.ads
sciencylab/lagrangian-solver
0f77265c1105658a27a9fa316bf5f046ac233774
[ "MIT" ]
null
null
null
drivers/forward_ad-hamiltonian.ads
sciencylab/lagrangian-solver
0f77265c1105658a27a9fa316bf5f046ac233774
[ "MIT" ]
null
null
null
drivers/forward_ad-hamiltonian.ads
sciencylab/lagrangian-solver
0f77265c1105658a27a9fa316bf5f046ac233774
[ "MIT" ]
null
null
null
package Forward_AD.Hamiltonian is function Func (Q, V : in Real_Array; T : in Real) return AD_Type; end Forward_AD.Hamiltonian;
23.166667
68
0.719424
06273ecf0a16e4540f0c253a105b78dfe12fe42e
4,252
adb
Ada
examples/zlibwrap/zlib/contrib/ada/read.adb
gahr/critcl
bceac8a8e959c40357c0ebdc0f0ec6c14408b5bf
[ "TCL" ]
41
2015-03-19T09:26:55.000Z
2022-03-22T09:41:33.000Z
examples/zlibwrap/zlib/contrib/ada/read.adb
apnadkarni/critcl
db00b6cd251cfdfca6c685772941e559fdf9b6a1
[ "TCL" ]
69
2015-02-06T17:30:53.000Z
2022-03-25T16:27:43.000Z
examples/zlibwrap/zlib/contrib/ada/read.adb
apnadkarni/critcl
db00b6cd251cfdfca6c685772941e559fdf9b6a1
[ "TCL" ]
11
2015-02-05T15:46:39.000Z
2021-03-24T18:43:53.000Z
---------------------------------------------------------------- -- ZLib for Ada thick binding. -- -- -- -- Copyright (C) 2002-2003 Dmitriy Anisimkov -- -- -- -- Open source license information is in the zlib.ads file. -- ---------------------------------------------------------------- -- $Id: read.adb 66 2005-08-17 18:20:58Z andreas_kupries $ -- Test/demo program for the generic read interface. with Ada.Numerics.Discrete_Random; with Ada.Streams; with Ada.Text_IO; with ZLib; procedure Read is use Ada.Streams; ------------------------------------ -- Test configuration parameters -- ------------------------------------ File_Size : Stream_Element_Offset := 100_000; Continuous : constant Boolean := False; -- If this constant is True, the test would be repeated again and again, -- with increment File_Size for every iteration. Header : constant ZLib.Header_Type := ZLib.Default; -- Do not use Header other than Default in ZLib versions 1.1.4 and older. Init_Random : constant := 8; -- We are using the same random sequence, in case of we catch bug, -- so we would be able to reproduce it. -- End -- Pack_Size : Stream_Element_Offset; Offset : Stream_Element_Offset; Filter : ZLib.Filter_Type; subtype Visible_Symbols is Stream_Element range 16#20# .. 16#7E#; package Random_Elements is new Ada.Numerics.Discrete_Random (Visible_Symbols); Gen : Random_Elements.Generator; Period : constant Stream_Element_Offset := 200; -- Period constant variable for random generator not to be very random. -- Bigger period, harder random. Read_Buffer : Stream_Element_Array (1 .. 2048); Read_First : Stream_Element_Offset; Read_Last : Stream_Element_Offset; procedure Reset; procedure Read (Item : out Stream_Element_Array; Last : out Stream_Element_Offset); -- this procedure is for generic instantiation of -- ZLib.Read -- reading data from the File_In. procedure Read is new ZLib.Read (Read, Read_Buffer, Rest_First => Read_First, Rest_Last => Read_Last); ---------- -- Read -- ---------- procedure Read (Item : out Stream_Element_Array; Last : out Stream_Element_Offset) is begin Last := Stream_Element_Offset'Min (Item'Last, Item'First + File_Size - Offset); for J in Item'First .. Last loop if J < Item'First + Period then Item (J) := Random_Elements.Random (Gen); else Item (J) := Item (J - Period); end if; Offset := Offset + 1; end loop; end Read; ----------- -- Reset -- ----------- procedure Reset is begin Random_Elements.Reset (Gen, Init_Random); Pack_Size := 0; Offset := 1; Read_First := Read_Buffer'Last + 1; Read_Last := Read_Buffer'Last; end Reset; begin Ada.Text_IO.Put_Line ("ZLib " & ZLib.Version); loop for Level in ZLib.Compression_Level'Range loop Ada.Text_IO.Put ("Level =" & ZLib.Compression_Level'Image (Level)); -- Deflate using generic instantiation. ZLib.Deflate_Init (Filter, Level, Header => Header); Reset; Ada.Text_IO.Put (Stream_Element_Offset'Image (File_Size) & " ->"); loop declare Buffer : Stream_Element_Array (1 .. 1024); Last : Stream_Element_Offset; begin Read (Filter, Buffer, Last); Pack_Size := Pack_Size + Last - Buffer'First + 1; exit when Last < Buffer'Last; end; end loop; Ada.Text_IO.Put_Line (Stream_Element_Offset'Image (Pack_Size)); ZLib.Close (Filter); end loop; exit when not Continuous; File_Size := File_Size + 1; end loop; end Read;
27.082803
77
0.535513
22db44116d0ab7b34de36b7c339b7f4bc365080f
3,227
ads
Ada
Validation/pyFrame3DD-master/gcc-master/gcc/ada/libgnat/s-pack31.ads
djamal2727/Main-Bearing-Analytical-Model
2f00c2219c71be0175c6f4f8f1d4cca231d97096
[ "Apache-2.0" ]
null
null
null
Validation/pyFrame3DD-master/gcc-master/gcc/ada/libgnat/s-pack31.ads
djamal2727/Main-Bearing-Analytical-Model
2f00c2219c71be0175c6f4f8f1d4cca231d97096
[ "Apache-2.0" ]
null
null
null
Validation/pyFrame3DD-master/gcc-master/gcc/ada/libgnat/s-pack31.ads
djamal2727/Main-Bearing-Analytical-Model
2f00c2219c71be0175c6f4f8f1d4cca231d97096
[ "Apache-2.0" ]
null
null
null
------------------------------------------------------------------------------ -- -- -- GNAT RUN-TIME COMPONENTS -- -- -- -- S Y S T E M . P A C K _ 3 1 -- -- -- -- S p e c -- -- -- -- Copyright (C) 1992-2020, Free Software Foundation, Inc. -- -- -- -- GNAT 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 3, or (at your option) any later ver- -- -- sion. GNAT 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. -- -- -- -- As a special exception under Section 7 of GPL version 3, you are granted -- -- additional permissions described in the GCC Runtime Library Exception, -- -- version 3.1, as published by the Free Software Foundation. -- -- -- -- You should have received a copy of the GNU General Public License and -- -- a copy of the GCC Runtime Library Exception along with this program; -- -- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- -- <http://www.gnu.org/licenses/>. -- -- -- -- GNAT was originally developed by the GNAT team at New York University. -- -- Extensive contributions were provided by Ada Core Technologies Inc. -- -- -- ------------------------------------------------------------------------------ -- Handling of packed arrays with Component_Size = 31 package System.Pack_31 is pragma Preelaborate; Bits : constant := 31; type Bits_31 is mod 2 ** Bits; for Bits_31'Size use Bits; -- In all subprograms below, Rev_SSO is set True if the array has the -- non-default scalar storage order. function Get_31 (Arr : System.Address; N : Natural; Rev_SSO : Boolean) return Bits_31 with Inline; -- Arr is the address of the packed array, N is the zero-based -- subscript. This element is extracted and returned. procedure Set_31 (Arr : System.Address; N : Natural; E : Bits_31; Rev_SSO : Boolean) with Inline; -- Arr is the address of the packed array, N is the zero-based -- subscript. This element is set to the given value. end System.Pack_31;
52.901639
78
0.439727
1da434405c5b87d7dfc5c87a973179ebc3f99a8b
25,017
adb
Ada
apps/hls_examples/camera_ready_synthesis/app_files/big_apps_32_shifts/conv2d_b2b/conv2d_b2b/hls_target/.autopilot/db/call_1.bind.adb
dillonhuff/Halide-HLS
e9f4c3ac7915e5a52f211ce65004ae17890515a0
[ "MIT" ]
1
2020-06-18T16:51:39.000Z
2020-06-18T16:51:39.000Z
apps/hls_examples/camera_ready_synthesis/app_files/big_apps_32_shifts/conv2d_b2b/conv2d_b2b/hls_target/.autopilot/db/call_1.bind.adb
dillonhuff/Halide-HLS
e9f4c3ac7915e5a52f211ce65004ae17890515a0
[ "MIT" ]
null
null
null
apps/hls_examples/camera_ready_synthesis/app_files/big_apps_32_shifts/conv2d_b2b/conv2d_b2b/hls_target/.autopilot/db/call_1.bind.adb
dillonhuff/Halide-HLS
e9f4c3ac7915e5a52f211ce65004ae17890515a0
[ "MIT" ]
1
2020-03-18T00:43:22.000Z
2020-03-18T00:43:22.000Z
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?> <!DOCTYPE boost_serialization> <boost_serialization signature="serialization::archive" version="14"> <syndb class_id="0" tracking_level="0" version="0"> <userIPLatency>-1</userIPLatency> <userIPName></userIPName> <cdfg class_id="1" tracking_level="1" version="0" object_id="_0"> <name>call_1</name> <ret_bitwidth>0</ret_bitwidth> <ports class_id="2" tracking_level="0" version="0"> <count>2</count> <item_version>0</item_version> <item class_id="3" tracking_level="1" version="0" object_id="_1"> <Value class_id="4" tracking_level="0" version="0"> <Obj class_id="5" tracking_level="0" version="0"> <type>1</type> <id>1</id> <name>in_stream_V_value_V</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo class_id="6" tracking_level="0" version="0"> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName>in_stream.V.value.V</originalName> <rtlName></rtlName> <coreName>FIFO_SRL</coreName> </Obj> <bitwidth>32</bitwidth> </Value> <direction>0</direction> <if_type>3</if_type> <array_size>0</array_size> <bit_vecs class_id="7" tracking_level="0" version="0"> <count>0</count> <item_version>0</item_version> </bit_vecs> </item> <item class_id_reference="3" object_id="_2"> <Value> <Obj> <type>1</type> <id>2</id> <name>out_stream_V_value_V</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName>out_stream.V.value.V</originalName> <rtlName></rtlName> <coreName>FIFO_SRL</coreName> </Obj> <bitwidth>128</bitwidth> </Value> <direction>1</direction> <if_type>3</if_type> <array_size>0</array_size> <bit_vecs> <count>0</count> <item_version>0</item_version> </bit_vecs> </item> </ports> <nodes class_id="8" tracking_level="0" version="0"> <count>4</count> <item_version>0</item_version> <item class_id="9" tracking_level="1" version="0" object_id="_3"> <Value> <Obj> <type>0</type> <id>8</id> <name>slice_stream_V_value</name> <fileName>../../../lib_files/Linebuffer.h</fileName> <fileDirectory>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/big_apps_32_shifts/conv2d_b2b</fileDirectory> <lineNumber>172</lineNumber> <contextFuncName>call</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item class_id="10" tracking_level="0" version="0"> <first>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/big_apps_32_shifts/conv2d_b2b</first> <second class_id="11" tracking_level="0" version="0"> <count>1</count> <item_version>0</item_version> <item class_id="12" tracking_level="0" version="0"> <first class_id="13" tracking_level="0" version="0"> <first>../../../lib_files/Linebuffer.h</first> <second>call</second> </first> <second>172</second> </item> </second> </item> </inlineStackInfo> <originalName>slice_stream.V.value.V</originalName> <rtlName></rtlName> <coreName>FIFO_SRL</coreName> </Obj> <bitwidth>64</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>17</item> </oprand_edges> <opcode>alloca</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_4"> <Value> <Obj> <type>0</type> <id>12</id> <name></name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>0</bitwidth> </Value> <oprand_edges> <count>3</count> <item_version>0</item_version> <item>19</item> <item>20</item> <item>21</item> </oprand_edges> <opcode>call</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_5"> <Value> <Obj> <type>0</type> <id>13</id> <name></name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>0</bitwidth> </Value> <oprand_edges> <count>5</count> <item_version>0</item_version> <item>23</item> <item>24</item> <item>25</item> <item>135</item> <item>136</item> </oprand_edges> <opcode>call</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_6"> <Value> <Obj> <type>0</type> <id>14</id> <name></name> <fileName>../../../lib_files/Linebuffer.h</fileName> <fileDirectory>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/big_apps_32_shifts/conv2d_b2b</fileDirectory> <lineNumber>219</lineNumber> <contextFuncName>call</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/big_apps_32_shifts/conv2d_b2b</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>../../../lib_files/Linebuffer.h</first> <second>call</second> </first> <second>219</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>0</bitwidth> </Value> <oprand_edges> <count>0</count> <item_version>0</item_version> </oprand_edges> <opcode>ret</opcode> <m_Display>0</m_Display> </item> </nodes> <consts class_id="15" tracking_level="0" version="0"> <count>3</count> <item_version>0</item_version> <item class_id="16" tracking_level="1" version="0" object_id="_7"> <Value> <Obj> <type>2</type> <id>16</id> <name>empty</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>64</bitwidth> </Value> <const_type>0</const_type> <content>1</content> </item> <item class_id_reference="16" object_id="_8"> <Value> <Obj> <type>2</type> <id>18</id> <name>call_Loop_LB2D_buf_p_1</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>0</bitwidth> </Value> <const_type>6</const_type> <content>&lt;constant:call_Loop_LB2D_buf_p.1&gt;</content> </item> <item class_id_reference="16" object_id="_9"> <Value> <Obj> <type>2</type> <id>22</id> <name>call_Loop_LB2D_shift_1</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>0</bitwidth> </Value> <const_type>6</const_type> <content>&lt;constant:call_Loop_LB2D_shift.1&gt;</content> </item> </consts> <blocks class_id="17" tracking_level="0" version="0"> <count>1</count> <item_version>0</item_version> <item class_id="18" tracking_level="1" version="0" object_id="_10"> <Obj> <type>3</type> <id>15</id> <name>call.1</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <node_objs> <count>4</count> <item_version>0</item_version> <item>8</item> <item>12</item> <item>13</item> <item>14</item> </node_objs> </item> </blocks> <edges class_id="19" tracking_level="0" version="0"> <count>9</count> <item_version>0</item_version> <item class_id="20" tracking_level="1" version="0" object_id="_11"> <id>17</id> <edge_type>1</edge_type> <source_obj>16</source_obj> <sink_obj>8</sink_obj> </item> <item class_id_reference="20" object_id="_12"> <id>19</id> <edge_type>1</edge_type> <source_obj>18</source_obj> <sink_obj>12</sink_obj> </item> <item class_id_reference="20" object_id="_13"> <id>20</id> <edge_type>1</edge_type> <source_obj>1</source_obj> <sink_obj>12</sink_obj> </item> <item class_id_reference="20" object_id="_14"> <id>21</id> <edge_type>1</edge_type> <source_obj>8</source_obj> <sink_obj>12</sink_obj> </item> <item class_id_reference="20" object_id="_15"> <id>23</id> <edge_type>1</edge_type> <source_obj>22</source_obj> <sink_obj>13</sink_obj> </item> <item class_id_reference="20" object_id="_16"> <id>24</id> <edge_type>1</edge_type> <source_obj>8</source_obj> <sink_obj>13</sink_obj> </item> <item class_id_reference="20" object_id="_17"> <id>25</id> <edge_type>1</edge_type> <source_obj>2</source_obj> <sink_obj>13</sink_obj> </item> <item class_id_reference="20" object_id="_18"> <id>135</id> <edge_type>4</edge_type> <source_obj>12</source_obj> <sink_obj>13</sink_obj> </item> <item class_id_reference="20" object_id="_19"> <id>136</id> <edge_type>4</edge_type> <source_obj>12</source_obj> <sink_obj>13</sink_obj> </item> </edges> </cdfg> <cdfg_regions class_id="21" tracking_level="0" version="0"> <count>1</count> <item_version>0</item_version> <item class_id="22" tracking_level="1" version="0" object_id="_20"> <mId>1</mId> <mTag>call.1</mTag> <mType>0</mType> <sub_regions> <count>0</count> <item_version>0</item_version> </sub_regions> <basic_blocks> <count>1</count> <item_version>0</item_version> <item>15</item> </basic_blocks> <mII>-1</mII> <mDepth>-1</mDepth> <mMinTripCount>-1</mMinTripCount> <mMaxTripCount>-1</mMaxTripCount> <mMinLatency>2071917</mMinLatency> <mMaxLatency>-1</mMaxLatency> <mIsDfPipe>1</mIsDfPipe> <mDfPipe class_id="23" tracking_level="1" version="0" object_id="_21"> <port_list class_id="24" tracking_level="0" version="0"> <count>0</count> <item_version>0</item_version> </port_list> <process_list class_id="25" tracking_level="0" version="0"> <count>2</count> <item_version>0</item_version> <item class_id="26" tracking_level="1" version="0" object_id="_22"> <type>0</type> <name>call_Loop_LB2D_buf_p_1_U0</name> <ssdmobj_id>12</ssdmobj_id> <pins class_id="27" tracking_level="0" version="0"> <count>2</count> <item_version>0</item_version> <item class_id="28" tracking_level="1" version="0" object_id="_23"> <port class_id="29" tracking_level="1" version="0" object_id="_24"> <name>in_stream_V_value_V</name> <dir>0</dir> <type>0</type> </port> <inst class_id="30" tracking_level="1" version="0" object_id="_25"> <type>0</type> <name>call_Loop_LB2D_buf_p_1_U0</name> <ssdmobj_id>12</ssdmobj_id> </inst> </item> <item class_id_reference="28" object_id="_26"> <port class_id_reference="29" object_id="_27"> <name>slice_stream_V_value_V</name> <dir>0</dir> <type>1</type> </port> <inst class_id_reference="30" object_id_reference="_25"></inst> </item> </pins> </item> <item class_id_reference="26" object_id="_28"> <type>0</type> <name>call_Loop_LB2D_shift_1_U0</name> <ssdmobj_id>13</ssdmobj_id> <pins> <count>2</count> <item_version>0</item_version> <item class_id_reference="28" object_id="_29"> <port class_id_reference="29" object_id="_30"> <name>slice_stream_V_value_V</name> <dir>0</dir> <type>0</type> </port> <inst class_id_reference="30" object_id="_31"> <type>0</type> <name>call_Loop_LB2D_shift_1_U0</name> <ssdmobj_id>13</ssdmobj_id> </inst> </item> <item class_id_reference="28" object_id="_32"> <port class_id_reference="29" object_id="_33"> <name>out_stream_V_value_V</name> <dir>0</dir> <type>1</type> </port> <inst class_id_reference="30" object_id_reference="_31"></inst> </item> </pins> </item> </process_list> <channel_list class_id="31" tracking_level="0" version="0"> <count>1</count> <item_version>0</item_version> <item class_id="32" tracking_level="1" version="0" object_id="_34"> <type>1</type> <name>slice_stream_V_value</name> <ssdmobj_id>8</ssdmobj_id> <ctype>0</ctype> <depth>1</depth> <bitwidth>64</bitwidth> <source class_id_reference="28" object_id="_35"> <port class_id_reference="29" object_id="_36"> <name>in</name> <dir>3</dir> <type>0</type> </port> <inst class_id_reference="30" object_id_reference="_25"></inst> </source> <sink class_id_reference="28" object_id="_37"> <port class_id_reference="29" object_id="_38"> <name>out</name> <dir>3</dir> <type>1</type> </port> <inst class_id_reference="30" object_id_reference="_31"></inst> </sink> </item> </channel_list> <net_list class_id="33" tracking_level="0" version="0"> <count>0</count> <item_version>0</item_version> </net_list> </mDfPipe> </item> </cdfg_regions> <fsm class_id="34" tracking_level="1" version="0" object_id="_39"> <states class_id="35" tracking_level="0" version="0"> <count>4</count> <item_version>0</item_version> <item class_id="36" tracking_level="1" version="0" object_id="_40"> <id>1</id> <operations class_id="37" tracking_level="0" version="0"> <count>2</count> <item_version>0</item_version> <item class_id="38" tracking_level="1" version="0" object_id="_41"> <id>8</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="38" object_id="_42"> <id>12</id> <stage>2</stage> <latency>2</latency> </item> </operations> </item> <item class_id_reference="36" object_id="_43"> <id>2</id> <operations> <count>1</count> <item_version>0</item_version> <item class_id_reference="38" object_id="_44"> <id>12</id> <stage>1</stage> <latency>2</latency> </item> </operations> </item> <item class_id_reference="36" object_id="_45"> <id>3</id> <operations> <count>1</count> <item_version>0</item_version> <item class_id_reference="38" object_id="_46"> <id>13</id> <stage>2</stage> <latency>2</latency> </item> </operations> </item> <item class_id_reference="36" object_id="_47"> <id>4</id> <operations> <count>10</count> <item_version>0</item_version> <item class_id_reference="38" object_id="_48"> <id>3</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="38" object_id="_49"> <id>4</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="38" object_id="_50"> <id>5</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="38" object_id="_51"> <id>6</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="38" object_id="_52"> <id>7</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="38" object_id="_53"> <id>9</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="38" object_id="_54"> <id>10</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="38" object_id="_55"> <id>11</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="38" object_id="_56"> <id>13</id> <stage>1</stage> <latency>2</latency> </item> <item class_id_reference="38" object_id="_57"> <id>14</id> <stage>1</stage> <latency>1</latency> </item> </operations> </item> </states> <transitions class_id="39" tracking_level="0" version="0"> <count>3</count> <item_version>0</item_version> <item class_id="40" tracking_level="1" version="0" object_id="_58"> <inState>1</inState> <outState>2</outState> <condition class_id="41" tracking_level="0" version="0"> <id>0</id> <sop class_id="42" tracking_level="0" version="0"> <count>1</count> <item_version>0</item_version> <item class_id="43" tracking_level="0" version="0"> <count>0</count> <item_version>0</item_version> </item> </sop> </condition> </item> <item class_id_reference="40" object_id="_59"> <inState>2</inState> <outState>3</outState> <condition> <id>1</id> <sop> <count>1</count> <item_version>0</item_version> <item> <count>0</count> <item_version>0</item_version> </item> </sop> </condition> </item> <item class_id_reference="40" object_id="_60"> <inState>3</inState> <outState>4</outState> <condition> <id>2</id> <sop> <count>1</count> <item_version>0</item_version> <item> <count>0</count> <item_version>0</item_version> </item> </sop> </condition> </item> </transitions> </fsm> <res class_id="-1"></res> <node_label_latency class_id="45" tracking_level="0" version="0"> <count>4</count> <item_version>0</item_version> <item class_id="46" tracking_level="0" version="0"> <first>8</first> <second class_id="47" tracking_level="0" version="0"> <first>0</first> <second>0</second> </second> </item> <item> <first>12</first> <second> <first>0</first> <second>1</second> </second> </item> <item> <first>13</first> <second> <first>2</first> <second>1</second> </second> </item> <item> <first>14</first> <second> <first>3</first> <second>0</second> </second> </item> </node_label_latency> <bblk_ent_exit class_id="48" tracking_level="0" version="0"> <count>1</count> <item_version>0</item_version> <item class_id="49" tracking_level="0" version="0"> <first>15</first> <second class_id="50" tracking_level="0" version="0"> <first>0</first> <second>3</second> </second> </item> </bblk_ent_exit> <regions class_id="51" tracking_level="0" version="0"> <count>1</count> <item_version>0</item_version> <item class_id="52" tracking_level="1" version="0" object_id="_61"> <region_name>call.1</region_name> <basic_blocks> <count>1</count> <item_version>0</item_version> <item>15</item> </basic_blocks> <nodes> <count>12</count> <item_version>0</item_version> <item>3</item> <item>4</item> <item>5</item> <item>6</item> <item>7</item> <item>8</item> <item>9</item> <item>10</item> <item>11</item> <item>12</item> <item>13</item> <item>14</item> </nodes> <anchor_node>-1</anchor_node> <region_type>16</region_type> <interval>0</interval> <pipe_depth>0</pipe_depth> </item> </regions> <dp_fu_nodes class_id="53" tracking_level="0" version="0"> <count>3</count> <item_version>0</item_version> <item class_id="54" tracking_level="0" version="0"> <first>36</first> <second> <count>1</count> <item_version>0</item_version> <item>8</item> </second> </item> <item> <first>40</first> <second> <count>2</count> <item_version>0</item_version> <item>12</item> <item>12</item> </second> </item> <item> <first>47</first> <second> <count>2</count> <item_version>0</item_version> <item>13</item> <item>13</item> </second> </item> </dp_fu_nodes> <dp_fu_nodes_expression class_id="56" tracking_level="0" version="0"> <count>1</count> <item_version>0</item_version> <item class_id="57" tracking_level="0" version="0"> <first>slice_stream_V_value_fu_36</first> <second> <count>1</count> <item_version>0</item_version> <item>8</item> </second> </item> </dp_fu_nodes_expression> <dp_fu_nodes_module> <count>2</count> <item_version>0</item_version> <item> <first>grp_call_Loop_LB2D_buf_p_1_fu_40</first> <second> <count>2</count> <item_version>0</item_version> <item>12</item> <item>12</item> </second> </item> <item> <first>grp_call_Loop_LB2D_shift_1_fu_47</first> <second> <count>2</count> <item_version>0</item_version> <item>13</item> <item>13</item> </second> </item> </dp_fu_nodes_module> <dp_fu_nodes_io> <count>0</count> <item_version>0</item_version> </dp_fu_nodes_io> <return_ports> <count>0</count> <item_version>0</item_version> </return_ports> <dp_mem_port_nodes class_id="58" tracking_level="0" version="0"> <count>0</count> <item_version>0</item_version> </dp_mem_port_nodes> <dp_reg_nodes> <count>1</count> <item_version>0</item_version> <item> <first>54</first> <second> <count>1</count> <item_version>0</item_version> <item>8</item> </second> </item> </dp_reg_nodes> <dp_regname_nodes> <count>1</count> <item_version>0</item_version> <item> <first>slice_stream_V_value_reg_54</first> <second> <count>1</count> <item_version>0</item_version> <item>8</item> </second> </item> </dp_regname_nodes> <dp_reg_phi> <count>0</count> <item_version>0</item_version> </dp_reg_phi> <dp_regname_phi> <count>0</count> <item_version>0</item_version> </dp_regname_phi> <dp_port_io_nodes class_id="59" tracking_level="0" version="0"> <count>2</count> <item_version>0</item_version> <item class_id="60" tracking_level="0" version="0"> <first>in_stream_V_value_V</first> <second> <count>1</count> <item_version>0</item_version> <item> <first>call</first> <second> <count>1</count> <item_version>0</item_version> <item>12</item> </second> </item> </second> </item> <item> <first>out_stream_V_value_V</first> <second> <count>1</count> <item_version>0</item_version> <item> <first>call</first> <second> <count>1</count> <item_version>0</item_version> <item>13</item> </second> </item> </second> </item> </dp_port_io_nodes> <port2core class_id="61" tracking_level="0" version="0"> <count>2</count> <item_version>0</item_version> <item class_id="62" tracking_level="0" version="0"> <first>1</first> <second>FIFO_SRL</second> </item> <item> <first>2</first> <second>FIFO_SRL</second> </item> </port2core> <node2core> <count>1</count> <item_version>0</item_version> <item> <first>8</first> <second>FIFO_SRL</second> </item> </node2core> </syndb> </boost_serialization>
27.796667
140
0.607547
5975b74458a80a27e1e2472d5be7598ce17c7b0e
4,098
adb
Ada
llvm-gcc-4.2-2.9/gcc/ada/s-imglli.adb
vidkidz/crossbridge
ba0bf94aee0ce6cf7eb5be882382e52bc57ba396
[ "MIT" ]
1
2016-04-09T02:58:13.000Z
2016-04-09T02:58:13.000Z
llvm-gcc-4.2-2.9/gcc/ada/s-imglli.adb
vidkidz/crossbridge
ba0bf94aee0ce6cf7eb5be882382e52bc57ba396
[ "MIT" ]
null
null
null
llvm-gcc-4.2-2.9/gcc/ada/s-imglli.adb
vidkidz/crossbridge
ba0bf94aee0ce6cf7eb5be882382e52bc57ba396
[ "MIT" ]
null
null
null
------------------------------------------------------------------------------ -- -- -- GNAT RUN-TIME COMPONENTS -- -- -- -- S Y S T E M . I M G _ L L I -- -- -- -- B o d y -- -- -- -- Copyright (C) 1992-2005 Free Software Foundation, Inc. -- -- -- -- GNAT 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. GNAT 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 GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, -- -- Boston, MA 02110-1301, 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. -- -- -- -- GNAT was originally developed by the GNAT team at New York University. -- -- Extensive contributions were provided by Ada Core Technologies Inc. -- -- -- ------------------------------------------------------------------------------ package body System.Img_LLI is ----------------------------- -- Image_Long_Long_Integer -- ----------------------------- function Image_Long_Long_Integer (V : Long_Long_Integer) return String is P : Natural; S : String (1 .. Long_Long_Integer'Width); begin if V >= 0 then P := 1; S (P) := ' '; else P := 0; end if; Set_Image_Long_Long_Integer (V, S, P); return S (1 .. P); end Image_Long_Long_Integer; --------------------------------- -- Set_Image_Long_Long_Integer -- --------------------------------- procedure Set_Image_Long_Long_Integer (V : Long_Long_Integer; S : out String; P : in out Natural) is procedure Set_Digits (T : Long_Long_Integer); -- Set digits of absolute value of T, which is zero or negative. We work -- with the negative of the value so that the largest negative number is -- not a special case. procedure Set_Digits (T : Long_Long_Integer) is begin if T <= -10 then Set_Digits (T / 10); P := P + 1; S (P) := Character'Val (48 - (T rem 10)); else P := P + 1; S (P) := Character'Val (48 - T); end if; end Set_Digits; -- Start of processing for Set_Image_Long_Long_Integer begin if V >= 0 then Set_Digits (-V); else P := P + 1; S (P) := '-'; Set_Digits (V); end if; end Set_Image_Long_Long_Integer; end System.Img_LLI;
41.816327
79
0.443631
59ce3bc6aaa89d7bdf40321fe4eb0a66ae2e7e70
682
ads
Ada
source/setup.ads
jquorning/Gauss
742b93651cd97e417b9eacba7a3416be581f9c23
[ "blessing" ]
4
2019-02-17T16:11:41.000Z
2019-03-28T00:06:12.000Z
source/setup.ads
jquorning/GAWS
742b93651cd97e417b9eacba7a3416be581f9c23
[ "blessing" ]
null
null
null
source/setup.ads
jquorning/GAWS
742b93651cd97e417b9eacba7a3416be581f9c23
[ "blessing" ]
null
null
null
-- -- The author disclaims copyright to this source code. In place of -- a legal notice, here is a blessing: -- -- May you do good and not evil. -- May you find forgiveness for yourself and forgive others. -- May you share freely, not taking more than you give. -- package Setup is function Get_Program_Name return String; function Get_Program_Version return String; function Get_Build_ISO8601_UTC return String; function Get_Uname_M return String; function Get_Uname_N return String; function Get_Uname_P return String; function Get_Uname_R return String; function Get_Uname_S return String; function Get_Uname return String; end Setup;
29.652174
68
0.750733
3d0b4a2f8883c0fe5a21b187726f70184f79068c
1,773
adb
Ada
src/tcl-commands.adb
thindil/tashy2
43fcbadb33c0062b2c8d6138a8238441dec5fd80
[ "Apache-2.0" ]
2
2020-12-09T07:27:07.000Z
2021-10-19T13:31:54.000Z
src/tcl-commands.adb
thindil/tashy2
43fcbadb33c0062b2c8d6138a8238441dec5fd80
[ "Apache-2.0" ]
null
null
null
src/tcl-commands.adb
thindil/tashy2
43fcbadb33c0062b2c8d6138a8238441dec5fd80
[ "Apache-2.0" ]
null
null
null
-- Copyright (c) 2020-2021 Bartek thindil Jasicki <[email protected]> -- -- 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. package body Tcl.Commands with SPARK_Mode => Off is function Tcl_Create_Command (Command_Name: String; Proc: Tcl_Cmd_Proc; Interpreter: Tcl_Interpreter := Get_Interpreter; Delete_Proc: Tcl_Cmd_Delete_Proc := Null_Tcl_Cmd_Delete_Proc) return Tcl_Command is function Tcl_Create_Command_C (Interp: Tcl_Interpreter; Cmd_Name: chars_ptr; Ada_Proc: Tcl_Cmd_Proc; Client_Data: System.Address; Delete_Proc_Ada: Tcl_Cmd_Delete_Proc) return Tcl_Command with Import, Convention => C, External_Name => "Tcl_CreateCommand"; begin return Tcl_Create_Command_C (Interp => Interpreter, Cmd_Name => New_String(Str => Command_Name), Ada_Proc => Proc, Client_Data => Null_Address, Delete_Proc_Ada => Delete_Proc); end Tcl_Create_Command; function Get_Argument (Arguments_Pointer: not null Argv_Pointer.Pointer; Index: Natural) return String is begin return Value (Item => Argv_Pointer.Value(Ref => Arguments_Pointer)(size_t(Index))); end Get_Argument; end Tcl.Commands;
34.764706
78
0.7022
2268ce214fc99cf60e068668635fad2c6a520806
1,774
adb
Ada
src/lumen-program.adb
darkestkhan/lumen
d560f322a8efccac7ed5d16db1d2d188245836ba
[ "0BSD" ]
8
2015-07-20T18:20:10.000Z
2021-01-29T21:09:02.000Z
src/lumen-program.adb
darkestkhan/lumen
d560f322a8efccac7ed5d16db1d2d188245836ba
[ "0BSD" ]
10
2015-07-20T18:48:45.000Z
2016-05-07T19:23:31.000Z
src/lumen-program.adb
darkestkhan/lumen
d560f322a8efccac7ed5d16db1d2d188245836ba
[ "0BSD" ]
1
2018-11-18T17:01:15.000Z
2018-11-18T17:01:15.000Z
-- Lumen.Program -- Helper routines fr working with shader programs. -- -- darkestkhan, Winter 2014 -- This code is covered by the ISC License: -- -- Copyright © 2014, darkestkhan -- -- Permission to use, copy, modify, and/or distribute this software for any -- purpose with or without fee is hereby granted, provided that the above -- copyright notice and this permission notice appear in all copies. -- -- The software is provided "as is" and the author disclaims all warranties -- with regard to this software including all implied warranties of -- merchantability and fitness. In no event shall the author be liable for any -- special, direct, indirect, or consequential damages or any damages -- whatsoever resulting from loss of use, data or profits, whether in an -- action of contract, negligence or other tortious action, arising out of or -- in connection with the use or performance of this software. with Interfaces.C; with Lumen.Binary; use type Lumen.Binary.Byte; package body Lumen.Program is --------------------------------------------------------------------------- function Get_Info_Log (Program : in GL.UInt) return String is Log_Len : GL.Int; begin -- Get_Info_Log GL.Get_Program (Program, GL.GL_INFO_LOG_LENGTH, Log_Len'Address); declare Log : Interfaces.C.char_array (1 .. Interfaces.C.size_t (Log_Len)); Got : GL.SizeI; begin GL.Get_Program_Info_Log (Program, Log'Length, Got'Address, Log'Address); return Interfaces.C.To_Ada (Log); end; end Get_Info_Log; --------------------------------------------------------------------------- end Lumen.Program;
31.678571
78
0.617249
c78ced39dcfa125721d58a2beaef2af8cbad586a
12,927
adb
Ada
bb-runtimes/runtimes/zfp-stm32g474/gnat/setup_pll.adb
JCGobbi/Nucleo-STM32G474RE
8dc1c4948ffeb11841eed10f1c3708f00fa1d832
[ "BSD-3-Clause" ]
null
null
null
bb-runtimes/runtimes/zfp-stm32g474/gnat/setup_pll.adb
JCGobbi/Nucleo-STM32G474RE
8dc1c4948ffeb11841eed10f1c3708f00fa1d832
[ "BSD-3-Clause" ]
null
null
null
bb-runtimes/runtimes/zfp-stm32g474/gnat/setup_pll.adb
JCGobbi/Nucleo-STM32G474RE
8dc1c4948ffeb11841eed10f1c3708f00fa1d832
[ "BSD-3-Clause" ]
null
null
null
------------------------------------------------------------------------------ -- -- -- GNAT RUN-TIME COMPONENTS -- -- -- -- Copyright (C) 2012-2019, Free Software Foundation, Inc. -- -- -- -- GNAT 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 3, or (at your option) any later ver- -- -- sion. GNAT 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. -- -- -- -- As a special exception under Section 7 of GPL version 3, you are granted -- -- additional permissions described in the GCC Runtime Library Exception, -- -- version 3.1, as published by the Free Software Foundation. -- -- -- -- You should have received a copy of the GNU General Public License and -- -- a copy of the GCC Runtime Library Exception along with this program; -- -- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- -- <http://www.gnu.org/licenses/>. -- -- -- -- GNAT was originally developed by the GNAT team at New York University. -- -- Extensive contributions were provided by Ada Core Technologies Inc. -- -- -- ------------------------------------------------------------------------------ pragma Ada_2012; -- To work around pre-commit check? pragma Suppress (All_Checks); -- This initialization procedure mainly initializes the PLLs and -- all derived clocks. with Ada.Unchecked_Conversion; with Interfaces.STM32; use Interfaces, Interfaces.STM32; with Interfaces.STM32.Flash; use Interfaces.STM32.Flash; with Interfaces.STM32.RCC; use Interfaces.STM32.RCC; with System.BB.Parameters; use System.BB.Parameters; with System.BB.MCU_Parameters; with System.STM32; use System.STM32; procedure Setup_Pll is procedure Initialize_Clocks; procedure Reset_Clocks; ------------------------------ -- Clock Tree Configuration -- ------------------------------ HSE_Enabled : constant Boolean := True; -- use high-speed external clock HSE_Bypass : constant Boolean := False; -- bypass osc. with external clock LSE_Enabled : constant Boolean := True; -- use low-speed external clock -- HSI_Enabled : constant Boolean := (if HSE_Enabled then False else True); -- use high-speed HSI16 internal clock LSI_Enabled : constant Boolean := True; -- use low-speed internal clock Activate_PLL : constant Boolean := True; -- Activate_Overdrive : constant Boolean := True; ----------------------- -- Initialize_Clocks -- ----------------------- procedure Initialize_Clocks is ------------------------------- -- Compute Clock Frequencies -- ------------------------------- PLLP_Value : constant := 2; PLLQ_Value : constant := 4; PLLR_Value : constant := 2; PLLCLKIN : constant Integer := 4_000_000; -- PLL input clock value PLLM_Value : constant Integer := (if HSE_Enabled then HSE_Clock else HSI_Clock) / PLLCLKIN; -- First divider M is set to produce a 4Mhz clock PLLN_Value : constant Integer := (PLLR_Value * Clock_Frequency) / PLLCLKIN; -- Compute N to to generate the required frequency pragma Compile_Time_Error (Activate_PLL and PLLM_Value not in PLLM_Range, "Invalid PLLM clock configuration value"); pragma Compile_Time_Error (Activate_PLL and PLLN_Value not in PLLN_Range, "Invalid PLLN clock configuration value"); pragma Compile_Time_Error (Activate_PLL and PLLR_Value not in PLLR_Range, "Invalid PLLR clock configuration value"); pragma Compile_Time_Error (Activate_PLL and PLLP_Value not in PLLP_Range, "Invalid PLLP clock configuration value"); pragma Compile_Time_Error (Activate_PLL and PLLQ_Value not in PLLQ_Range, "Invalid PLLQ clock configuration value"); PLLVCO : constant Integer := PLLCLKIN * PLLN_Value; -- PLLN_OUT pragma Compile_Time_Error (Activate_PLL and PLLVCO not in PLLN_OUT_Range, "Invalid PLLN clock configuration output value"); PLLCLKOUT : constant Integer := PLLVCO / PLLR_Value; -- PLLCLK pragma Compile_Time_Error (Activate_PLL and PLLCLKOUT not in PLLCLK_Range, "Invalid PLLR clock configuration output value"); PLLM : constant UInt4 := UInt4 (PLLM_Value - 1); PLLN : constant UInt7 := UInt7 (PLLN_Value); PLLP : constant UInt5 := UInt5 (PLLP_Value); PLLQ : constant UInt2 := UInt2 (PLLQ_Value / 2 - 1); PLLR : constant UInt2 := UInt2 (PLLR_Value / 2 - 1); SW : constant SYSCLK_Source := (if Activate_PLL then SYSCLK_SRC_PLL else (if HSE_Enabled then SYSCLK_SRC_HSE else SYSCLK_SRC_HSI)); SW_Value : constant CFGR_SW_Field := SYSCLK_Source'Enum_Rep (SW); SYSCLK : constant Integer := (if Activate_PLL then PLLCLKOUT else (if HSE_Enabled then HSE_Clock else HSI_Clock)); HCLK : constant Integer := (if not AHB_PRE.Enabled then SYSCLK else (case AHB_PRE.Value is when DIV2 => SYSCLK / 2, when DIV4 => SYSCLK / 4, when DIV8 => SYSCLK / 8, when DIV16 => SYSCLK / 16, when DIV64 => SYSCLK / 64, when DIV128 => SYSCLK / 128, when DIV256 => SYSCLK / 256, when DIV512 => SYSCLK / 512)); PCLK1 : constant Integer := (if not APB1_PRE.Enabled then HCLK else (case APB1_PRE.Value is when DIV2 => HCLK / 2, when DIV4 => HCLK / 4, when DIV8 => HCLK / 8, when DIV16 => HCLK / 16)); PCLK2 : constant Integer := (if not APB2_PRE.Enabled then HCLK else (case APB2_PRE.Value is when DIV2 => HCLK / 2, when DIV4 => HCLK / 4, when DIV8 => HCLK / 8, when DIV16 => HCLK / 16)); function To_AHB is new Ada.Unchecked_Conversion (AHB_Prescaler, UInt4); function To_APB is new Ada.Unchecked_Conversion (APB_Prescaler, UInt3); begin pragma Compile_Time_Error (SYSCLK /= Clock_Frequency, "Cannot generate requested clock"); -- Cannot be checked at compile time, depends on APB1_PRE and APB2_PRE pragma Assert (HCLK not in HCLK_Range or else PCLK1 not in PCLK1_Range or else PCLK2 not in PCLK2_Range, "Invalid AHB/APB prescalers configuration"); -- PWR clock enable RCC_Periph.APB1ENR1.PWREN := 1; -- Reset the power interface RCC_Periph.APB1RSTR1.PWRRST := 1; RCC_Periph.APB1RSTR1.PWRRST := 0; -- PWR initialization System.BB.MCU_Parameters.PWR_Initialize; if not HSE_Enabled then -- Setup high-speed internal clock and wait for stabilisation. RCC_Periph.CR.HSION := 1; loop exit when RCC_Periph.CR.HSIRDY = 1; end loop; else -- Configure high-speed external clock, if enabled RCC_Periph.CR.HSEBYP := (if HSE_Bypass then 1 else 0); -- Enable security for HSERDY RCC_Periph.CR.CSSON := 1; -- Setup high-speed external clock RCC_Periph.CR.HSEON := 1; -- Wait for HSE stabilisation. loop exit when RCC_Periph.CR.HSERDY = 1; end loop; end if; if LSE_Enabled then -- Setup low-speed external clock and wait for stabilization. RCC_Periph.BDCR.LSEON := 1; loop exit when RCC_Periph.BDCR.LSERDY = 1; end loop; end if; if LSI_Enabled then -- Setup low-speed internal clock and wait for stabilization. RCC_Periph.CSR.LSION := 1; loop exit when RCC_Periph.CSR.LSIRDY = 1; end loop; end if; -- Activate PLL if enabled if Activate_PLL then -- Disable the main PLL before configuring it RCC_Periph.CR.PLLON := 0; -- Configure the PLL clock source, multiplication and division -- factors RCC_Periph.PLLCFGR := (PLLM => PLLM, PLLN => PLLN, PLLPDIV => PLLP, PLLQ => PLLQ, PLLR => PLLR, PLLSRC => (if HSE_Enabled then PLL_Source'Enum_Rep (PLL_SRC_HSE) else PLL_Source'Enum_Rep (PLL_SRC_HSI)), others => <>); -- Setup PLL and wait for stabilization. RCC_Periph.CR.PLLON := 1; loop exit when RCC_Periph.CR.PLLRDY = 1; end loop; RCC_Periph.PLLCFGR.PLLPEN := 1; RCC_Periph.PLLCFGR.PLLQEN := 1; RCC_Periph.PLLCFGR.PLLREN := 1; end if; -- Configure flash -- Must be done before increasing the frequency, otherwise the CPU -- won't be able to fetch new instructions. if HCLK in FLASH_Latency_0 then FLASH_Latency := FLASH_WS'Enum_Rep (FWS0); elsif HCLK in FLASH_Latency_1 then FLASH_Latency := FLASH_WS'Enum_Rep (FWS1); elsif HCLK in FLASH_Latency_2 then FLASH_Latency := FLASH_WS'Enum_Rep (FWS2); elsif HCLK in FLASH_Latency_3 then FLASH_Latency := FLASH_WS'Enum_Rep (FWS3); elsif HCLK in FLASH_Latency_4 then FLASH_Latency := FLASH_WS'Enum_Rep (FWS4); end if; -- Disable and reset Instruction cache FLASH_Periph.ACR.ICEN := 0; FLASH_Periph.ACR.ICRST := 1; FLASH_Periph.ACR.ICRST := 0; -- Disable and reset Data cache FLASH_Periph.ACR.DCEN := 0; FLASH_Periph.ACR.DCRST := 1; FLASH_Periph.ACR.DCRST := 0; FLASH_Periph.ACR := (LATENCY => FLASH_Latency, PRFTEN => 1, -- Prefetch enable ICEN => 1, -- Instruction cache enable DCEN => 1, -- Data cache enable others => <>); -- Configure derived clocks RCC_Periph.CFGR := (SW => SW_Value, HPRE => To_AHB (AHB_PRE), PPRE => (As_Array => True, Arr => (1 => To_APB (APB1_PRE), 2 => To_APB (APB2_PRE))), -- Microcontroller clock output MCOSEL => MCO_Clock_Source'Enum_Rep (MCOSEL_HSI), MCOPRE => MCO_Prescaler'Enum_Rep (MCOPRE_DIV1), others => <>); -- Test system clock switch status case SW is when SYSCLK_SRC_PLL => loop exit when RCC_Periph.CFGR.SWS = SYSCLK_Source'Enum_Rep (SYSCLK_SRC_PLL); end loop; when SYSCLK_SRC_HSE => loop exit when RCC_Periph.CFGR.SWS = SYSCLK_Source'Enum_Rep (SYSCLK_SRC_HSE); end loop; when SYSCLK_SRC_HSI => loop exit when RCC_Periph.CFGR.SWS = SYSCLK_Source'Enum_Rep (SYSCLK_SRC_HSI); end loop; end case; end Initialize_Clocks; ------------------ -- Reset_Clocks -- ------------------ procedure Reset_Clocks is begin -- Switch on high speed internal clock RCC_Periph.CR.HSION := 1; -- Reset CFGR regiser RCC_Periph.CFGR := (others => <>); -- Reset HSEON, CSSON and PLLON bits RCC_Periph.CR.HSEON := 0; RCC_Periph.CR.CSSON := 0; RCC_Periph.CR.PLLON := 0; -- Reset PLL configuration register RCC_Periph.PLLCFGR := (others => <>); -- Reset HSE bypass bit RCC_Periph.CR.HSEBYP := 0; -- Disable all interrupts RCC_Periph.CIER := (others => <>); end Reset_Clocks; begin Reset_Clocks; Initialize_Clocks; end Setup_Pll;
36.516949
79
0.543591
58e11ddcecb92e21762e485a0d41581d5f492add
18,315
adb
Ada
tests/phelix/test_phelix.adb
HeisenbugLtd/Saatana
d6f4b4d68f4c80c1872deeb2df3e8762df0c627b
[ "WTFPL" ]
10
2020-03-19T13:40:04.000Z
2021-08-03T00:17:02.000Z
tests/phelix/test_phelix.adb
HeisenbugLtd/security
69458f6039f89ea9e56995a9378d33b133dd4aff
[ "WTFPL" ]
8
2017-10-04T08:42:03.000Z
2020-02-10T09:56:29.000Z
tests/phelix/test_phelix.adb
HeisenbugLtd/security
69458f6039f89ea9e56995a9378d33b133dd4aff
[ "WTFPL" ]
null
null
null
------------------------------------------------------------------------------ -- Copyright (C) 2017-2020 by Heisenbug Ltd. ([email protected]) -- -- This work is free. You can redistribute it and/or modify it under the -- terms of the Do What The Fuck You Want To Public License, Version 2, -- as published by Sam Hocevar. See the LICENSE file for more details. ------------------------------------------------------------------------------ pragma License (Unrestricted); with Ada.Command_Line; with Ada.Text_IO; with Saatana.Crypto.Phelix.Test_Vectors; procedure Test_Phelix with SPARK_Mode => Off is pragma Assertion_Policy (Check); use type Saatana.Crypto.MAC_Stream; use type Saatana.Crypto.Stream_Offset; Num_Tests : Natural := 0; Num_Succeeded : Natural := 0; procedure Add_Test (Passed : in Boolean); procedure Add_Test (Passed : in Boolean) is begin Num_Tests := Num_Tests + 1; Num_Succeeded := (if Passed then Num_Succeeded + 1 else Num_Succeeded); if not Passed then Ada.Text_IO.Put_Line ("<ERR> Test" & Natural'Image (Num_Tests) & " failed!"); end if; end Add_Test; function Image (S : in Saatana.Crypto.General_Stream) return String; function Image (S : in Saatana.Crypto.General_Stream) return String is type Character_Lookup is array (Saatana.Crypto.Byte range <>) of Character; Result : String (1 .. S'Length * 2); Hex_Char : constant Character_Lookup (0 .. 15) := "0123456789ABCDEF"; use type Saatana.Crypto.Byte; begin for I in S'Range loop Result (Result'First + Natural (I - S'First) * 2) := Hex_Char (S (I) / 16); Result (Result'First + Natural (I - S'First) * 2 + 1) := Hex_Char (S (I) mod 16); end loop; return Result; end Image; Verbose : Boolean := False; KAT_Only : Boolean := False; begin Evaluate_Command_Line : for Number in 1 .. Ada.Command_Line.Argument_Count loop Check_Argument : declare Argument : constant String := Ada.Command_Line.Argument (Number => Number); begin if Argument = "--verbose" then Verbose := True; elsif Argument = "--kat-only" then KAT_Only := True; else Ada.Text_IO.Put_Line (File => Ada.Text_IO.Standard_Error, Item => "Unrecognized command line parameter """ & Argument & """ ignored."); end if; end Check_Argument; end loop Evaluate_Command_Line; Ada.Text_IO.Put_Line ("Running KAT (Known Answers Tests)..."); KAT_Loop : for T of Saatana.Crypto.Phelix.Test_Vectors.KAT loop Test_Encrypt_Decrypt : declare use type Saatana.Crypto.Ciphertext_Stream; use type Saatana.Crypto.Plaintext_Stream; use type Saatana.Crypto.Phelix.MAC_Size_32; Mac_Len : constant Saatana.Crypto.Phelix.MAC_Size_32 := 8 * T.MAC.all'Length; This : Saatana.Crypto.Phelix.Context; begin Saatana.Crypto.Phelix.Setup_Key (This => This, Key => T.Key.all, Mac_Size => Mac_Len); Test_Encrypt_Decrypt_Bytes : declare Result_Cipher : Saatana.Crypto.Ciphertext_Stream (T.Plaintext.all'Range); Result_Plaintext : Saatana.Crypto.Plaintext_Stream (T.Plaintext.all'Range); Result_MAC : Saatana.Crypto.MAC_Stream (0 .. Saatana.Crypto.Stream_Offset (Mac_Len) / 8 - 1); begin Saatana.Crypto.Phelix.Setup_Nonce (This => This, Nonce => T.Nonce.all); Saatana.Crypto.Phelix.Process_AAD (This => This, Aad => T.Aad.all); Saatana.Crypto.Phelix.Encrypt_Bytes (This => This, Source => T.Plaintext.all, Destination => Result_Cipher); Saatana.Crypto.Phelix.Finalize (This => This, Mac => Result_MAC); if Verbose then -- KAT input. Ada.Text_IO.Put_Line ("Key : " & Image (Saatana.Crypto.General_Stream (T.Key.all))); Ada.Text_IO.Put_Line ("Nonce : " & Image (Saatana.Crypto.General_Stream (T.Nonce.all))); Ada.Text_IO.Put_Line ("AAD : " & Image (Saatana.Crypto.General_Stream (T.Aad.all))); Ada.Text_IO.Put_Line ("Plaintext : " & Image (Saatana.Crypto.General_Stream (T.Plaintext.all))); -- Computed output, being compared with expected from KAT vector. Ada.Text_IO.Put_Line ("Ciphertext: " & Image (Saatana.Crypto.General_Stream (Result_Cipher))); Ada.Text_IO.Put_Line ("MAC : " & Image (Saatana.Crypto.General_Stream (Result_MAC))); Ada.Text_IO.New_Line; end if; Add_Test (Result_Cipher = T.Cipher.all); Add_Test (Result_MAC = T.MAC.all); Saatana.Crypto.Phelix.Setup_Nonce (This => This, Nonce => T.Nonce.all); Saatana.Crypto.Phelix.Process_AAD (This => This, Aad => T.Aad.all); Saatana.Crypto.Phelix.Decrypt_Bytes (This => This, Source => T.Cipher.all, Destination => Result_Plaintext); Saatana.Crypto.Phelix.Finalize (This => This, Mac => Result_MAC); Add_Test (Result_Plaintext = T.Plaintext.all); Add_Test (Result_MAC = T.MAC.all); -- Same as above, but with byte-for-byte en/de-cryption. This -- is done to verify that the implementation actually works as a -- stream cipher. -- NOTE: Phelix does still require processing of 32-bit words in -- each step, so we cannot exactly call it byte-for-byte -- processing. If an actual implementation needs to encrypt -- a stream in a byte-for-byte manner, it needs to store up -- to four bytes of the plaintext or cipher stream before -- calling Encrypt/Decrypt_Bytes. Saatana.Crypto.Phelix.Setup_Nonce (This => This, Nonce => T.Nonce.all); Saatana.Crypto.Phelix.Process_AAD (This => This, Aad => T.Aad.all); Loop_Over_Plaintext_Bytes : for I in T.Plaintext.all'Range loop if I mod 4 = 0 then Process_Plaintext_Word : declare Last_Byte : constant Saatana.Crypto.Stream_Index := Saatana.Crypto.Stream_Index'Min (I + 3, T.Plaintext.all'Last); begin -- Process only on word boundaries. Saatana.Crypto.Phelix.Encrypt_Bytes (This => This, Source => T.Plaintext.all (I .. Last_Byte), Destination => Result_Cipher (I .. Last_Byte)); end Process_Plaintext_Word; end if; end loop Loop_Over_Plaintext_Bytes; Saatana.Crypto.Phelix.Finalize (This => This, Mac => Result_MAC); Add_Test (Result_Cipher = T.Cipher.all); Add_Test (Result_MAC = T.MAC.all); Saatana.Crypto.Phelix.Setup_Nonce (This => This, Nonce => T.Nonce.all); Saatana.Crypto.Phelix.Process_AAD (This => This, Aad => T.Aad.all); Loop_Over_Ciphertext_Bytes : for I in T.Cipher.all'Range loop if I mod 4 = 0 then Process_Ciphertext_Word : declare Last_Byte : constant Saatana.Crypto.Stream_Index := Saatana.Crypto.Stream_Index'Min (I + 3, T.Plaintext.all'Last); begin Saatana.Crypto.Phelix.Decrypt_Bytes (This => This, Source => T.Cipher.all (I .. Last_Byte), Destination => Result_Plaintext (I .. Last_Byte)); end Process_Ciphertext_Word; end if; end loop Loop_Over_Ciphertext_Bytes; Saatana.Crypto.Phelix.Finalize (This => This, Mac => Result_MAC); Add_Test (Result_Plaintext = T.Plaintext.all); Add_Test (Result_MAC = T.MAC.all); end Test_Encrypt_Decrypt_Bytes; Test_Encrypt_Decrypt_Packets : declare Enc_Packet : Saatana.Crypto.Ciphertext_Stream (0 .. T.Plaintext.all'Length + T.Aad.all'Length - 1); Dec_Packet : Saatana.Crypto.Plaintext_Stream (0 .. T.Plaintext.all'Length + T.Aad.all'Length - 1); Result_MAC : Saatana.Crypto.MAC_Stream (0 .. Saatana.Crypto.Stream_Offset (Mac_Len) / 8 - 1); begin Saatana.Crypto.Phelix.Encrypt_Packet (This => This, Nonce => T.Nonce.all, Header => T.Aad.all, Payload => T.Plaintext.all, Packet => Enc_Packet, Mac => Result_MAC); Add_Test (Saatana.Crypto.Ciphertext_Stream (T.Aad.all) & T.Cipher.all = Enc_Packet); Add_Test (Result_MAC = T.MAC.all); Saatana.Crypto.Phelix.Decrypt_Packet (This => This, Nonce => T.Nonce.all, Header => T.Aad.all, Payload => T.Cipher.all, Packet => Dec_Packet, Mac => Result_MAC); Add_Test (T.Aad.all & T.Plaintext.all = Dec_Packet); Add_Test (Result_MAC = T.MAC.all); end Test_Encrypt_Decrypt_Packets; end Test_Encrypt_Decrypt; end loop KAT_Loop; if not KAT_Only then Ada.Text_IO.Put_Line ("Running additional ""Transmit"" tests..."); Transmit_Tests : declare KEY_LENGTH : constant := Saatana.Crypto.Phelix.Max_Key_Size / 8; MAC_LENGTH : constant := Saatana.Crypto.Phelix.Max_MAC_Size / 8; NONCE_LENGTH : constant := Saatana.Crypto.Phelix.Max_Nonce_Size / 8; NONCE_FIRST : constant Saatana.Crypto.Stream_Offset := 0; NONCE_LAST : constant Saatana.Crypto.Stream_Offset := NONCE_FIRST + NONCE_LENGTH - 1; MAC_FIRST : constant Saatana.Crypto.Stream_Offset := NONCE_LAST + 1; MAC_LAST : constant Saatana.Crypto.Stream_Offset := MAC_FIRST + MAC_LENGTH - 1; EMPTY : constant Saatana.Crypto.General_Stream := (1 .. 0 => 0); use type Saatana.Crypto.Byte; use type Saatana.Crypto.Ciphertext_Stream; use type Saatana.Crypto.Key_Stream; use type Saatana.Crypto.Nonce_Stream; use type Saatana.Crypto.Phelix.MAC_Size_32; procedure Send_Nonce (Key : in Saatana.Crypto.Key_Stream; Nonce : in Saatana.Crypto.Nonce_Stream; Packet : out Saatana.Crypto.Ciphertext_Stream); procedure Receive_Nonce (Key : in Saatana.Crypto.Key_Stream; Packet : in Saatana.Crypto.Ciphertext_Stream; Authenticated : out Boolean); procedure Receive_Nonce (Key : in Saatana.Crypto.Key_Stream; Packet : in Saatana.Crypto.Ciphertext_Stream; Authenticated : out Boolean) is Ctx : Saatana.Crypto.Phelix.Context; Mac : Saatana.Crypto.MAC_Stream (0 .. MAC_LENGTH - 1); Nonce : constant Saatana.Crypto.Nonce_Stream := Saatana.Crypto.Nonce_Stream (Packet (NONCE_FIRST .. NONCE_LAST)); Received_Nonce : Saatana.Crypto.Nonce_Stream (0 .. NONCE_LENGTH - 1); begin Saatana.Crypto.Phelix.Setup_Key (This => Ctx, Key => Key, Mac_Size => MAC_LENGTH * 8); -- Verify received packet. Saatana.Crypto.Phelix.Decrypt_Packet (This => Ctx, Nonce => Nonce, Header => Saatana.Crypto.Plaintext_Stream (Nonce), Payload => Saatana.Crypto.Ciphertext_Stream (EMPTY), Packet => Saatana.Crypto.Plaintext_Stream (Received_Nonce), Mac => Mac); -- MAC must match, otherwise someone tampered with our packet. Authenticated := Mac = Saatana.Crypto.MAC_Stream (Packet (MAC_FIRST .. MAC_LAST)); end Receive_Nonce; procedure Send_Nonce (Key : in Saatana.Crypto.Key_Stream; Nonce : in Saatana.Crypto.Nonce_Stream; Packet : out Saatana.Crypto.Ciphertext_Stream) is Ctx : Saatana.Crypto.Phelix.Context; begin Saatana.Crypto.Phelix.Setup_Key (This => Ctx, Key => Key, Mac_Size => MAC_LENGTH * 8); -- Transmit that Nonce to the client. Saatana.Crypto.Phelix.Encrypt_Packet (This => Ctx, Nonce => Nonce, Header => Saatana.Crypto.Plaintext_Stream (Nonce), Payload => Saatana.Crypto.Plaintext_Stream (EMPTY), Packet => Packet (NONCE_FIRST .. NONCE_LAST), Mac => Saatana.Crypto.MAC_Stream (Packet (MAC_FIRST .. MAC_LAST))); end Send_Nonce; Key : Saatana.Crypto.Key_Stream (0 .. KEY_LENGTH - 1); Nonce : Saatana.Crypto.Nonce_Stream (0 .. NONCE_LENGTH - 1); Packet : Saatana.Crypto.Ciphertext_Stream (NONCE_FIRST .. MAC_LAST); Authenticated : Boolean; begin -- Communication setup. Key := (others => 0); -- Generate random/unique nonce. Nonce := (others => 0); Check_MAC_Handling : for I in 1 .. 1024 loop Send_Nonce (Key => Key, Nonce => Nonce, Packet => Packet); if Verbose then Ada.Text_IO.Put_Line ("Key : " & Image (Saatana.Crypto.General_Stream (Key))); Ada.Text_IO.Put_Line ("Nonce : " & Image (Saatana.Crypto.General_Stream (Nonce))); Ada.Text_IO.Put_Line ("Packet: " & Image (Saatana.Crypto.General_Stream (Packet))); Ada.Text_IO.New_Line; end if; -- Check if the MAC matches with whatever has been sent. Receive_Nonce (Key => Key, Packet => Packet, Authenticated => Authenticated); Add_Test (Authenticated); -- Tamper with the packet. Authentication should fail now. Receive_Nonce (Key => Key, Packet => (Packet (Packet'First) xor 1) & Packet (Packet'First + 1 .. Packet'Last), Authenticated => Authenticated); Add_Test (not Authenticated); -- Use Nonce and MAC as new Key and increment the nonce. Key := Saatana.Crypto.Key_Stream (Packet (MAC_FIRST .. MAC_LAST)) & Key (NONCE_FIRST .. NONCE_LAST); -- "Randomly" advance Nonce. -- -- We take the current key stream, null out its two low order bytes, -- and the result is being added Key (0) * Key (1) times to Nonce to -- create a new seemingly random Nonce. Shuffle_Nonce : declare Operand : constant Saatana.Crypto.Nonce_Stream := Saatana.Crypto.Nonce_Stream (Key (Key'First .. Key'First + 13) & (14 .. NONCE_LENGTH - 1 => 0)); begin Loop_For_First_Byte_Of_Key : for J in 1 .. Key (Key'First) loop Loop_For_Second_Byte_Of_Key : for K in 1 .. Key (Key'First + 1) loop Nonce := Nonce + Operand; end loop Loop_For_Second_Byte_Of_Key; end loop Loop_For_First_Byte_Of_Key; end Shuffle_Nonce; end loop Check_MAC_Handling; -- Check for any regressions. If, after all this Nonce shuffling above, -- the last packet is still the expected one, we are good. Add_Test (Image (Saatana.Crypto.General_Stream (Packet)) = "8F636CA7CC87C0AC88B35964B605E0005A586B0519BA64C6245C8724D3BEDAF1"); end Transmit_Tests; end if; -- KAT only requested Ada.Text_IO.Put_Line ("Test results:" & Natural'Image (Num_Succeeded) & " out of" & Natural'Image (Num_Tests) & " succeeded."); Ada.Text_IO.Put_Line (if Num_Tests = Num_Succeeded then "<OK>" else "<FAILED>"); Ada.Command_Line.Set_Exit_Status (Code => (if Num_Tests = Num_Succeeded then Ada.Command_Line.Success else Ada.Command_Line.Failure)); end Test_Phelix;
48.452381
113
0.517827
a17309f69493bd4764fcfe526b64956a0e5cead4
164
ads
Ada
src/random.ads
JeremyGrosser/the_grid
cf2956be1bdf9bae5adc96a41aac3fa7416e929c
[ "BSD-3-Clause" ]
null
null
null
src/random.ads
JeremyGrosser/the_grid
cf2956be1bdf9bae5adc96a41aac3fa7416e929c
[ "BSD-3-Clause" ]
null
null
null
src/random.ads
JeremyGrosser/the_grid
cf2956be1bdf9bae5adc96a41aac3fa7416e929c
[ "BSD-3-Clause" ]
null
null
null
with HAL; use HAL; package Random is function Next return UInt16; function In_Range (First, Last : Natural) return Natural; end Random;
12.615385
29
0.646341
58718ded4b31a0fe044d7de71f32c708899b9e8b
569
adb
Ada
dependencies/agar/ada-gui/agar-gui-widget-separator.adb
amvb/GUCEF
08fd423bbb5cdebbe4b70df24c0ae51716b65825
[ "Apache-2.0" ]
286
2017-07-31T20:05:16.000Z
2022-03-26T20:26:24.000Z
dependencies/agar/ada-gui/agar-gui-widget-separator.adb
amvb/GUCEF
08fd423bbb5cdebbe4b70df24c0ae51716b65825
[ "Apache-2.0" ]
67
2017-08-30T18:56:21.000Z
2021-09-08T03:38:20.000Z
dependencies/agar/ada-gui/agar-gui-widget-separator.adb
amvb/GUCEF
08fd423bbb5cdebbe4b70df24c0ae51716b65825
[ "Apache-2.0" ]
31
2017-08-14T13:34:12.000Z
2022-03-14T15:33:49.000Z
package body agar.gui.widget.separator is package cbinds is procedure set_padding (separator : separator_access_t; pixels : c.int); pragma import (c, set_padding, "AG_SeparatorSetPadding"); end cbinds; procedure set_padding (separator : separator_access_t; pixels : natural) is begin cbinds.set_padding (separator, c.int (pixels)); end set_padding; function widget (separator : separator_access_t) return widget_access_t is begin return separator.widget'access; end widget; end agar.gui.widget.separator;
24.73913
76
0.718805
227c2e498d7bb4dc34a9dc637c4139f5475a3816
2,750
ads
Ada
Validation/pyFrame3DD-master/gcc-master/gcc/ada/libgnat/g-soliop__lynxos.ads
djamal2727/Main-Bearing-Analytical-Model
2f00c2219c71be0175c6f4f8f1d4cca231d97096
[ "Apache-2.0" ]
null
null
null
Validation/pyFrame3DD-master/gcc-master/gcc/ada/libgnat/g-soliop__lynxos.ads
djamal2727/Main-Bearing-Analytical-Model
2f00c2219c71be0175c6f4f8f1d4cca231d97096
[ "Apache-2.0" ]
null
null
null
Validation/pyFrame3DD-master/gcc-master/gcc/ada/libgnat/g-soliop__lynxos.ads
djamal2727/Main-Bearing-Analytical-Model
2f00c2219c71be0175c6f4f8f1d4cca231d97096
[ "Apache-2.0" ]
null
null
null
------------------------------------------------------------------------------ -- -- -- GNAT COMPILER COMPONENTS -- -- -- -- G N A T . S O C K E T S . L I N K E R _ O P T I O N S -- -- -- -- S p e c -- -- -- -- Copyright (C) 2001-2020, AdaCore -- -- -- -- GNAT 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 3, or (at your option) any later ver- -- -- sion. GNAT 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. -- -- -- -- As a special exception under Section 7 of GPL version 3, you are granted -- -- additional permissions described in the GCC Runtime Library Exception, -- -- version 3.1, as published by the Free Software Foundation. -- -- -- -- You should have received a copy of the GNU General Public License and -- -- a copy of the GCC Runtime Library Exception along with this program; -- -- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- -- <http://www.gnu.org/licenses/>. -- -- -- -- GNAT was originally developed by the GNAT team at New York University. -- -- Extensive contributions were provided by Ada Core Technologies Inc. -- -- -- ------------------------------------------------------------------------------ -- This package is used to provide target specific linker_options for the -- support of sockets as required by the package GNAT.Sockets. -- This is the LynxOS version of this package -- This package should not be directly with'ed by an application program package GNAT.Sockets.Linker_Options is private pragma Linker_Options ("-lbsd"); end GNAT.Sockets.Linker_Options;
63.953488
78
0.419636
1a5189cf1db23e987b3c976574a7d573a733eb9e
5,705
adb
Ada
tests/crafts-test_data-tests.adb
thindil/steamsky
d5d7fea622f7994c91017c4cd7ba5e188153556c
[ "TCL", "MIT" ]
80
2017-04-08T23:14:07.000Z
2022-02-10T22:30:51.000Z
tests/crafts-test_data-tests.adb
thindil/steamsky
d5d7fea622f7994c91017c4cd7ba5e188153556c
[ "TCL", "MIT" ]
89
2017-06-24T08:18:26.000Z
2021-11-12T04:37:36.000Z
tests/crafts-test_data-tests.adb
thindil/steamsky
d5d7fea622f7994c91017c4cd7ba5e188153556c
[ "TCL", "MIT" ]
9
2018-04-14T16:37:25.000Z
2020-03-21T14:33:49.000Z
-- This package has been generated automatically by GNATtest. -- You are allowed to add your code to the bodies of test routines. -- Such changes will be kept during further regeneration of this file. -- All code placed outside of test routine bodies will be lost. The -- code intended to set up and tear down the test environment should be -- placed into Crafts.Test_Data. with AUnit.Assertions; use AUnit.Assertions; with System.Assertions; -- begin read only -- id:2.2/00/ -- -- This section can be used to add with clauses if necessary. -- -- end read only with Ships.Cargo; use Ships.Cargo; -- begin read only -- end read only package body Crafts.Test_Data.Tests is -- begin read only -- id:2.2/01/ -- -- This section can be used to add global variables and other elements. -- -- end read only -- begin read only -- end read only -- begin read only procedure Wrap_Test_Manufacturing_dd583a_cf804c(Minutes: Positive) is begin GNATtest_Generated.GNATtest_Standard.Crafts.Manufacturing(Minutes); end Wrap_Test_Manufacturing_dd583a_cf804c; -- end read only -- begin read only procedure Test_Manufacturing_test_manufacturing(Gnattest_T: in out Test); procedure Test_Manufacturing_dd583a_cf804c(Gnattest_T: in out Test) renames Test_Manufacturing_test_manufacturing; -- id:2.2/dd583af67efcd5dc/Manufacturing/1/0/test_manufacturing/ procedure Test_Manufacturing_test_manufacturing(Gnattest_T: in out Test) is procedure Manufacturing(Minutes: Positive) renames Wrap_Test_Manufacturing_dd583a_cf804c; -- end read only pragma Unreferenced(Gnattest_T); begin Manufacturing(15); Assert(True, "This test can only crash."); -- begin read only end Test_Manufacturing_test_manufacturing; -- end read only -- begin read only function Wrap_Test_CheckRecipe_6b22c5_37e1c4 (RecipeIndex: Unbounded_String) return Positive is begin begin pragma Assert(RecipeIndex /= Null_Unbounded_String); null; exception when System.Assertions.Assert_Failure => AUnit.Assertions.Assert (False, "req_sloc(crafts.ads:0):Test_CheckRecipe test requirement violated"); end; declare Test_CheckRecipe_6b22c5_37e1c4_Result: constant Positive := GNATtest_Generated.GNATtest_Standard.Crafts.CheckRecipe (RecipeIndex); begin begin pragma Assert(True); null; exception when System.Assertions.Assert_Failure => AUnit.Assertions.Assert (False, "ens_sloc(crafts.ads:0:):Test_CheckRecipe test commitment violated"); end; return Test_CheckRecipe_6b22c5_37e1c4_Result; end; end Wrap_Test_CheckRecipe_6b22c5_37e1c4; -- end read only -- begin read only procedure Test_CheckRecipe_test_checkrecipe(Gnattest_T: in out Test); procedure Test_CheckRecipe_6b22c5_37e1c4(Gnattest_T: in out Test) renames Test_CheckRecipe_test_checkrecipe; -- id:2.2/6b22c50e71f35d02/CheckRecipe/1/0/test_checkrecipe/ procedure Test_CheckRecipe_test_checkrecipe(Gnattest_T: in out Test) is function CheckRecipe (RecipeIndex: Unbounded_String) return Positive renames Wrap_Test_CheckRecipe_6b22c5_37e1c4; -- end read only pragma Unreferenced(Gnattest_T); begin UpdateCargo(Player_Ship, To_Unbounded_String("6"), 10); Assert (CheckRecipe(To_Unbounded_String("1")) = 10, "Failed to check crafting recipe requirements."); -- begin read only end Test_CheckRecipe_test_checkrecipe; -- end read only -- begin read only procedure Wrap_Test_SetRecipe_d9013b_447571 (Workshop, Amount: Positive; RecipeIndex: Unbounded_String) is begin begin pragma Assert ((Workshop <= Player_Ship.Modules.Last_Index and RecipeIndex /= Null_Unbounded_String)); null; exception when System.Assertions.Assert_Failure => AUnit.Assertions.Assert (False, "req_sloc(crafts.ads:0):Test_SetRecipe test requirement violated"); end; GNATtest_Generated.GNATtest_Standard.Crafts.SetRecipe (Workshop, Amount, RecipeIndex); begin pragma Assert(True); null; exception when System.Assertions.Assert_Failure => AUnit.Assertions.Assert (False, "ens_sloc(crafts.ads:0:):Test_SetRecipe test commitment violated"); end; end Wrap_Test_SetRecipe_d9013b_447571; -- end read only -- begin read only procedure Test_SetRecipe_test_setrecipe(Gnattest_T: in out Test); procedure Test_SetRecipe_d9013b_447571(Gnattest_T: in out Test) renames Test_SetRecipe_test_setrecipe; -- id:2.2/d9013bfcb0ae8d7e/SetRecipe/1/0/test_setrecipe/ procedure Test_SetRecipe_test_setrecipe(Gnattest_T: in out Test) is procedure SetRecipe (Workshop, Amount: Positive; RecipeIndex: Unbounded_String) renames Wrap_Test_SetRecipe_d9013b_447571; -- end read only pragma Unreferenced(Gnattest_T); begin UpdateCargo(Player_Ship, To_Unbounded_String("6"), 10); SetRecipe(9, 10, To_Unbounded_String("1")); Assert (Player_Ship.Modules(9).Crafting_Amount = 10, "Failed to set crafting recipe."); -- begin read only end Test_SetRecipe_test_setrecipe; -- end read only -- begin read only -- id:2.2/02/ -- -- This section can be used to add elaboration code for the global state. -- begin -- end read only null; -- begin read only -- end read only end Crafts.Test_Data.Tests;
31.346154
87
0.69816
3d103770aab18bb1152681443cd37ad7dfcef5b4
1,710
adb
Ada
src/are-main.adb
stcarrez/resource-embedder
b1134306db459f87506703ba0a266c0b5e0045b9
[ "Apache-2.0" ]
7
2021-06-04T16:58:59.000Z
2021-06-14T08:51:11.000Z
src/are-main.adb
stcarrez/resource-embedder
b1134306db459f87506703ba0a266c0b5e0045b9
[ "Apache-2.0" ]
2
2021-07-20T15:25:33.000Z
2021-08-20T18:39:58.000Z
src/are-main.adb
stcarrez/resource-embedder
b1134306db459f87506703ba0a266c0b5e0045b9
[ "Apache-2.0" ]
null
null
null
----------------------------------------------------------------------- -- are-main -- Main tool program -- Copyright (C) 2021 Stephane Carrez -- Written by Stephane Carrez ([email protected]) -- -- 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. ----------------------------------------------------------------------- with Ada.IO_Exceptions; with Ada.Command_Line; with Ada.Exceptions; with GNAT.Command_Line; with Util.Log.Loggers; with Are.Generator; procedure Are.Main is Log : constant Util.Log.Loggers.Logger := Util.Log.Loggers.Create ("Are.Main"); begin Are.Configure_Logs (Debug => False, Verbose => False); Are.Generator.Main; exception when GNAT.Command_Line.Exit_From_Command_Line | GNAT.Command_Line.Invalid_Switch => Ada.Command_Line.Set_Exit_Status (Ada.Command_Line.Failure); when E : Ada.IO_Exceptions.Name_Error => Log.Error (-("cannot access file: {0}"), Ada.Exceptions.Exception_Message (E)); Ada.Command_Line.Set_Exit_Status (Ada.Command_Line.Failure); when E : others => Log.Error (-("some internal error occurred"), E, True); Ada.Command_Line.Set_Exit_Status (Ada.Command_Line.Failure); end Are.Main;
34.897959
86
0.666667
c745c9ec4be7e33a985a3dd3931d353c9a80bcd7
18,436
adb
Ada
sources/jupyter/jupyter-start_kernel.adb
reznikmm/jupyter
159f8ae87a3da8bf66e059db07b23de826d81293
[ "MIT" ]
4
2020-06-17T16:45:16.000Z
2022-01-19T22:55:48.000Z
sources/jupyter/jupyter-start_kernel.adb
reznikmm/jupyter
159f8ae87a3da8bf66e059db07b23de826d81293
[ "MIT" ]
null
null
null
sources/jupyter/jupyter-start_kernel.adb
reznikmm/jupyter
159f8ae87a3da8bf66e059db07b23de826d81293
[ "MIT" ]
null
null
null
-- SPDX-FileCopyrightText: 2020 Max Reznik <[email protected]> -- -- SPDX-License-Identifier: MIT ---------------------------------------------------------------- with Ada.Characters.Wide_Wide_Latin_1; with Ada.Containers.Doubly_Linked_Lists; with Ada.Containers.Hashed_Maps; with Ada.Wide_Wide_Text_IO; with GNAT.SHA256; with Interfaces.C; with League.Text_Codecs; with League.Holders; with League.JSON.Documents; with League.JSON.Objects; with League.JSON.Values; with League.Stream_Element_Vectors; with League.Strings; with League.Strings.Hash; with ZMQ.Contexts; with ZMQ.Messages; with ZMQ.Sockets; with ZMQ.Low_Level; procedure Jupyter.Start_Kernel (Kernel : in out Jupyter.Kernels.Kernel'Class; File : League.Strings.Universal_String) is function "+" (Text : Wide_Wide_String) return League.Strings.Universal_String renames League.Strings.To_Universal_String; function "-" (Text : Wide_Wide_String) return League.JSON.Values.JSON_Value; procedure Read_Connection_File (Name : League.Strings.Universal_String; Result : out League.JSON.Objects.JSON_Object); procedure Bind (Ctx : ZMQ.Contexts.Context; Socket : in out ZMQ.Sockets.Socket; CF : League.JSON.Objects.JSON_Object; Port : Wide_Wide_String; Kind : ZMQ.Sockets.Socket_Type); type Frontend_Connection is record Ctx : ZMQ.Contexts.Context; Key : League.Strings.Universal_String; Shell : ZMQ.Sockets.Socket; Stdin : ZMQ.Sockets.Socket; IOPub : ZMQ.Sockets.Socket; Control : ZMQ.Sockets.Socket; Ping : ZMQ.Sockets.Socket; Msg_Id : Integer := -1; end record; package IO_Pubs is type IO_Pub (Up : not null access Frontend_Connection) is new Jupyter.Kernels.IO_Pub with record Request : League.JSON.Objects.JSON_Object; Id : Positive; Count : Positive; end record; overriding procedure Stream (Self : in out IO_Pub; Name : League.Strings.Universal_String; Text : League.Strings.Universal_String); overriding procedure Display_Data (Self : in out IO_Pub; Data : League.JSON.Objects.JSON_Object; Metadata : League.JSON.Objects.JSON_Object; Transient : League.JSON.Objects.JSON_Object); overriding procedure Update_Display_Data (Self : in out IO_Pub; Data : League.JSON.Objects.JSON_Object; Metadata : League.JSON.Objects.JSON_Object; Transient : League.JSON.Objects.JSON_Object); overriding procedure Execute_Result (Self : in out IO_Pub; Data : League.JSON.Objects.JSON_Object; Metadata : League.JSON.Objects.JSON_Object; Transient : League.JSON.Objects.JSON_Object); overriding procedure Execute_Error (Self : in out IO_Pub; Value : Jupyter.Kernels.Execution_Error); overriding procedure Clear_Output (Self : in out IO_Pub; Wait : Boolean); overriding procedure Debug_Event (Self : in out IO_Pub; Content : League.JSON.Objects.JSON_Object); end IO_Pubs; package Address_Lists is new Ada.Containers.Doubly_Linked_Lists (League.Stream_Element_Vectors.Stream_Element_Vector, League.Stream_Element_Vectors."="); function "-" (Text : League.Strings.Universal_String) return Address_Lists.List; procedure Send_Message (Socket : in out ZMQ.Sockets.Socket; Msg_Id : in out Integer; To : Address_Lists.List; Key : League.Strings.Universal_String; Kind : Wide_Wide_String; Parent : League.JSON.Objects.JSON_Object := League.JSON.Objects.Empty_JSON_Object; Content : League.JSON.Objects.JSON_Object := League.JSON.Objects.Empty_JSON_Object); package body IO_Pubs is separate; type Message is record From : Address_Lists.List; Signature : League.Strings.Universal_String; Header : League.JSON.Objects.JSON_Object; Parent : League.JSON.Objects.JSON_Object; Metadata : League.JSON.Objects.JSON_Object; Content : League.JSON.Objects.JSON_Object; end record; procedure Read_Message (Socket : ZMQ.Sockets.Socket; Key : League.Strings.Universal_String; Result : out Message); procedure Process_Shell_Message (Frontend : aliased in out Frontend_Connection; Request : Message); function Has_More (Message : ZMQ.Messages.Message) return Boolean; type Session_Information is record Id : Positive; Count : Positive; end record; package Session_Maps is new Ada.Containers.Hashed_Maps (Key_Type => League.Strings.Universal_String, Element_Type => Session_Information, Hash => League.Strings.Hash, Equivalent_Keys => League.Strings."="); Next_Id : Positive := 1; Map : Session_Maps.Map; --------- -- "-" -- --------- function "-" (Text : Wide_Wide_String) return League.JSON.Values.JSON_Value is begin return League.JSON.Values.To_JSON_Value (+Text); end "-"; --------- -- "-" -- --------- function "-" (Text : League.Strings.Universal_String) return Address_Lists.List is Codec : constant League.Text_Codecs.Text_Codec := League.Text_Codecs.Codec_For_Application_Locale; begin return Result : Address_Lists.List do Result.Append (Codec.Encode (Text)); end return; end "-"; ---------- -- Bind -- ---------- procedure Bind (Ctx : ZMQ.Contexts.Context; Socket : in out ZMQ.Sockets.Socket; CF : League.JSON.Objects.JSON_Object; Port : Wide_Wide_String; Kind : ZMQ.Sockets.Socket_Type) is Image : constant String := CF.Value (+Port).To_Integer'Img; Address : constant String := CF.Value (+"transport").To_String.To_UTF_8_String & "://" & CF.Value (+"ip").To_String.To_UTF_8_String & ":" & Image (2 .. Image'Last); begin Socket.Initialize (Ctx, Kind); Socket.Bind (Address); end Bind; -------------- -- Has_More -- -------------- function Has_More (Message : ZMQ.Messages.Message) return Boolean is use type Interfaces.C.int; begin return ZMQ.Low_Level.zmq_msg_more (Message.GetImpl) /= 0; end Has_More; ------------- -- Process -- ------------- procedure Process_Shell_Message (Frontend : aliased in out Frontend_Connection; Request : Message) is use type League.Strings.Universal_String; Topic : League.Strings.Universal_String; Reply : League.JSON.Objects.JSON_Object; Action : League.Strings.Universal_String := Request.Header.Value (+"msg_type").To_String; begin if Action.Ends_With ("_request") then Action := Action.Head_To (Action.Length - 8); Topic := Action & "_reply"; else -- No _request in msg_type, ignore it return; end if; declare Content : League.JSON.Objects.JSON_Object; begin Content.Insert (+"execution_state", -"busy"); Send_Message (Frontend.IOPub, Frontend.Msg_Id, -Topic, Frontend.Key, "status", Parent => Request.Header, Content => Content); end; if Action = +"kernel_info" then Kernel.Kernel_Info (Reply); Send_Message (Frontend.Shell, Frontend.Msg_Id, Request.From, Frontend.Key, "kernel_info_reply", Parent => Request.Header, Content => Reply); elsif Action = +"execute" then declare S : constant League.Strings.Universal_String := Request.Header.Value (+"session").To_String; Input : League.JSON.Objects.JSON_Object := Request.Content; Values : League.JSON.Objects.JSON_Object; Error : Jupyter.Kernels.Execution_Error; Object : Jupyter.Kernels.Session_Access; Count : League.Holders.Universal_Integer; IO_Pub : aliased IO_Pubs.IO_Pub := (Frontend'Unchecked_Access, Request.Header, others => <>); begin if not Map.Contains (S) then IO_Pub.Id := Next_Id; IO_Pub.Count := 1; Count := 1; Kernel.Create_Session (IO_Pub.Id, Object); Map.Insert (S, (IO_Pub.Id, IO_Pub.Count)); Next_Id := Next_Id + 1; else Map (S).Count := Map (S).Count + 1; IO_Pub.Id := Map (S).Id; IO_Pub.Count := Map (S).Count; Object := Kernel.Get_Session (IO_Pub.Id); Count := League.Holders.Universal_Integer (IO_Pub.Count); end if; Input.Insert (+"execution_count", League.JSON.Values.To_JSON_Value (Count)); Send_Message (Frontend.IOPub, Frontend.Msg_Id, -(+"execute_input"), Frontend.Key, "execute_input", Parent => Request.Header, Content => Input); Object.Execute (IO_Pub => IO_Pub'Unchecked_Access, Execution_Counter => IO_Pub.Count, Code => Input.Value (+"code").To_String, Silent => Input.Value (+"silent").To_Boolean, User_Expressions => Input.Value (+"user_expressions").To_Object, Allow_Stdin => Input.Value (+"allow_stdin").To_Boolean, Stop_On_Error => Input.Value (+"stop_on_error").To_Boolean, Expression_Values => Values, Error => Error); Reply.Insert (+"execution_count", League.JSON.Values.To_JSON_Value (Count)); if Error.Name.Is_Empty then Reply.Insert (+"status", -"ok"); Reply.Insert (+"user_expressions", Values.To_JSON_Value); else Reply.Insert (+"status", -"error"); Reply.Insert (+"ename", League.JSON.Values.To_JSON_Value (Error.Name)); Reply.Insert (+"evalue", League.JSON.Values.To_JSON_Value (Error.Value)); -- FIXME: Copy traceback end if; Send_Message (Frontend.Shell, Frontend.Msg_Id, Request.From, Frontend.Key, "execute_reply", Parent => Request.Header, Content => Reply); end; end if; declare Content : League.JSON.Objects.JSON_Object; begin Content.Insert (+"execution_state", -"idle"); Send_Message (Frontend.IOPub, Frontend.Msg_Id, -Topic, Frontend.Key, "status", Parent => Request.Header, Content => Content); end; end Process_Shell_Message; -------------------------- -- Read_Connection_File -- -------------------------- procedure Read_Connection_File (Name : League.Strings.Universal_String; Result : out League.JSON.Objects.JSON_Object) is Input : Ada.Wide_Wide_Text_IO.File_Type; Text : League.Strings.Universal_String; Doc : League.JSON.Documents.JSON_Document; begin Ada.Wide_Wide_Text_IO.Open (Input, Ada.Wide_Wide_Text_IO.In_File, Name.To_UTF_8_String); while not Ada.Wide_Wide_Text_IO.End_Of_File (Input) loop declare Line : constant Wide_Wide_String := Ada.Wide_Wide_Text_IO.Get_Line (Input); begin Text.Append (Line); Text.Append (Ada.Characters.Wide_Wide_Latin_1.LF); end; end loop; Ada.Wide_Wide_Text_IO.Close (Input); Doc := League.JSON.Documents.From_JSON (Text); Result := Doc.To_JSON_Object; end Read_Connection_File; ------------------ -- Read_Message -- ------------------ procedure Read_Message (Socket : ZMQ.Sockets.Socket; Key : League.Strings.Universal_String; Result : out Message) is procedure Read_Object (Object : out League.JSON.Objects.JSON_Object; More : out Boolean); Digest : GNAT.SHA256.Context := GNAT.SHA256.HMAC_Initial_Context (Key.To_UTF_8_String); ----------------- -- Read_Object -- ----------------- procedure Read_Object (Object : out League.JSON.Objects.JSON_Object; More : out Boolean) is MSG : ZMQ.Messages.Message; begin MSG.Initialize (0); Socket.Recv (MSG); declare Text : constant String := MSG.GetData; begin More := Has_More (MSG); GNAT.SHA256.Update (Digest, Text); Object := League.JSON.Documents.From_JSON (League.Strings.From_UTF_8_String (Text)).To_JSON_Object; end; end Read_Object; More : Boolean; begin loop declare From : ZMQ.Messages.Message; Item : League.Stream_Element_Vectors.Stream_Element_Vector; begin From.Initialize (0); Socket.Recv (From); exit when From.GetData = "<IDS|MSG>"; Item := League.Stream_Element_Vectors.To_Stream_Element_Vector (From.GetData); Result.From.Append (Item); pragma Assert (Has_More (From)); end; end loop; Result.Signature := League.Strings.From_UTF_8_String (Socket.Recv); Read_Object (Result.Header, More); pragma Assert (More); Read_Object (Result.Parent, More); pragma Assert (More); Read_Object (Result.Metadata, More); pragma Assert (More); Read_Object (Result.Content, More); while More loop -- Skip buffers if any declare Temp : ZMQ.Messages.Message; begin Temp.Initialize (0); Socket.Recv (Temp); More := Has_More (Temp); end; end loop; end Read_Message; ----------------- -- Send_Status -- ----------------- procedure Send_Message (Socket : in out ZMQ.Sockets.Socket; Msg_Id : in out Integer; To : Address_Lists.List; Key : League.Strings.Universal_String; Kind : Wide_Wide_String; Parent : League.JSON.Objects.JSON_Object := League.JSON.Objects.Empty_JSON_Object; Content : League.JSON.Objects.JSON_Object := League.JSON.Objects.Empty_JSON_Object) is use type League.Strings.Universal_String; Image : constant Wide_Wide_String := Integer'Wide_Wide_Image (Msg_Id); Object : League.JSON.Objects.JSON_Object; Digest : GNAT.SHA256.Context := GNAT.SHA256.HMAC_Initial_Context (Key.To_UTF_8_String); begin Msg_Id := Msg_Id - 1; Object.Insert (+"msg_id", League.JSON.Values.To_JSON_Value (+Image)); Object.Insert (+"session", Parent.Value (+"session")); Object.Insert (+"username", Parent.Value (+"username")); if Parent.Contains (+"date") then Object.Insert (+"date", Parent.Value (+"date")); end if; Object.Insert (+"msg_type", -Kind); Object.Insert (+"version", -"5.3"); GNAT.SHA256.Update (Digest, Object.To_JSON_Document.To_JSON.To_Stream_Element_Array); GNAT.SHA256.Update (Digest, Parent.To_JSON_Document.To_JSON.To_Stream_Element_Array); GNAT.SHA256.Update (Digest, "{}"); GNAT.SHA256.Update (Digest, Content.To_JSON_Document.To_JSON.To_Stream_Element_Array); for X of To loop Socket.Send (X.To_Stream_Element_Array, 2); end loop; Socket.Send ("<IDS|MSG>", 2); Socket.Send (String'(GNAT.SHA256.Digest (Digest)), 2); Socket.Send (Object.To_JSON_Document.To_JSON.To_Stream_Element_Array, 2); Socket.Send (Parent.To_JSON_Document.To_JSON.To_Stream_Element_Array, 2); Socket.Send ("{}", 2); Socket.Send (Content.To_JSON_Document.To_JSON.To_Stream_Element_Array); end Send_Message; use type Interfaces.C.int; use type Interfaces.C.long; use type Interfaces.C.short; CF : League.JSON.Objects.JSON_Object; Frontend : aliased Frontend_Connection; Poll : array (1 .. 4) of aliased ZMQ.Low_Level.zmq_pollitem_t; begin Read_Connection_File (File, CF); Frontend.Key := CF.Value (+"key").To_String; Bind (Frontend.Ctx, Frontend.Shell, CF, "shell_port", ZMQ.Sockets.ROUTER); Bind (Frontend.Ctx, Frontend.Stdin, CF, "stdin_port", ZMQ.Sockets.ROUTER); Bind (Frontend.Ctx, Frontend.IOPub, CF, "iopub_port", ZMQ.Sockets.PUB); Bind (Frontend.Ctx, Frontend.Ping, CF, "hb_port", ZMQ.Sockets.ROUTER); Bind (Frontend.Ctx, Frontend.Control, CF, "control_port", ZMQ.Sockets.ROUTER); loop Poll := (1 => (socket => Frontend.Shell.Get_Impl, fd => 0, events => ZMQ.Low_Level.Defs.ZMQ_POLLIN, revents => 0), 2 => (socket => Frontend.Stdin.Get_Impl, fd => 0, events => ZMQ.Low_Level.Defs.ZMQ_POLLIN, revents => 0), 3 => (socket => Frontend.Ping.Get_Impl, fd => 0, events => ZMQ.Low_Level.Defs.ZMQ_POLLIN, revents => 0), 4 => (socket => Frontend.Control.Get_Impl, fd => 0, events => ZMQ.Low_Level.Defs.ZMQ_POLLIN, revents => 0)); if ZMQ.Low_Level.zmq_poll (items_u => Poll (1)'Access, nitems_u => 4, timeout_u => -1) < 0 then return; end if; if Poll (1).revents /= 0 then declare Msg : Message; begin Read_Message (Frontend.Shell, Frontend.Key, Msg); Process_Shell_Message (Frontend, Msg); end; end if; end loop; end Jupyter.Start_Kernel;
31.622642
79
0.582339
29dd3d8f458f254eb93a0f59b2fe502d9e2a7df1
848
ads
Ada
ConfProfile/jni/strongswan/src/charon-tkm/src/ehandler/exception_handler.ads
Infoss/conf-profile-4-android
619bd63095bb0f5a67616436d5510d24a233a339
[ "MIT" ]
2
2017-10-16T07:51:18.000Z
2019-06-16T12:07:52.000Z
strongswan/strongswan-5.3.2/src/charon-tkm/src/ehandler/exception_handler.ads
SECURED-FP7/secured-mobility-ned
36fdbfee58a31d42f7047f7a7eaa1b2b70246151
[ "Apache-2.0" ]
5
2016-01-25T18:04:42.000Z
2016-02-25T08:54:56.000Z
strongswan/strongswan-5.3.2/src/charon-tkm/src/ehandler/exception_handler.ads
SECURED-FP7/secured-mobility-ned
36fdbfee58a31d42f7047f7a7eaa1b2b70246151
[ "Apache-2.0" ]
2
2016-01-25T17:14:17.000Z
2016-02-13T20:14:09.000Z
-- -- Copyright (C) 2012 Reto Buerki -- Copyright (C) 2012 Adrian-Ken Rueegsegger -- Hochschule fuer Technik Rapperswil -- -- This program is free software; you can redistribute it and/or modify it -- under the terms of the GNU General Public License as published by the -- Free Software Foundation; either version 2 of the License, or (at your -- option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>. -- -- This program is distributed in the hope that it will be useful, but -- WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- for more details. -- package Exception_Handler is procedure Init; pragma Export (C, Init, "ehandler_init"); -- Register last-chance exception handler. end Exception_Handler;
33.92
78
0.737028
4db74090269fa62a2b8467af82c73ecc82e332ff
898
adb
Ada
src/gdb/gdb-7.11/gdb/testsuite/gdb.ada/call_pn/pck.adb
alrooney/unum-sdk
bbccb10b0cd3500feccbbef22e27ea111c3d18eb
[ "Apache-2.0" ]
31
2018-08-01T21:25:24.000Z
2022-02-14T07:52:34.000Z
src/gdb/gdb-7.11/gdb/testsuite/gdb.ada/call_pn/pck.adb
alrooney/unum-sdk
bbccb10b0cd3500feccbbef22e27ea111c3d18eb
[ "Apache-2.0" ]
40
2018-12-03T19:48:52.000Z
2021-03-10T06:34:26.000Z
src/gdb/gdb-7.11/gdb/testsuite/gdb.ada/call_pn/pck.adb
alrooney/unum-sdk
bbccb10b0cd3500feccbbef22e27ea111c3d18eb
[ "Apache-2.0" ]
20
2018-11-16T21:19:22.000Z
2021-10-18T23:08:24.000Z
-- Copyright 2010-2016 Free Software Foundation, Inc. -- -- This program is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation; either version 3 of the License, or -- (at your option) any later version. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT 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 -- along with this program. If not, see <http://www.gnu.org/licenses/>. package body Pck is Last_Node_Id : Node_Id := Node_Id'First; function Pn (N : Node_Id) return Node_Id is begin Last_Node_Id := N; return N; end Pn; end Pck;
34.538462
73
0.717149
59bd4a2486bcf2b8a7c9c7b2c94b52de5e36d731
6,746
ads
Ada
extensions/xada-dispatching-tts.ads
rocher/TTS-Runtime-Ravenscar
0eb0267b6aced9c61f21a841c2e030e25c606864
[ "MIT" ]
2
2018-04-19T10:56:56.000Z
2019-05-22T14:44:57.000Z
extensions/xada-dispatching-tts.ads
rocher/TTS-Runtime-Ravenscar
0eb0267b6aced9c61f21a841c2e030e25c606864
[ "MIT" ]
8
2018-03-13T11:53:00.000Z
2019-11-11T11:54:40.000Z
extensions/xada-dispatching-tts.ads
rocher/TTS-Runtime-Ravenscar
0eb0267b6aced9c61f21a841c2e030e25c606864
[ "MIT" ]
2
2019-06-06T12:59:08.000Z
2019-06-24T18:34:40.000Z
------------------------------------------------------------ -- -- GNAT RUN-TIME EXTENSIONS -- -- XADA . DISPATCHING . TIME-TRIGGERED SCHEDULING -- -- @file x-distts.ads / xada-dispatching-tts.ads -- -- @package XAda.Dispatching.TTS (SPEC) -- -- @author Jorge Real <[email protected]> -- @author Sergio Saez <[email protected]> -- ------------------------------------------------------------ pragma Profile (Ravenscar); with Ada.Real_Time, System; private with Ada.Real_Time.Timing_Events; generic Number_Of_Work_IDs : Positive; Number_Of_Sync_IDs : Positive := 1; TT_Priority : System.Priority := System.Priority'Last; package XAda.Dispatching.TTS is -- TT tasks use a Work_Id of this type to identify themselves -- when they call the scheduler type TT_Work_Id is new Positive range 1 .. Number_Of_Work_IDs; -- ET tasks use a Sync_Id of this type to identify themselves -- when they call the scheduler type TT_Sync_Id is new Positive range 1 .. Number_Of_Sync_IDs; -- An abstract time slot in the TT plan. type Time_Slot is abstract tagged record Slot_Duration : Ada.Real_Time.Time_Span; end record; type Time_Slot_Access is access all Time_Slot'Class; -- An empty time slot type Empty_Slot is new Time_Slot with null record; type Empty_Slot_Access is access all Empty_Slot'Class; -- A mode change time slot type Mode_Change_Slot is new Time_Slot with null record; type Mode_Change_Slot_Access is access all Mode_Change_Slot'Class; -- A sync slot type Sync_Slot is new Time_Slot with record Sync_Id : TT_Sync_Id; end record; type Sync_Slot_Access is access all Sync_Slot'Class; -- A work slot type Work_Slot is abstract new Time_Slot with record Work_Id : TT_Work_Id; Is_Continuation : Boolean := False; Padding : Ada.Real_Time.Time_Span := Ada.Real_Time.Time_Span_Zero; end record; type Work_Slot_Access is access all Work_Slot'Class; -- A regular slot type Regular_Slot is new Work_Slot with null record; type Regular_Slot_Access is access all Regular_Slot'Class; -- An optional work slot type Optional_Slot is new Work_Slot with null record; type Optional_Slot_Access is access all Optional_Slot'Class; -- Types representing/accessing TT plans type Time_Triggered_Plan is array (Natural range <>) of Time_Slot_Access; type Time_Triggered_Plan_Access is access all Time_Triggered_Plan; -- Set new TT plan to start at the end of the next mode change slot procedure Set_Plan (TTP : Time_Triggered_Plan_Access); -- TT works use this procedure to wait for their next assigned slot -- The When_Was_Released result informs caller of slot starting time procedure Wait_For_Activation (Work_Id : TT_Work_Id; When_Was_Released : out Ada.Real_Time.Time); -- TT works use this procedure to inform that the critical part -- of the current slot has been finished. It tranforms the current -- slot in a continuation slot procedure Continue_Sliced; -- TT works use this procedure to inform the TT scheduler that -- there is no more work to do at TT priority level procedure Leave_TT_Level; -- Returns the first time the first slot of the current plan was released. -- It is equivalent to an Epoch for the current plan. function Get_First_Plan_Release return Ada.Real_Time.Time; -- Returns the last time the first slot of the plan was released function Get_Last_Plan_Release return Ada.Real_Time.Time; -- ET works use this procedure to wait for their next asigned sync slot procedure Wait_For_Sync (Sync_Id : TT_Sync_Id; When_Was_Released : out Ada.Real_Time.Time); private protected Time_Triggered_Scheduler with Priority => System.Interrupt_Priority'Last is -- Setting a new TT plan procedure Set_Plan (TTP : Time_Triggered_Plan_Access); -- Prepare work to wait for next activation procedure Prepare_For_Activation (Work_Id : TT_Work_Id); -- Transform current slot in a continuation slot procedure Continue_Sliced; -- Inform the scheduler that you have no more work as a TT task procedure Leave_TT_Level; -- Returns the first time the first slot of the plan was released function Get_First_Plan_Release return Ada.Real_Time.Time; -- Returns the last time the first slot of the plan was released function Get_Last_Plan_Release return Ada.Real_Time.Time; -- Prepare work to wait for next synchronization point procedure Prepare_For_Sync (Sync_Id : TT_Sync_Id); private -- New slot timing event NS_Event : Ada.Real_Time.Timing_Events.Timing_Event; -- New slot handler procedure procedure NS_Handler (Event : in out Ada.Real_Time.Timing_Events.Timing_Event); -- This access object is the reason why the scheduler is declared -- in this private part, given that this is a generic package. -- It should be a constant, but a PO can't have constant components. NS_Handler_Access : Ada.Real_Time.Timing_Events.Timing_Event_Handler := NS_Handler'Access; -- Hold timing event Hold_Event : Ada.Real_Time.Timing_Events.Timing_Event; -- Padding slot handler procedure procedure Hold_Handler (Event : in out Ada.Real_Time.Timing_Events.Timing_Event); -- This access object is the reason why the scheduler is declared -- in this private part, given that this is a generic package. -- It should be a constant, but a PO can't have constant components. Hold_Handler_Access : Ada.Real_Time.Timing_Events.Timing_Event_Handler := Hold_Handler'Access; -- Procedure to enforce plan change procedure Change_Plan (At_Time : Ada.Real_Time.Time); -- Currently running plan and next plan to switch to, if any Current_Plan : Time_Triggered_Plan_Access := null; Next_Plan : Time_Triggered_Plan_Access := null; -- Index numbers of current and next slots in the plan Current_Slot_Index : Natural := 0; Next_Slot_Index : Natural := 0; -- Start time of next slot Next_Slot_Release : Ada.Real_Time.Time := Ada.Real_Time.Time_Last; -- Start time of the current plan Plan_Start_Pending : Boolean := True; First_Plan_Release : Ada.Real_Time.Time := Ada.Real_Time.Time_First; -- Start time of the first slot First_Slot_Release : Ada.Real_Time.Time := Ada.Real_Time.Time_First; end Time_Triggered_Scheduler; end XAda.Dispatching.TTS;
35.505263
83
0.693003
22e47dbae875094faaa12448755a567c7dbc8696
7,403
adb
Ada
src/inverter_pwm.adb
JCGobbi/Nucleo-STM32H743ZI
bb0b5a66e9ac8b3dbe381f9909df5ed5d77dad1c
[ "BSD-3-Clause" ]
null
null
null
src/inverter_pwm.adb
JCGobbi/Nucleo-STM32H743ZI
bb0b5a66e9ac8b3dbe381f9909df5ed5d77dad1c
[ "BSD-3-Clause" ]
null
null
null
src/inverter_pwm.adb
JCGobbi/Nucleo-STM32H743ZI
bb0b5a66e9ac8b3dbe381f9909df5ed5d77dad1c
[ "BSD-3-Clause" ]
null
null
null
with HAL; use HAL; package body Inverter_PWM is -------------------- -- Initialize_PWM -- -------------------- procedure Initialize_PWM (Frequency : Frequency_Hz; Deadtime : Deadtime_Range; Alignment : PWM_Alignment) is Counter_Mode : constant Timer_Counter_Alignment_Mode := (case Alignment is when Edge => Up, when Center => Center_Aligned2); begin Configure_PWM_Timer (Generator => PWM_Timer_Ref, Frequency => UInt32 (Frequency)); Set_Counter_Mode (This => PWM_Timer_Ref.all, Value => Counter_Mode); Configure_Deadtime (This => PWM_Timer_Ref.all, Time => Deadtime); Set_BDTR_Lock (This => PWM_Timer_Ref.all, Lock => Level_1); for P in PWM_Phase'Range loop Modulators (P).Attach_PWM_Channel (Generator => PWM_Timer_Ref, Channel => Gate_Phase_Settings (P).Channel, Point => Gate_Phase_Settings (P).Pin_H, Complementary_Point => Gate_Phase_Settings (P).Pin_L, PWM_AF => Gate_Phase_Settings (P).Pin_AF, Polarity => High, Idle_State => Disable, Complementary_Polarity => High, Complementary_Idle_State => Disable); Set_Output_Preload_Enable (This => PWM_Timer_Ref.all, Channel => Gate_Phase_Settings (P).Channel, Enabled => True); end loop; Initialized := True; end Initialize_PWM; ------------------ -- Enable_Phase -- ------------------ procedure Enable_Phase (This : PWM_Phase) is begin Modulators (This).Enable_Output; Modulators (This).Enable_Complementary_Output; end Enable_Phase; ------------------- -- Disable_Phase -- ------------------- procedure Disable_Phase (This : PWM_Phase) is begin Modulators (This).Disable_Output; Modulators (This).Disable_Complementary_Output; end Disable_Phase; --------------- -- Start_PWM -- --------------- procedure Start_PWM is begin Reset_Sine_Step; for P in PWM_Phase'Range loop Set_Duty_Cycle (This => P, Value => 0.0); Enable_Phase (P); end loop; Enable_Interrupt (This => PWM_Timer_Ref.all, Source => Timer_Update_Interrupt); end Start_PWM; -------------- -- Stop_PWM -- -------------- procedure Stop_PWM is begin Disable_Interrupt (This => PWM_Timer_Ref.all, Source => Timer_Update_Interrupt); for P in PWM_Phase'Range loop Disable_Phase (P); Set_Duty_Cycle (This => P, Value => 0.0); end loop; Reset_Sine_Step; end Stop_PWM; ------------------------- -- Get_Duty_Resolution -- ------------------------- function Get_Duty_Resolution return Duty_Cycle is begin return Duty_Cycle (100.0 / Float (Current_Autoreload (PWM_Timer_Ref.all))); end Get_Duty_Resolution; -------------------- -- Set_Duty_Cycle -- -------------------- procedure Set_Duty_Cycle (This : PWM_Phase; Value : Duty_Cycle) is Pulse : UInt16; begin Pulse := UInt16 (Value * Float (Current_Autoreload (PWM_Timer_Ref.all)) / 100.0); Set_Compare_Value (This => PWM_Timer_Ref.all, Channel => Gate_Phase_Settings (This).Channel, Value => Pulse); end Set_Duty_Cycle; -------------------- -- Set_Duty_Cycle -- -------------------- procedure Set_Duty_Cycle (This : PWM_Phase; Amplitude : Table_Amplitude; Gain : Gain_Range) is Pulse : UInt16; begin Pulse := UInt16 (Gain * Float (Amplitude) / Float (Table_Amplitude'Last) * Float (Current_Autoreload (PWM_Timer_Ref.all))); Set_Compare_Value (This => PWM_Timer_Ref.all, Channel => Gate_Phase_Settings (This).Channel, Value => Pulse); end Set_Duty_Cycle; ------------------------ -- Set_PWM_Gate_Power -- ------------------------ -- This depends on the driver electronic circuit. Actually it is -- programmed to turn ON the gates driver with a low level. procedure Set_PWM_Gate_Power (Enabled : in Boolean) is begin if Enabled then PWM_Gate_Power.Clear; else PWM_Gate_Power.Set; end if; end Set_PWM_Gate_Power; --------------------- -- Reset_Sine_Step -- --------------------- procedure Reset_Sine_Step is begin Sine_Step := 250; end Reset_Sine_Step; ---------------- -- Safe_State -- ---------------- procedure Safe_State is begin Set_PWM_Gate_Power (Enabled => False); Stop_PWM; end Safe_State; -------------------- -- Is_Initialized -- -------------------- function Is_Initialized return Boolean is (Initialized); ----------------- -- PWM_Handler -- ----------------- protected body PWM_Handler is --------------------- -- PWM_ISR_Handler -- --------------------- procedure PWM_ISR_Handler is begin if Status (PWM_Timer, Timer_Update_Indicated) then if Interrupt_Enabled (PWM_Timer, Timer_Update_Interrupt) then Clear_Pending_Interrupt (PWM_Timer, Timer_Update_Interrupt); if (Semi_Senoid = False) then -- First half cycle Set_Duty_Cycle (This => A, Amplitude => Sine_Table (Sine_Step), Gain => Sine_Gain); -- Not necessary because the last value of B amplitude was 0 -- Set_Duty_Cycle (This => B, -- Amplitude => Table_Amplitude'Last, -- Value 0 -- Gain => Gain_Range'First); -- Value 0 else -- Second half cycle Set_Duty_Cycle (This => B, Amplitude => Sine_Table (Sine_Step), Gain => Sine_Gain); -- Not necessary because the last value of A amplitude was 0 -- Set_Duty_Cycle (This => A, -- Amplitude => Table_Amplitude'Last, -- Value 0 -- Gain => Gain_Range'First); -- Value 0 end if; if (Sine_Step + 1) > Sine_Step_Range'Last then Sine_Step := 1; Semi_Senoid := not Semi_Senoid; else Sine_Step := Sine_Step + 1; end if; -- Testing the 30 kHz output with 1 Hz LED blinking. if Counter = 15_000 then Set_Toggle (Yellow_LED); Counter := 0; end if; Counter := Counter + 1; end if; end if; end PWM_ISR_Handler; end PWM_Handler; end Inverter_PWM;
30.717842
87
0.491422
5897128a52eaad215cc26ac592bcd722606305a9
2,896
ads
Ada
gcc-gcc-7_3_0-release/gcc/ada/s-fatflt.ads
best08618/asylo
5a520a9f5c461ede0f32acc284017b737a43898c
[ "Apache-2.0" ]
7
2020-05-02T17:34:05.000Z
2021-10-17T10:15:18.000Z
gcc-gcc-7_3_0-release/gcc/ada/s-fatflt.ads
best08618/asylo
5a520a9f5c461ede0f32acc284017b737a43898c
[ "Apache-2.0" ]
null
null
null
gcc-gcc-7_3_0-release/gcc/ada/s-fatflt.ads
best08618/asylo
5a520a9f5c461ede0f32acc284017b737a43898c
[ "Apache-2.0" ]
2
2020-07-27T00:22:36.000Z
2021-04-01T09:41:02.000Z
------------------------------------------------------------------------------ -- -- -- GNAT COMPILER COMPONENTS -- -- -- -- S Y S T E M . F A T _ F L T -- -- -- -- S p e c -- -- -- -- Copyright (C) 1992-2009, Free Software Foundation, Inc. -- -- -- -- GNAT 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 3, or (at your option) any later ver- -- -- sion. GNAT 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. -- -- -- -- As a special exception under Section 7 of GPL version 3, you are granted -- -- additional permissions described in the GCC Runtime Library Exception, -- -- version 3.1, as published by the Free Software Foundation. -- -- -- -- You should have received a copy of the GNU General Public License and -- -- a copy of the GCC Runtime Library Exception along with this program; -- -- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- -- <http://www.gnu.org/licenses/>. -- -- -- -- GNAT was originally developed by the GNAT team at New York University. -- -- Extensive contributions were provided by Ada Core Technologies Inc. -- -- -- ------------------------------------------------------------------------------ -- This package contains an instantiation of the floating-point attribute -- runtime routines for the type Float. with System.Fat_Gen; package System.Fat_Flt is pragma Pure; -- Note the only entity from this package that is accessed by Rtsfind -- is the name of the package instantiation. Entities within this package -- (i.e. the individual floating-point attribute routines) are accessed -- by name using selected notation. package Attr_Float is new System.Fat_Gen (Float); end System.Fat_Flt;
60.333333
78
0.434392
59ef3de71e5bcb1ed074b26293d7a98b000a24ce
1,785
adb
Ada
AdaDemo2.adb
MatrixMike/AdaDemo1
cbf2ad5a05dc06a8ee11d0780c19f5fd74c8990a
[ "MIT" ]
1
2019-06-27T12:58:28.000Z
2019-06-27T12:58:28.000Z
AdaDemo2.adb
MatrixMike/AdaDemo1
cbf2ad5a05dc06a8ee11d0780c19f5fd74c8990a
[ "MIT" ]
null
null
null
AdaDemo2.adb
MatrixMike/AdaDemo1
cbf2ad5a05dc06a8ee11d0780c19f5fd74c8990a
[ "MIT" ]
null
null
null
procedure adaDemo2 is type Day_type is range 1 .. 31; type Month_type is range 1 .. 12; type Year_type is range 1800 .. 2100; type Hours is mod 24; type Weekday is (Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday); type Date is record Day : Day_type; Month : Month_type; Year : Year_type; end record; subtype Working_Hours is Hours range 0 .. 12; -- at most 12 Hours to work a day subtype Working_Day is Weekday range Monday .. Friday; -- Days to work begin --Work_Load: constant array(Working_Day) of Working_Hours -- implicit type declaration -- := (Friday => 6, Monday => 4, others => 10); -- lookup table for working hours with initialization -- while a is not equal to b, loop. while a /= b loop Ada.Text_IO.Put_Line ("Waiting"); end loop; if a > b then Ada.Text_IO.Put_Line ("Condition met"); else Ada.Text_IO.Put_Line ("Condition not met"); end if; for i in 1 .. 10 loop Ada.Text_IO.Put ("Iteration: "); Ada.Text_IO.Put (i); Ada.Text_IO.Put_Line; end loop; loop a := a + 1; exit when a = 10; end loop; case i is when 0 => Ada.Text_IO.Put ("zero"); when 1 => Ada.Text_IO.Put ("one"); when 2 => Ada.Text_IO.Put ("two"); -- case statements have to cover all possible cases: when others => Ada.Text_IO.Put ("none of the above"); end case; for aWeekday in Weekday'Range loop -- loop over an enumeration Put_Line ( Weekday'Image(aWeekday) ); -- output string representation of an enumeration if aWeekday in Working_Day then -- check of a subtype of an enumeration Put_Line ( " to work for " & Working_Hours'Image (Work_Load(aWeekday)) ); -- access into a lookup table end if; end loop; end AdaDemo2;
28.790323
113
0.652101
c70515b8a062aec245ce8c66be02ea9aa59bd263
4,676
adb
Ada
Src/serial.adb
SMerrony/dashera
74961f34a44cabae414e84537e8baae0ecb373c9
[ "MIT" ]
23
2021-12-12T15:20:22.000Z
2022-03-19T19:55:06.000Z
Src/serial.adb
SMerrony/dashera
74961f34a44cabae414e84537e8baae0ecb373c9
[ "MIT" ]
1
2022-03-10T00:09:35.000Z
2022-03-15T08:16:00.000Z
Src/serial.adb
SMerrony/dashera
74961f34a44cabae414e84537e8baae0ecb373c9
[ "MIT" ]
1
2022-03-11T19:42:02.000Z
2022-03-11T19:42:02.000Z
-- Copyright ©2022 Steve Merrony -- Permission is hereby granted, free of charge, to any person obtaining a copy -- of this software and associated documentation files (the "Software"), to deal -- in the Software without restriction, including without limitation the rights -- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -- copies of the Software, and to permit persons to whom the Software is -- furnished to do so, subject to the following conditions: -- The above copyright notice and this permission notice shall be included in -- all copies or substantial portions of the Software. -- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -- THE SOFTWARE. -- Note the serial break does not seem to be provided by GNAT.Serial_Communications -- It is claimed that... -- -- Sending break can be achieved by: -- -- * lowering the bit-rate -- * sending 0x00 which will seem as break. -- * change bit-rate back. -- -- During the break, it won't be possible to receive data since the bit-rate is not correct. with Ada.Exceptions; use Ada.Exceptions; with Ada.IO_Exceptions; with Ada.Streams; use Ada.Streams; with Logging; use Logging; with Redirector; package body Serial is procedure Open (Port_Str : in String; Rate : in Data_Rate; Bits : in Data_Bits; Parity : in Parity_Check; Stop_Bits : in Stop_Bits_Number) is begin GNAT.Serial_Communications.Open (Port, Port_Name(Port_Str)); GNAT.Serial_Communications.Set (Port, Rate, Bits, Stop_Bits, Parity); -- Save the user-specified settings so we can reset after sending a Break User_Rate := Rate; User_Bits := Bits; User_Parity := Parity; User_Stop_Bits := Stop_Bits; Log (DEBUG, "Serial port opened and set-up"); Port_US := To_Unbounded_String (Port_Str); Receiver_Task := new Receiver; Receiver_Task.Start; Redirector.Router.Set_Destination (Redirector.Async); Keyboard_Sender_Task := new Keyboard_Sender; Keyboard_Sender_Task.Start; Log (DEBUG, "Serial port open complete"); end Open; procedure Close is begin Close (Port); Keyboard_Sender_Task.Stop; Redirector.Router.Set_Destination (Redirector.Local); end Close; task body Receiver is B : Character; begin accept Start do Log (DEBUG, "Serial Receiver Started"); end Start; loop begin Character'Read (Port'Access, B); Redirector.Router.Handle_Data (B); exception when Ada.IO_Exceptions.END_ERROR => null; end; end loop; exception when Error: others => Log (WARNING, Exception_Information (Error)); Log (INFO, "Serial Receiver loop exited"); Close; end Receiver; task body Keyboard_Sender is begin accept Start do Log (DEBUG, "Serial Keyboard_Sender Started"); end Start; loop select accept Accept_Data (Data : in String) do declare SEA : Stream_Element_Array (1..Data'Length); begin for I in 1 .. Data'Length loop SEA(Stream_Element_Offset(I)) := Stream_Element(Character'Pos(Data(I))); end loop; Write (Port, SEA); end; end Accept_Data; or accept Send_Break do declare SEA : Stream_Element_Array (1..1); begin -- Set a very slow data rate GNAT.Serial_Communications.Set (Port, B110, CS8, Two, None); SEA(1) := 0; -- all zeroes Write (Port, SEA); -- Reset port to user settings GNAT.Serial_Communications.Set (Port, User_Rate, User_Bits, User_Stop_Bits, User_Parity); end; end Send_Break; or accept Stop; Log (DEBUG, "Serial Keyboard_Sender Stopped"); exit; or terminate; end select; end loop; end Keyboard_Sender; end Serial;
35.157895
107
0.618905
c745aee44313382566b11df00f01b6ce0418d045
12,724
ada
Ada
gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/c8/c85005d.ada
best08618/asylo
5a520a9f5c461ede0f32acc284017b737a43898c
[ "Apache-2.0" ]
7
2020-05-02T17:34:05.000Z
2021-10-17T10:15:18.000Z
gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/c8/c85005d.ada
best08618/asylo
5a520a9f5c461ede0f32acc284017b737a43898c
[ "Apache-2.0" ]
null
null
null
gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/c8/c85005d.ada
best08618/asylo
5a520a9f5c461ede0f32acc284017b737a43898c
[ "Apache-2.0" ]
2
2020-07-27T00:22:36.000Z
2021-04-01T09:41:02.000Z
-- C85005D.ADA -- Grant of Unlimited Rights -- -- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687, -- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained -- unlimited rights in the software and documentation contained herein. -- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making -- this public release, the Government intends to confer upon all -- recipients unlimited rights equal to those held by the Government. -- These rights include rights to use, duplicate, release or disclose the -- released technical data and computer software in whole or in part, in -- any manner and for any purpose whatsoever, and to have or permit others -- to do so. -- -- DISCLAIMER -- -- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR -- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED -- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE -- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE -- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A -- PARTICULAR PURPOSE OF SAID MATERIAL. --* -- OBJECTIVE: -- CHECK THAT A VARIABLE CREATED BY A GENERIC 'IN OUT' FORMAL -- PARAMETER CAN BE RENAMED AND HAS THE CORRECT VALUE, AND -- THAT THE NEW NAME CAN BE USED IN AN ASSIGNMENT STATEMENT AND -- PASSED ON AS AN ACTUAL SUBPROGRAM OR ENTRY 'IN OUT' OR 'OUT' -- PARAMETER, AND AS AN ACTUAL GENERIC 'IN OUT' PARAMETER, -- AND THAT WHEN THE VALUE OF THE RENAMED VARIABLE IS CHANGED, -- THE NEW VALUE IS REFLECTED BY THE VALUE OF THE NEW NAME. -- HISTORY: -- JET 03/15/88 CREATED ORIGINAL TEST. WITH REPORT; USE REPORT; PROCEDURE C85005D IS TYPE ARRAY1 IS ARRAY (POSITIVE RANGE <>) OF INTEGER; TYPE RECORD1 (D : INTEGER) IS RECORD FIELD1 : INTEGER := 1; END RECORD; TYPE POINTER1 IS ACCESS INTEGER; PACKAGE PACK1 IS TYPE PRIVY IS PRIVATE; ZERO : CONSTANT PRIVY; ONE : CONSTANT PRIVY; TWO : CONSTANT PRIVY; THREE : CONSTANT PRIVY; FOUR : CONSTANT PRIVY; FIVE : CONSTANT PRIVY; FUNCTION IDENT (I : PRIVY) RETURN PRIVY; FUNCTION NEXT (I : PRIVY) RETURN PRIVY; PRIVATE TYPE PRIVY IS RANGE 0..127; ZERO : CONSTANT PRIVY := 0; ONE : CONSTANT PRIVY := 1; TWO : CONSTANT PRIVY := 2; THREE : CONSTANT PRIVY := 3; FOUR : CONSTANT PRIVY := 4; FIVE : CONSTANT PRIVY := 5; END PACK1; TASK TYPE TASK1 IS ENTRY ASSIGN (J : IN INTEGER); ENTRY VALU (J : OUT INTEGER); ENTRY NEXT; ENTRY STOP; END TASK1; DI1 : INTEGER := 0; DA1 : ARRAY1(1..3) := (OTHERS => 0); DR1 : RECORD1(1) := (D => 1, FIELD1 => 0); DP1 : POINTER1 := NEW INTEGER'(0); DV1 : PACK1.PRIVY := PACK1.ZERO; DT1 : TASK1; I : INTEGER; GENERIC GI1 : IN OUT INTEGER; GA1 : IN OUT ARRAY1; GR1 : IN OUT RECORD1; GP1 : IN OUT POINTER1; GV1 : IN OUT PACK1.PRIVY; GT1 : IN OUT TASK1; PACKAGE GENERIC1 IS END GENERIC1; FUNCTION IDENT (P : POINTER1) RETURN POINTER1 IS BEGIN IF EQUAL (3,3) THEN RETURN P; ELSE RETURN NULL; END IF; END IDENT; PACKAGE BODY PACK1 IS FUNCTION IDENT (I : PRIVY) RETURN PRIVY IS BEGIN IF EQUAL(3,3) THEN RETURN I; ELSE RETURN PRIVY'(0); END IF; END IDENT; FUNCTION NEXT (I : PRIVY) RETURN PRIVY IS BEGIN RETURN I+1; END NEXT; END PACK1; PACKAGE BODY GENERIC1 IS XGI1 : INTEGER RENAMES GI1; XGA1 : ARRAY1 RENAMES GA1; XGR1 : RECORD1 RENAMES GR1; XGP1 : POINTER1 RENAMES GP1; XGV1 : PACK1.PRIVY RENAMES GV1; XGT1 : TASK1 RENAMES GT1; TASK TYPE TASK2 IS ENTRY ENTRY1 (TI1 : OUT INTEGER; TA1 : OUT ARRAY1; TR1 : OUT RECORD1; TP1 : IN OUT POINTER1; TV1 : IN OUT PACK1.PRIVY; TT1 : IN OUT TASK1); END TASK2; G_CHK_TASK : TASK2; GENERIC GGI1 : IN OUT INTEGER; GGA1 : IN OUT ARRAY1; GGR1 : IN OUT RECORD1; GGP1 : IN OUT POINTER1; GGV1 : IN OUT PACK1.PRIVY; GGT1 : IN OUT TASK1; PACKAGE GENERIC2 IS END GENERIC2; PACKAGE BODY GENERIC2 IS BEGIN GGI1 := GGI1 + 1; GGA1 := (GGA1(1)+1, GGA1(2)+1, GGA1(3)+1); GGR1 := (D => 1, FIELD1 => GGR1.FIELD1 + 1); GGP1 := NEW INTEGER'(GGP1.ALL + 1); GGV1 := PACK1.NEXT(GGV1); GGT1.NEXT; END GENERIC2; TASK BODY TASK2 IS BEGIN ACCEPT ENTRY1 (TI1 : OUT INTEGER; TA1 : OUT ARRAY1; TR1 : OUT RECORD1; TP1 : IN OUT POINTER1; TV1 : IN OUT PACK1.PRIVY; TT1 : IN OUT TASK1) DO TI1 := GI1 + 1; TA1 := (GA1(1)+1, GA1(2)+1, GA1(3)+1); TR1 := (D => 1, FIELD1 => GR1.FIELD1 + 1); TP1 := NEW INTEGER'(TP1.ALL + 1); TV1 := PACK1.NEXT(TV1); TT1.NEXT; END ENTRY1; END TASK2; PROCEDURE PROC1 (PI1 : IN OUT INTEGER; PA1 : IN OUT ARRAY1; PR1 : IN OUT RECORD1; PP1 : OUT POINTER1; PV1 : OUT PACK1.PRIVY; PT1 : IN OUT TASK1) IS BEGIN PI1 := PI1 + 1; PA1 := (PA1(1)+1, PA1(2)+1, PA1(3)+1); PR1 := (D => 1, FIELD1 => PR1.FIELD1 + 1); PP1 := NEW INTEGER'(GP1.ALL + 1); PV1 := PACK1.NEXT(GV1); PT1.NEXT; END PROC1; PACKAGE GENPACK2 IS NEW GENERIC2 (XGI1, XGA1, XGR1, XGP1, XGV1, XGT1); BEGIN IF XGI1 /= IDENT_INT(1) THEN FAILED ("INCORRECT VALUE OF XGI1 (1)"); END IF; IF XGA1 /= (IDENT_INT(1),IDENT_INT(1),IDENT_INT(1)) THEN FAILED ("INCORRECT VALUE OF XGA1 (1)"); END IF; IF XGR1 /= (D => 1, FIELD1 => IDENT_INT(1)) THEN FAILED ("INCORRECT VALUE OF XGR1 (1)"); END IF; IF XGP1 /= IDENT(GP1) OR XGP1.ALL /= IDENT_INT(1) THEN FAILED ("INCORRECT VALUE OF XGP1 (1)"); END IF; IF PACK1."/=" (XGV1, PACK1.IDENT(PACK1.ONE)) THEN FAILED ("INCORRECT VALUE OF XGV1 (1)"); END IF; XGT1.VALU(I); IF I /= IDENT_INT(1) THEN FAILED ("INCORRECT RETURN VALUE OF XGT1.VALU (1)"); END IF; PROC1(XGI1, XGA1, XGR1, XGP1, XGV1, XGT1); IF XGI1 /= IDENT_INT(2) THEN FAILED ("INCORRECT VALUE OF XGI1 (2)"); END IF; IF XGA1 /= (IDENT_INT(2),IDENT_INT(2),IDENT_INT(2)) THEN FAILED ("INCORRECT VALUE OF XGA1 (2)"); END IF; IF XGR1 /= (D => 1, FIELD1 => IDENT_INT(2)) THEN FAILED ("INCORRECT VALUE OF XGR1 (2)"); END IF; IF XGP1 /= IDENT(GP1) OR XGP1.ALL /= IDENT_INT(2) THEN FAILED ("INCORRECT VALUE OF XGP1 (2)"); END IF; IF PACK1."/=" (XGV1, PACK1.IDENT(PACK1.TWO)) THEN FAILED ("INCORRECT VALUE OF XGV1 (2)"); END IF; XGT1.VALU(I); IF I /= IDENT_INT(2) THEN FAILED ("INCORRECT RETURN VALUE OF XGT1.VALU (2)"); END IF; G_CHK_TASK.ENTRY1(XGI1, XGA1, XGR1, XGP1, XGV1, XGT1); IF XGI1 /= IDENT_INT(3) THEN FAILED ("INCORRECT VALUE OF XGI1 (3)"); END IF; IF XGA1 /= (IDENT_INT(3),IDENT_INT(3),IDENT_INT(3)) THEN FAILED ("INCORRECT VALUE OF XGA1 (3)"); END IF; IF XGR1 /= (D => 1, FIELD1 => IDENT_INT(3)) THEN FAILED ("INCORRECT VALUE OF XGR1 (3)"); END IF; IF XGP1 /= IDENT(GP1) OR XGP1.ALL /= IDENT_INT(3) THEN FAILED ("INCORRECT VALUE OF XGP1 (3)"); END IF; IF PACK1."/=" (XGV1, PACK1.IDENT(PACK1.THREE)) THEN FAILED ("INCORRECT VALUE OF XGV1 (3)"); END IF; XGT1.VALU(I); IF I /= IDENT_INT(3) THEN FAILED ("INCORRECT RETURN VALUE OF XGT1.VALU (3)"); END IF; XGI1 := XGI1 + 1; XGA1 := (XGA1(1)+1, XGA1(2)+1, XGA1(3)+1); XGR1 := (D => 1, FIELD1 => XGR1.FIELD1 + 1); XGP1 := NEW INTEGER'(XGP1.ALL + 1); XGV1 := PACK1.NEXT(XGV1); XGT1.NEXT; IF XGI1 /= IDENT_INT(4) THEN FAILED ("INCORRECT VALUE OF XGI1 (4)"); END IF; IF XGA1 /= (IDENT_INT(4),IDENT_INT(4),IDENT_INT(4)) THEN FAILED ("INCORRECT VALUE OF XGA1 (4)"); END IF; IF XGR1 /= (D => 1, FIELD1 => IDENT_INT(4)) THEN FAILED ("INCORRECT VALUE OF XGR1 (4)"); END IF; IF XGP1 /= IDENT(GP1) OR XGP1.ALL /= IDENT_INT(4) THEN FAILED ("INCORRECT VALUE OF XGP1 (4)"); END IF; IF PACK1."/=" (XGV1, PACK1.IDENT(PACK1.FOUR)) THEN FAILED ("INCORRECT VALUE OF XGV1 (4)"); END IF; XGT1.VALU(I); IF I /= IDENT_INT(4) THEN FAILED ("INCORRECT RETURN VALUE OF XGT1.VALU (4)"); END IF; GI1 := GI1 + 1; GA1 := (GA1(1)+1, GA1(2)+1, GA1(3)+1); GR1 := (D => 1, FIELD1 => GR1.FIELD1 + 1); GP1 := NEW INTEGER'(GP1.ALL + 1); GV1 := PACK1.NEXT(GV1); GT1.NEXT; IF XGI1 /= IDENT_INT(5) THEN FAILED ("INCORRECT VALUE OF XGI1 (5)"); END IF; IF XGA1 /= (IDENT_INT(5),IDENT_INT(5),IDENT_INT(5)) THEN FAILED ("INCORRECT VALUE OF XGA1 (5)"); END IF; IF XGR1 /= (D => 1, FIELD1 => IDENT_INT(5)) THEN FAILED ("INCORRECT VALUE OF XGR1 (5)"); END IF; IF XGP1 /= IDENT(GP1) OR XGP1.ALL /= IDENT_INT(5) THEN FAILED ("INCORRECT VALUE OF XGP1 (5)"); END IF; IF PACK1."/=" (XGV1, PACK1.IDENT(PACK1.FIVE)) THEN FAILED ("INCORRECT VALUE OF XGV1 (5)"); END IF; XGT1.VALU(I); IF I /= IDENT_INT(5) THEN FAILED ("INCORRECT RETURN VALUE OF XGT1.VALU (5)"); END IF; END GENERIC1; TASK BODY TASK1 IS TASK_VALUE : INTEGER := 0; ACCEPTING_ENTRIES : BOOLEAN := TRUE; BEGIN WHILE ACCEPTING_ENTRIES LOOP SELECT ACCEPT ASSIGN (J : IN INTEGER) DO TASK_VALUE := J; END ASSIGN; OR ACCEPT VALU (J : OUT INTEGER) DO J := TASK_VALUE; END VALU; OR ACCEPT NEXT DO TASK_VALUE := TASK_VALUE + 1; END NEXT; OR ACCEPT STOP DO ACCEPTING_ENTRIES := FALSE; END STOP; END SELECT; END LOOP; END TASK1; BEGIN TEST ("C85005D", "CHECK THAT A VARIABLE CREATED BY A GENERIC " & "'IN OUT' FORMAL PARAMETER CAN BE RENAMED " & "AND HAS THE CORRECT VALUE, AND THAT THE NEW " & "NAME CAN BE USED IN AN ASSIGNMENT STATEMENT " & "AND PASSED ON AS AN ACTUAL SUBPROGRAM OR " & "ENTRY 'IN OUT' OR 'OUT' PARAMETER, AND AS AN " & "ACTUAL GENERIC 'IN OUT' PARAMETER, AND THAT " & "WHEN THE VALUE OF THE RENAMED VARIABLE IS " & "CHANGED, THE NEW VALUE IS REFLECTED BY THE " & "VALUE OF THE NEW NAME"); DECLARE PACKAGE GENPACK1 IS NEW GENERIC1 (DI1, DA1, DR1, DP1, DV1, DT1); BEGIN NULL; END; DT1.STOP; RESULT; END C85005D;
33.572559
79
0.489783
580030d9c974c6e3a78a99d5c161ea63786562cc
2,681
ads
Ada
tools/scitools/conf/understand/ada/ada05/a-wtcstr.ads
brucegua/moocos
575c161cfa35e220f10d042e2e5ca18773691695
[ "Apache-2.0" ]
1
2020-01-20T21:26:46.000Z
2020-01-20T21:26:46.000Z
tools/scitools/conf/understand/ada/ada05/a-wtcstr.ads
brucegua/moocos
575c161cfa35e220f10d042e2e5ca18773691695
[ "Apache-2.0" ]
null
null
null
tools/scitools/conf/understand/ada/ada05/a-wtcstr.ads
brucegua/moocos
575c161cfa35e220f10d042e2e5ca18773691695
[ "Apache-2.0" ]
null
null
null
------------------------------------------------------------------------------ -- -- -- GNAT RUN-TIME COMPONENTS -- -- -- -- A D A . W I D E _ T E X T _ I O . C _ S T R E A M S -- -- -- -- S p e c -- -- -- -- Copyright (C) 1992-2005, Free Software Foundation, Inc. -- -- -- -- GNAT 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. GNAT 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 GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, -- -- Boston, MA 02110-1301, USA. -- -- -- -- -- -- -- -- -- -- -- GNAT was originally developed by the GNAT team at New York University. -- -- Extensive contributions were provided by Ada Core Technologies Inc. -- -- -- ------------------------------------------------------------------------------ -- This package provides an interface between Ada.Wide_Text_IO and the -- C streams. This allows sharing of a stream between Ada and C or C++, -- as well as allowing the Ada program to operate directly on the stream. with Interfaces.C_Streams; package Ada.Wide_Text_IO.C_Streams is package ICS renames Interfaces.C_Streams; function C_Stream (F : File_Type) return ICS.FILEs; -- Obtain stream from existing open file procedure Open (File : in out File_Type; Mode : File_Mode; C_Stream : ICS.FILEs; Form : String := ""; Name : String := ""); -- Create new file from existing stream end Ada.Wide_Text_IO.C_Streams;
47.875
78
0.447594
2293136c7a4e72bb56d0c78e98cfde1d7dce1d94
3,958
adb
Ada
Validation/pyFrame3DD-master/gcc-master/gcc/ada/libgnat/a-ssicst.adb
djamal2727/Main-Bearing-Analytical-Model
2f00c2219c71be0175c6f4f8f1d4cca231d97096
[ "Apache-2.0" ]
null
null
null
Validation/pyFrame3DD-master/gcc-master/gcc/ada/libgnat/a-ssicst.adb
djamal2727/Main-Bearing-Analytical-Model
2f00c2219c71be0175c6f4f8f1d4cca231d97096
[ "Apache-2.0" ]
null
null
null
Validation/pyFrame3DD-master/gcc-master/gcc/ada/libgnat/a-ssicst.adb
djamal2727/Main-Bearing-Analytical-Model
2f00c2219c71be0175c6f4f8f1d4cca231d97096
[ "Apache-2.0" ]
null
null
null
------------------------------------------------------------------------------ -- -- -- GNAT RUN-TIME COMPONENTS -- -- -- -- A D A . S T R E A M S . S T R E A M _ I O . C _ S T R E A M S -- -- -- -- B o d y -- -- -- -- Copyright (C) 1992-2020, Free Software Foundation, Inc. -- -- -- -- GNAT 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 3, or (at your option) any later ver- -- -- sion. GNAT 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. -- -- -- -- As a special exception under Section 7 of GPL version 3, you are granted -- -- additional permissions described in the GCC Runtime Library Exception, -- -- version 3.1, as published by the Free Software Foundation. -- -- -- -- You should have received a copy of the GNU General Public License and -- -- a copy of the GCC Runtime Library Exception along with this program; -- -- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- -- <http://www.gnu.org/licenses/>. -- -- -- -- GNAT was originally developed by the GNAT team at New York University. -- -- Extensive contributions were provided by Ada Core Technologies Inc. -- -- -- ------------------------------------------------------------------------------ with Interfaces.C_Streams; use Interfaces.C_Streams; with System.File_IO; with System.File_Control_Block; with Ada.Unchecked_Conversion; package body Ada.Streams.Stream_IO.C_Streams is package FIO renames System.File_IO; package FCB renames System.File_Control_Block; subtype AP is FCB.AFCB_Ptr; function To_FCB is new Ada.Unchecked_Conversion (File_Mode, FCB.File_Mode); -------------- -- C_Stream -- -------------- function C_Stream (F : File_Type) return FILEs is begin FIO.Check_File_Open (AP (F)); return F.Stream; end C_Stream; ---------- -- Open -- ---------- procedure Open (File : in out File_Type; Mode : File_Mode; C_Stream : FILEs; Form : String := ""; Name : String := "") is Dummy_File_Control_Block : Stream_AFCB; pragma Warnings (Off, Dummy_File_Control_Block); -- Yes, we know this is never assigned a value, only the tag -- is used for dispatching purposes, so that's expected. begin FIO.Open (File_Ptr => AP (File), Dummy_FCB => Dummy_File_Control_Block, Mode => To_FCB (Mode), Name => Name, Form => Form, Amethod => 'S', Creat => False, Text => False, C_Stream => C_Stream); File.Last_Op := (if Mode = Out_File then Op_Write else Op_Read); -- See comment in Ada.Streams.Stream_IO.Open for the reason end Open; end Ada.Streams.Stream_IO.C_Streams;
44.977273
78
0.455028
29e4f60ca21f66a6e913f429d932e2bbfe561487
10,584
adb
Ada
.emacs.d/elpa/wisi-3.1.3/wisitoken-bnf.adb
caqg/linux-home
eed631aae6f5e59e4f46e14f1dff443abca5fa28
[ "Linux-OpenIB" ]
null
null
null
.emacs.d/elpa/wisi-3.1.3/wisitoken-bnf.adb
caqg/linux-home
eed631aae6f5e59e4f46e14f1dff443abca5fa28
[ "Linux-OpenIB" ]
null
null
null
.emacs.d/elpa/wisi-3.1.3/wisitoken-bnf.adb
caqg/linux-home
eed631aae6f5e59e4f46e14f1dff443abca5fa28
[ "Linux-OpenIB" ]
null
null
null
-- Abstract : -- -- see spec -- -- Copyright (C) 2012 - 2015, 2017 - 2019 Free Software Foundation, Inc. -- -- This program is free software; you can redistribute it and/or -- modify it under terms of the GNU General Public License as -- published by the Free Software Foundation; either version 3, or (at -- your option) any later version. This program is distributed in the -- hope that it will be useful, but WITHOUT 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 program; see file COPYING. If not, write to -- the Free Software Foundation, 51 Franklin Street, Suite 500, Boston, -- MA 02110-1335, USA. pragma License (GPL); with Ada.Command_Line; with Ada.Directories; with Ada.Text_IO; with Ada.Strings.Fixed; package body WisiToken.BNF is procedure Add (Set : in out Generate_Set_Access; Tuple : in Generate_Tuple) is Prev : Generate_Set_Access := Set; Last : constant Integer := (if Prev = null then 1 else Prev.all'Length + 1); begin Set := new Generate_Set (1 .. Last); for I in 1 .. Last - 1 loop Set (I) := Prev (I); end loop; Set (Last) := Tuple; Free (Prev); end Add; function To_Generate_Algorithm (Item : in String) return Generate_Algorithm is begin for I in Generate_Algorithm loop if To_Lower (Generate_Algorithm_Image (I).all) = To_Lower (Item) then return I; end if; end loop; raise User_Error with "invalid generate algorithm name: '" & Item & "'"; end To_Generate_Algorithm; function To_Output_Language (Item : in String) return Output_Language is begin for I in Output_Language loop if To_Lower (Output_Language_Image (I).all) = To_Lower (Item) then return I; end if; end loop; raise User_Error with "invalid output language name: '" & Item & "'"; end To_Output_Language; function To_Lexer (Item : in String) return Lexer_Type is begin for I in Valid_Lexer loop if Lexer_Image (I).all = To_Lower (Item) then return I; end if; end loop; raise User_Error with "invalid lexer name: '" & Item & "'"; end To_Lexer; function Split_Lines (Item : in String) return String_Lists.List is CR : Character renames ASCII.CR; LF : Character renames ASCII.LF; Result : WisiToken.BNF.String_Lists.List; I : Integer := Item'First; First : Integer := Item'First; Last_Char : Character := ' '; begin loop exit when I > Item'Last; if Item (I) = LF then Result.Append (Item (First .. I - (if Last_Char = CR then 2 else 1))); First := I + 1; elsif I = Item'Last then Result.Append (Item (First .. I)); end if; Last_Char := Item (I); I := I + 1; end loop; return Result; end Split_Lines; function Trim (Item : in String_Lists.List; Comment_Start : in String) return String_Lists.List is use Ada.Strings; use Ada.Strings.Fixed; Result : String_Lists.List; Comment : Integer; procedure Maybe_Append (Line : in String) is begin if Line'Length > 0 then Result.Append (Line); end if; end Maybe_Append; begin for Line of Item loop Comment := Index (Line, Comment_Start, Going => Backward); if Comment /= 0 then Maybe_Append (Trim (Line (Line'First .. Comment - 1), Both)); else Maybe_Append (Trim (Line, Both)); end if; end loop; return Result; end Trim; procedure Put_Raw_Code (Comment_Syntax : in String_2; Code : in String_Lists.List; Comment_Only : in Boolean := False) is use Ada.Text_IO; Real_Comment_Only : Boolean := Comment_Only; begin for Line of Code loop if Line'Length >= 2 and then ((Line (Line'First) = Line (Line'First + 1)) and Line (Line'First) /= ' ') then -- The line is a comment. Real_Comment_Only := Real_Comment_Only or Line (Line'First .. Line'First + 1) /= Comment_Syntax; Put_Line (Comment_Syntax & Line (Line'First + 2 .. Line'Last)); elsif Comment_Syntax = Elisp_Comment and (Line'Length > 0 and then Line (Line'First) /= '(') then null; elsif not Comment_Only then Put_Line (Line); end if; end loop; end Put_Raw_Code; procedure Put_File_Header (Comment_Syntax : in String_2; Emacs_Mode : in String := ""; Use_Tuple : in Boolean := False; Tuple : in Generate_Tuple := (others => <>)) is use Ada.Text_IO; begin Put_Line (Comment_Syntax & " generated parser support file." & Emacs_Mode); Put_Command_Line (Comment_Syntax & " ", Use_Tuple, Tuple); Put_Line (Comment_Syntax); end Put_File_Header; function Is_Present (List : in WisiToken.BNF.String_Pair_Lists.List; Name : in String) return Boolean is use all type Ada.Strings.Unbounded.Unbounded_String; begin for Pair of List loop if Pair.Name = Name then return True; end if; end loop; return False; end Is_Present; function Value (List : in WisiToken.BNF.String_Pair_Lists.List; Name : in String) return String is use all type Ada.Strings.Unbounded.Unbounded_String; begin for Pair of List loop if Pair.Name = Name then return -Pair.Value; end if; end loop; raise Not_Found; end Value; function Is_Present (List : in Elisp_Action_Maps.Map; Name : in String) return Boolean is use Elisp_Action_Maps; begin return No_Element /= List.Find (+Name); end Is_Present; function Count (Tokens : in Token_Lists.List) return Integer is Result : Integer := 0; begin for Kind of Tokens loop Result := Result + Integer (Kind.Tokens.Length); end loop; return Result; end Count; procedure Add_Token (Tokens : in out Token_Lists.List; Kind : in String; Name : in String; Value : in String; Repair_Image : in String := "") is use type Ada.Strings.Unbounded.Unbounded_String; begin for Token_Kind of Tokens loop if Token_Kind.Kind = Kind then Token_Kind.Tokens.Append ((+Name, +Value, +Repair_Image)); return; end if; end loop; -- Kind not found; add it declare Temp : String_Triple_Lists.List; begin Temp.Append ((+Name, +Value, +Repair_Image)); Tokens.Append ((+Kind, Temp)); end; end Add_Token; function Is_In (Tokens : in Token_Lists.List; Kind : in String) return Boolean is begin for Token of Tokens loop if -Token.Kind = Kind then return True; end if; end loop; return False; end Is_In; function Is_In (Tokens : in Token_Lists.List; Kind : in String; Value : in String) return Boolean is begin for Token of Tokens loop if -Token.Kind = Kind then for Item of Token.Tokens loop if -Item.Value = Value then return True; end if; end loop; end if; end loop; return False; end Is_In; function Is_Present (Rules : in Rule_Lists.List; LHS : in String) return Boolean is use Rule_Lists; Found : Boolean := False; procedure Process (Position : in Cursor) is begin if -Rules (Position).Left_Hand_Side = LHS then Found := True; end if; end Process; begin Rules.Iterate (Process'Access); return Found; end Is_Present; function "+" (List : in String_Lists.List; Item : in String) return String_Lists.List is Result : String_Lists.List := List; begin Result.Append (Item); return Result; end "+"; function String_To_String_List (Item : in String) return String_Lists.List is Result : String_Lists.List; begin Result.Append (Item); return Result; end String_To_String_List; function RHS_To_RHS_List (Item : in RHS_Type) return RHS_Lists.List is Result : RHS_Lists.List; begin Result.Append (Item); return Result; end RHS_To_RHS_List; function "+" (List : in RHS_Lists.List; Item : in RHS_Type) return RHS_Lists.List is Result : RHS_Lists.List := List; begin Result.Append (Item); return Result; end "+"; procedure Put_Command_Line (Comment_Prefix : in String; Use_Tuple : in Boolean := False; Tuple : in Generate_Tuple := (others => <>)) is use Ada.Command_Line; use Ada.Text_IO; Max_Line_Length : constant := 120; Col : Integer := 0; procedure Put (Item : in String; Leading_Space : in Boolean) is begin if Col > 0 and Col + Item'Length + 1 > Max_Line_Length then New_Line; Col := Comment_Prefix'Length; Put (Comment_Prefix); else if Leading_Space then Put (" "); Col := Col + 1; end if; end if; Col := Col + Item'Length; Put (Item); end Put; begin Put (Comment_Prefix & "command line:", False); Put (Ada.Directories.Simple_Name (Command_Name), True); if Use_Tuple then Put (" --generate " & Generate_Algorithm'Image (Tuple.Gen_Alg) & " " & Output_Language_Image (Tuple.Out_Lang).all & (if Tuple.Lexer /= None then " " & Lexer_Image (Tuple.Lexer).all else "") & (if Tuple.Interface_Kind /= None then " " & Interface_Type'Image (Tuple.Interface_Kind) else "") & (if Tuple.Text_Rep then " text_rep" else "") & " " & Argument (Argument_Count), -- .wy file True); else for I in 1 .. Argument_Count loop Put (Argument (I), True); end loop; end if; New_Line; end Put_Command_Line; end WisiToken.BNF;
29.730337
114
0.590703
22f70ce6ca5c0765bf00fc7ad5813212160dfd7e
1,620
ads
Ada
orka/src/orka/interface/orka-strings.ads
onox/orka
9edf99559a16ffa96dfdb208322f4d18efbcbac6
[ "Apache-2.0" ]
52
2016-07-30T23:00:28.000Z
2022-02-05T11:54:55.000Z
orka/src/orka/interface/orka-strings.ads
onox/orka
9edf99559a16ffa96dfdb208322f4d18efbcbac6
[ "Apache-2.0" ]
79
2016-08-01T18:36:48.000Z
2022-02-27T12:14:20.000Z
orka/src/orka/interface/orka-strings.ads
onox/orka
9edf99559a16ffa96dfdb208322f4d18efbcbac6
[ "Apache-2.0" ]
4
2018-04-28T22:36:26.000Z
2020-11-14T23:00:29.000Z
-- SPDX-License-Identifier: Apache-2.0 -- -- Copyright (c) 2017 onox <[email protected]> -- -- 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. with Ada.Strings.Unbounded; package Orka.Strings is pragma Preelaborate; function Trim (Value : String) return String; -- Return value with whitespace removed from both the start and end function Strip_Line_Term (Value : String) return String; -- Return the value without any LF and CR characters at the end function Lines (Value : String) return Positive; -- Return the number of lines that the string contains package SU renames Ada.Strings.Unbounded; function "+" (Value : String) return SU.Unbounded_String renames SU.To_Unbounded_String; function "+" (Value : SU.Unbounded_String) return String renames SU.To_String; type String_List is array (Positive range <>) of SU.Unbounded_String; function Split (Value : String; Separator : String := " "; Maximum : Natural := 0) return String_List; function Join (List : String_List; Separator : String) return String; end Orka.Strings;
35.217391
91
0.72037
1dca057277a6885b87c2cd35871bef7d6e061399
3,608
adb
Ada
llvm-gcc-4.2-2.9/gcc/ada/a-szunau.adb
vidkidz/crossbridge
ba0bf94aee0ce6cf7eb5be882382e52bc57ba396
[ "MIT" ]
1
2016-04-09T02:58:13.000Z
2016-04-09T02:58:13.000Z
llvm-gcc-4.2-2.9/gcc/ada/a-szunau.adb
vidkidz/crossbridge
ba0bf94aee0ce6cf7eb5be882382e52bc57ba396
[ "MIT" ]
null
null
null
llvm-gcc-4.2-2.9/gcc/ada/a-szunau.adb
vidkidz/crossbridge
ba0bf94aee0ce6cf7eb5be882382e52bc57ba396
[ "MIT" ]
null
null
null
------------------------------------------------------------------------------ -- -- -- GNAT RUN-TIME COMPONENTS -- -- -- -- A D A . S T R I N G S . W I D E _ W I D E _ U N B O U N D E D . A U X -- -- -- -- B o d y -- -- -- -- Copyright (C) 1992-2005, Free Software Foundation, Inc. -- -- -- -- GNAT 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. GNAT 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 GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, -- -- Boston, MA 02110-1301, 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. -- -- -- -- GNAT was originally developed by the GNAT team at New York University. -- -- Extensive contributions were provided by Ada Core Technologies Inc. -- -- -- ------------------------------------------------------------------------------ package body Ada.Strings.Wide_Wide_Unbounded.Aux is -------------------- -- Get_Wide_Wide_String -- --------------------- procedure Get_Wide_Wide_String (U : Unbounded_Wide_Wide_String; S : out Wide_Wide_String_Access; L : out Natural) is begin S := U.Reference; L := U.Last; end Get_Wide_Wide_String; --------------------- -- Set_Wide_Wide_String -- --------------------- procedure Set_Wide_Wide_String (UP : in out Unbounded_Wide_Wide_String; S : Wide_Wide_String) is begin if S'Length > UP.Last then Finalize (UP); UP.Reference := new Wide_Wide_String (1 .. S'Length); end if; UP.Reference (1 .. S'Length) := S; UP.Last := S'Length; end Set_Wide_Wide_String; procedure Set_Wide_Wide_String (UP : in out Unbounded_Wide_Wide_String; S : Wide_Wide_String_Access) is begin Finalize (UP); UP.Reference := S; UP.Last := UP.Reference'Length; end Set_Wide_Wide_String; end Ada.Strings.Wide_Wide_Unbounded.Aux;
45.670886
78
0.467295
1d25fb84b62dff3beca1319e07559507a0ad075d
3,826
adb
Ada
gcc-gcc-7_3_0-release/gcc/ada/s-tpoaal.adb
best08618/asylo
5a520a9f5c461ede0f32acc284017b737a43898c
[ "Apache-2.0" ]
7
2020-05-02T17:34:05.000Z
2021-10-17T10:15:18.000Z
gcc-gcc-7_3_0-release/gcc/ada/s-tpoaal.adb
best08618/asylo
5a520a9f5c461ede0f32acc284017b737a43898c
[ "Apache-2.0" ]
null
null
null
gcc-gcc-7_3_0-release/gcc/ada/s-tpoaal.adb
best08618/asylo
5a520a9f5c461ede0f32acc284017b737a43898c
[ "Apache-2.0" ]
2
2020-07-27T00:22:36.000Z
2021-04-01T09:41:02.000Z
------------------------------------------------------------------------------ -- -- -- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS -- -- -- -- SYSTEM.TASK_PRIMITIVES.OPERATIONS.ATCB_ALLOCATION -- -- -- -- B o d y -- -- -- -- Copyright (C) 2011, Free Software Foundation, Inc. -- -- -- -- GNARL 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 3, or (at your option) any later ver- -- -- sion. GNAT 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. -- -- -- -- As a special exception under Section 7 of GPL version 3, you are granted -- -- additional permissions described in the GCC Runtime Library Exception, -- -- version 3.1, as published by the Free Software Foundation. -- -- -- -- You should have received a copy of the GNU General Public License and -- -- a copy of the GCC Runtime Library Exception along with this program; -- -- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- -- <http://www.gnu.org/licenses/>. -- -- -- -- GNARL was developed by the GNARL team at Florida State University. -- -- Extensive contributions were provided by Ada Core Technologies, Inc. -- -- -- ------------------------------------------------------------------------------ with Ada.Unchecked_Deallocation; separate (System.Task_Primitives.Operations) package body ATCB_Allocation is --------------- -- Free_ATCB -- --------------- procedure Free_ATCB (T : Task_Id) is Tmp : Task_Id := T; Is_Self : constant Boolean := T = Self; procedure Free is new Ada.Unchecked_Deallocation (Ada_Task_Control_Block, Task_Id); begin if Is_Self then declare Local_ATCB : aliased Ada_Task_Control_Block (0); -- Create a dummy ATCB and initialize it minimally so that "Free" -- can still call Self and Defer/Undefer_Abort after Tmp is freed -- by the underlying memory management library. begin Local_ATCB.Common.LL.Thread := T.Common.LL.Thread; Local_ATCB.Common.Current_Priority := T.Common.Current_Priority; Specific.Set (Local_ATCB'Unchecked_Access); Free (Tmp); -- Note: it is assumed here that for all platforms, Specific.Set -- deletes the task specific information if passed a null value. Specific.Set (null); end; else Free (Tmp); end if; end Free_ATCB; -------------- -- New_ATCB -- -------------- function New_ATCB (Entry_Num : Task_Entry_Index) return Task_Id is begin return new Ada_Task_Control_Block (Entry_Num); end New_ATCB; end ATCB_Allocation;
45.547619
78
0.464715
58a811419f65e536f6a57d99921a517c1deca7c3
4,984
ads
Ada
src/sys/streams/util-streams.ads
yrashk/ada-util
2aaa1d87e92a7137e1c63dce90f0722c549dfafd
[ "Apache-2.0" ]
60
2015-01-18T23:05:34.000Z
2022-03-20T18:56:30.000Z
src/sys/streams/util-streams.ads
yrashk/ada-util
2aaa1d87e92a7137e1c63dce90f0722c549dfafd
[ "Apache-2.0" ]
20
2016-09-15T16:41:30.000Z
2022-03-29T22:02:32.000Z
src/sys/streams/util-streams.ads
yrashk/ada-util
2aaa1d87e92a7137e1c63dce90f0722c549dfafd
[ "Apache-2.0" ]
10
2015-02-13T04:00:45.000Z
2022-03-20T18:57:54.000Z
----------------------------------------------------------------------- -- util-streams -- Stream utilities -- Copyright (C) 2010, 2016, 2018, 2019, 2020 Stephane Carrez -- Written by Stephane Carrez ([email protected]) -- -- 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. ----------------------------------------------------------------------- with Ada.Streams; -- = Streams = -- The `Util.Streams` package provides several types and operations to allow the -- composition of input and output streams. Input streams can be chained together so that -- they traverse the different stream objects when the data is read from them. Similarly, -- output streams can be chained and the data that is written will traverse the different -- streams from the first one up to the last one in the chain. During such traversal, the -- stream object is able to bufferize the data or make transformations on the data. -- -- The `Input_Stream` interface represents the stream to read data. It only provides a -- `Read` procedure. The `Output_Stream` interface represents the stream to write data. -- It provides a `Write`, `Flush` and `Close` operation. -- -- To use the packages described here, use the following GNAT project: -- -- with "utilada_sys"; -- -- @include util-streams-buffered.ads -- @include util-streams-texts.ads -- @include util-streams-files.ads -- @include util-streams-pipes.ads -- @include util-streams-sockets.ads -- @include util-streams-raw.ads -- @include util-streams-base16.ads -- @include util-streams-base64.ads -- @include util-streams-aes.ads package Util.Streams is pragma Preelaborate; -- ----------------------- -- Output stream -- ----------------------- -- The <b>Output_Stream</b> is an interface that accepts output bytes -- and sends them to a sink. type Output_Stream is limited interface; type Output_Stream_Access is access all Output_Stream'Class; -- Write the buffer array to the output stream. procedure Write (Stream : in out Output_Stream; Buffer : in Ada.Streams.Stream_Element_Array) is abstract; -- Flush the buffer (if any) to the sink. procedure Flush (Stream : in out Output_Stream) is null; -- Close the sink. procedure Close (Stream : in out Output_Stream) is null; -- ----------------------- -- Input stream -- ----------------------- -- The <b>Input_Stream</b> is the interface that reads input bytes -- from a source and returns them. type Input_Stream is limited interface; type Input_Stream_Access is access all Input_Stream'Class; -- Read into the buffer as many bytes as possible and return in -- <b>last</b> the position of the last byte read. procedure Read (Stream : in out Input_Stream; Into : out Ada.Streams.Stream_Element_Array; Last : out Ada.Streams.Stream_Element_Offset) is abstract; -- Copy the input stream to the output stream until the end of the input stream -- is reached. procedure Copy (From : in out Input_Stream'Class; Into : in out Output_Stream'Class); -- Copy the stream array to the string. -- The string must be large enough to hold the stream array -- or a Constraint_Error exception is raised. procedure Copy (From : in Ada.Streams.Stream_Element_Array; Into : in out String); -- Copy the string to the stream array. -- The stream array must be large enough to hold the string -- or a Constraint_Error exception is raised. procedure Copy (From : in String; Into : in out Ada.Streams.Stream_Element_Array); -- Write a raw string on the stream. procedure Write (Stream : in out Output_Stream'Class; Item : in Character); procedure Write (Stream : in out Output_Stream'Class; Item : in String); -- Write a wide character on the stream using a UTF-8 sequence. procedure Write_Wide (Stream : in out Output_Stream'Class; Item : in Wide_Wide_Character); procedure Write_Wide (Stream : in out Output_Stream'Class; Item : in Wide_Wide_String); -- Notes: -- ------ -- The <b>Ada.Streams.Root_Stream_Type</b> implements the <b>Output_Stream</b> -- and <b>Input_Stream</b>. It is however not easy to use for composing various -- stream behaviors. end Util.Streams;
41.882353
91
0.652087
c7ad6deffc1c3fca0bce5b344597945553ac8416
2,528
adb
Ada
src/sdl-events-events.adb
rveenker/sdlada
2ef55d2100b248db44c89cb3a9f20038e453f330
[ "Zlib" ]
1
2021-10-30T14:41:56.000Z
2021-10-30T14:41:56.000Z
src/sdl-events-events.adb
rveenker/sdlada
2ef55d2100b248db44c89cb3a9f20038e453f330
[ "Zlib" ]
null
null
null
src/sdl-events-events.adb
rveenker/sdlada
2ef55d2100b248db44c89cb3a9f20038e453f330
[ "Zlib" ]
null
null
null
-------------------------------------------------------------------------------------------------------------------- -- Copyright (c) 2013-2020, Luke A. Guest -- -- This software is provided 'as-is', without any express or implied -- warranty. In no event will the authors be held liable for any damages -- arising from the use of this software. -- -- Permission is granted to anyone to use this software for any purpose, -- including commercial applications, and to alter it and redistribute it -- freely, subject to the following restrictions: -- -- 1. The origin of this software must not be misrepresented; you must not -- claim that you wrote the original software. If you use this software -- in a product, an acknowledgment in the product documentation would be -- appreciated but is not required. -- -- 2. Altered source versions must be plainly marked as such, and must not be -- misrepresented as being the original software. -- -- 3. This notice may not be removed or altered from any source -- distribution. -------------------------------------------------------------------------------------------------------------------- with Interfaces.C; with SDL.Error; package body SDL.Events.Events is use type Interfaces.C.int; function Poll (Event : out Events) return Boolean is function SDL_Poll_Event (Event : out Events) return Interfaces.C.int with Import => True, Convention => C, External_Name => "SDL_PollEvent"; begin return SDL_Poll_Event (Event) = 1; end Poll; procedure SDL_PumpEvents; pragma Import (CPP, SDL_PumpEvents, "SDL_PumpEvents"); procedure Pump is procedure SDL_PumpEvents; pragma Import (CPP, SDL_PumpEvents, "SDL_PumpEvents"); begin SDL_PumpEvents; end Pump; function Push (Event : in Events) return Boolean is use type Interfaces.C.int; function SDL_Push_Event (Event : in Events) return Interfaces.C.int with Import => True, Convention => C, External_Name => "SDL_PushEvent"; begin return SDL_Push_Event (Event) = 1; end Push; procedure Wait (Event : out Events) is function SDL_Wait_Event (Event : out Events) return Interfaces.C.int with Import => True, Convention => C, External_Name => "SDL_WaitEvent"; begin if SDL_Wait_Event (Event) = 0 then raise Event_Error with SDL.Error.Get; end if; end Wait; end SDL.Events.Events;
36.114286
116
0.612342
2949687870653a8de37cd05d2fcdfbed7d946d84
849
adb
Ada
test/tests.adb
Jellix/virtual_clocks
622bea775af63ae6f02a8d0f097435273b6f686e
[ "WTFPL" ]
null
null
null
test/tests.adb
Jellix/virtual_clocks
622bea775af63ae6f02a8d0f097435273b6f686e
[ "WTFPL" ]
null
null
null
test/tests.adb
Jellix/virtual_clocks
622bea775af63ae6f02a8d0f097435273b6f686e
[ "WTFPL" ]
null
null
null
------------------------------------------------------------------------ -- Copyright (C) 2010-2020 by <[email protected]> -- -- -- -- This work is free. You can redistribute it and/or modify it under -- -- the terms of the Do What The Fuck You Want To Public License, -- -- Version 2, as published by Sam Hocevar. See the LICENSE file for -- -- more details. -- ------------------------------------------------------------------------ pragma License (Unrestricted); with Test_Clocks; ------------------------------------------------------------------------ -- Tests ------------------------------------------------------------------------ procedure Tests is begin Test_Clocks.Run; end Tests;
38.590909
72
0.3404
29282b9f4c6220ead421b2edbca2828b6cf29340
3,740
adb
Ada
arch/ARM/STM32/drivers/stm32-rng-polling.adb
shakram02/Ada_Drivers_Library
a407ca7ddbc2d9756647016c2f8fd8ef24a239ff
[ "BSD-3-Clause" ]
192
2016-06-01T18:32:04.000Z
2022-03-26T22:52:31.000Z
arch/ARM/STM32/drivers/stm32-rng-polling.adb
morbos/Ada_Drivers_Library
a4ab26799be60997c38735f4056160c4af597ef7
[ "BSD-3-Clause" ]
239
2016-05-26T20:02:01.000Z
2022-03-31T09:46:56.000Z
arch/ARM/STM32/drivers/stm32-rng-polling.adb
morbos/Ada_Drivers_Library
a4ab26799be60997c38735f4056160c4af597ef7
[ "BSD-3-Clause" ]
142
2016-06-05T08:12:20.000Z
2022-03-24T17:37:17.000Z
------------------------------------------------------------------------------ -- -- -- Copyright (C) 2015, AdaCore -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions are -- -- met: -- -- 1. Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- 2. Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in -- -- the documentation and/or other materials provided with the -- -- distribution. -- -- 3. Neither the name of STMicroelectronics nor the names of its -- -- contributors may be used to endorse or promote products derived -- -- from this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -- -- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -- -- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -- -- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -- -- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -- -- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- -- -- -- This file is based on: -- -- -- -- @file stm32f4xx_hal_rng.c -- -- @author MCD Application Team -- -- @version V1.1.0 -- -- @date 19-June-2014 -- -- @brief RNG HAL module driver. -- -- -- -- COPYRIGHT(c) 2014 STMicroelectronics -- ------------------------------------------------------------------------------ package body STM32.RNG.Polling is -------------------- -- Initialize_RNG -- -------------------- procedure Initialize_RNG is Discard : UInt32; begin Enable_RNG_Clock; Enable_RNG; -- Discard the first randomly generated number, according to STM32F4 -- docs. Discard := Random; end Initialize_RNG; ------------ -- Random -- ------------ function Random return UInt32 is begin while not RNG_Data_Ready loop null; end loop; return RNG_Data; end Random; end STM32.RNG.Polling;
51.944444
78
0.441711
22e62ba847d4b22c4aeaa3a3fcd95c16ffbea520
2,814
ada
Ada
gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/c4/c48004e.ada
best08618/asylo
5a520a9f5c461ede0f32acc284017b737a43898c
[ "Apache-2.0" ]
7
2020-05-02T17:34:05.000Z
2021-10-17T10:15:18.000Z
gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/c4/c48004e.ada
best08618/asylo
5a520a9f5c461ede0f32acc284017b737a43898c
[ "Apache-2.0" ]
null
null
null
gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/c4/c48004e.ada
best08618/asylo
5a520a9f5c461ede0f32acc284017b737a43898c
[ "Apache-2.0" ]
2
2020-07-27T00:22:36.000Z
2021-04-01T09:41:02.000Z
-- C48004E.ADA -- Grant of Unlimited Rights -- -- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687, -- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained -- unlimited rights in the software and documentation contained herein. -- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making -- this public release, the Government intends to confer upon all -- recipients unlimited rights equal to those held by the Government. -- These rights include rights to use, duplicate, release or disclose the -- released technical data and computer software in whole or in part, in -- any manner and for any purpose whatsoever, and to have or permit others -- to do so. -- -- DISCLAIMER -- -- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR -- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED -- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE -- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE -- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A -- PARTICULAR PURPOSE OF SAID MATERIAL. --* -- CHECK THAT THE FORM "NEW T" IS PERMITTED IF T IS A CONSTRAINED ARRAY -- TYPE. -- RM 01/12/80 -- JBG 03/03/83 -- EG 07/05/84 WITH REPORT; PROCEDURE C48004E IS USE REPORT; BEGIN TEST("C48004E","CHECK THAT THE FORM 'NEW T' IS PERMITTED IF T " & "IS A CONSTRAINED ARRAY TYPE"); DECLARE TYPE ARR0 IS ARRAY( INTEGER RANGE <> ) OF BOOLEAN; SUBTYPE ARR IS ARR0(1 .. 10); TYPE A_ARR IS ACCESS ARR; VARR : A_ARR; PACKAGE P IS TYPE LPRIV IS LIMITED PRIVATE; FUNCTION CHECK (X : LPRIV) RETURN INTEGER; PRIVATE TYPE LPRIV IS RECORD Q : INTEGER := 20; END RECORD; END P; TYPE LPARR IS ARRAY(1 .. 2) OF P.LPRIV; TYPE A_LPARR IS ACCESS LPARR; V_A_LPARR : A_LPARR; PACKAGE BODY P IS FUNCTION CHECK (X : LPRIV) RETURN INTEGER IS BEGIN RETURN X.Q; END CHECK; END P; BEGIN VARR := NEW ARR; IF ( VARR'FIRST /= IDENT_INT(1) OR VARR'LAST /= 10 ) THEN FAILED("WRONG BOUNDS - CASE 1"); END IF; V_A_LPARR := NEW LPARR; IF ( P.CHECK(V_A_LPARR.ALL(1)) /= IDENT_INT(20) OR P.CHECK(V_A_LPARR.ALL(2)) /= IDENT_INT(20) ) THEN FAILED ("WRONG VALUES - CASE 2"); END IF; END; RESULT; END C48004E;
31.266667
79
0.56823
3df3b4f232241fd1339c30ea4ab7c42d27086217
4,278
adb
Ada
src/giza-bitmaps.adb
Fabien-Chouteau/Giza
9f6c167666dbba8f0e5f0ba3e33825c0b3f399bd
[ "BSD-3-Clause" ]
7
2017-10-18T02:40:24.000Z
2020-12-19T22:41:19.000Z
src/giza-bitmaps.adb
Fabien-Chouteau/Giza
9f6c167666dbba8f0e5f0ba3e33825c0b3f399bd
[ "BSD-3-Clause" ]
null
null
null
src/giza-bitmaps.adb
Fabien-Chouteau/Giza
9f6c167666dbba8f0e5f0ba3e33825c0b3f399bd
[ "BSD-3-Clause" ]
2
2019-05-06T08:30:26.000Z
2020-11-22T11:27:27.000Z
------------------------------------------------------------------------------ -- -- -- Giza -- -- -- -- Copyright (C) 2016 Fabien Chouteau ([email protected]) -- -- -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions are -- -- met: -- -- 1. Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- 2. Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in -- -- the documentation and/or other materials provided with the -- -- distribution. -- -- 3. Neither the name of the copyright holder nor the names of its -- -- contributors may be used to endorse or promote products derived -- -- from this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -- -- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -- -- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -- -- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -- -- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -- -- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ package body Giza.Bitmaps is --------------- -- Get_Pixel -- --------------- function Get_Pixel (Bmp : Bitmap; Pt : Point_T) return Color is begin return Bmp.Data ((Pt.X + Bmp.Data'First) + (Pt.Y * (Bmp.W))); end Get_Pixel; package body Indexed_Bitmaps is type Raw_Array is array (Integer range <>) of Index_Type with Pack; --------------- -- Get_Pixel -- --------------- function Get_Pixel (Bmp : Bitmap_Indexed; Pt : Point_T) return Color is Map : Raw_Array (1 .. (Bmp.H * Bmp.W)); for Map'Address use Bmp.Data'Address; begin return Bmp.Palette (Map ((Pt.X + 1) + (Pt.Y * (Bmp.W)))); end Get_Pixel; end Indexed_Bitmaps; -- --------------- -- -- Set_Pixel -- -- --------------- -- -- overriding procedure Set_Pixel -- (This : in out Bitmap_Backend; -- Pt : Point_T) -- is -- begin -- if Pt.X + 1 in This.Data.Data'Range (1) -- and then -- Pt.Y + 1 in This.Data.Data'Range (2) -- then -- This.Data.Data (Pt.X + 1, Pt.Y + 1) := This.Current_Color; -- end if; -- end Set_Pixel; -- -- --------------- -- -- Set_Color -- -- --------------- -- -- overriding procedure Set_Color -- (This : in out Bitmap_Backend; -- C : Color) -- is -- begin -- This.Current_Color := C; -- end Set_Color; -- -- ---------- -- -- Size -- -- ---------- -- -- overriding function Size -- (This : Bitmap_Backend) -- return Size_T -- is -- begin -- return (This.W, This.H); -- end Size; end Giza.Bitmaps;
41.134615
78
0.469378
1a76c2878dbfa7430d032ae13968bac46ddd1274
7,383
adb
Ada
source/nodes/program-nodes-single_protected_declarations.adb
reznikmm/gela
20134f1d154fb763812e73860c6f4b04f353df79
[ "MIT" ]
null
null
null
source/nodes/program-nodes-single_protected_declarations.adb
reznikmm/gela
20134f1d154fb763812e73860c6f4b04f353df79
[ "MIT" ]
null
null
null
source/nodes/program-nodes-single_protected_declarations.adb
reznikmm/gela
20134f1d154fb763812e73860c6f4b04f353df79
[ "MIT" ]
1
2019-10-16T09:05:27.000Z
2019-10-16T09:05:27.000Z
-- SPDX-FileCopyrightText: 2019 Max Reznik <[email protected]> -- -- SPDX-License-Identifier: MIT ------------------------------------------------------------- package body Program.Nodes.Single_Protected_Declarations is function Create (Protected_Token : not null Program.Lexical_Elements .Lexical_Element_Access; Name : not null Program.Elements.Defining_Identifiers .Defining_Identifier_Access; With_Token : Program.Lexical_Elements.Lexical_Element_Access; Aspects : Program.Elements.Aspect_Specifications .Aspect_Specification_Vector_Access; Is_Token : not null Program.Lexical_Elements .Lexical_Element_Access; New_Token : Program.Lexical_Elements.Lexical_Element_Access; Progenitors : Program.Elements.Expressions.Expression_Vector_Access; With_Token_2 : Program.Lexical_Elements.Lexical_Element_Access; Definition : not null Program.Elements.Protected_Definitions .Protected_Definition_Access; Semicolon_Token : not null Program.Lexical_Elements .Lexical_Element_Access) return Single_Protected_Declaration is begin return Result : Single_Protected_Declaration := (Protected_Token => Protected_Token, Name => Name, With_Token => With_Token, Aspects => Aspects, Is_Token => Is_Token, New_Token => New_Token, Progenitors => Progenitors, With_Token_2 => With_Token_2, Definition => Definition, Semicolon_Token => Semicolon_Token, Enclosing_Element => null) do Initialize (Result); end return; end Create; function Create (Name : not null Program.Elements.Defining_Identifiers .Defining_Identifier_Access; Aspects : Program.Elements.Aspect_Specifications .Aspect_Specification_Vector_Access; Progenitors : Program.Elements.Expressions .Expression_Vector_Access; Definition : not null Program.Elements.Protected_Definitions .Protected_Definition_Access; Is_Part_Of_Implicit : Boolean := False; Is_Part_Of_Inherited : Boolean := False; Is_Part_Of_Instance : Boolean := False) return Implicit_Single_Protected_Declaration is begin return Result : Implicit_Single_Protected_Declaration := (Name => Name, Aspects => Aspects, Progenitors => Progenitors, Definition => Definition, Is_Part_Of_Implicit => Is_Part_Of_Implicit, Is_Part_Of_Inherited => Is_Part_Of_Inherited, Is_Part_Of_Instance => Is_Part_Of_Instance, Enclosing_Element => null) do Initialize (Result); end return; end Create; overriding function Name (Self : Base_Single_Protected_Declaration) return not null Program.Elements.Defining_Identifiers .Defining_Identifier_Access is begin return Self.Name; end Name; overriding function Aspects (Self : Base_Single_Protected_Declaration) return Program.Elements.Aspect_Specifications .Aspect_Specification_Vector_Access is begin return Self.Aspects; end Aspects; overriding function Progenitors (Self : Base_Single_Protected_Declaration) return Program.Elements.Expressions.Expression_Vector_Access is begin return Self.Progenitors; end Progenitors; overriding function Definition (Self : Base_Single_Protected_Declaration) return not null Program.Elements.Protected_Definitions .Protected_Definition_Access is begin return Self.Definition; end Definition; overriding function Protected_Token (Self : Single_Protected_Declaration) return not null Program.Lexical_Elements.Lexical_Element_Access is begin return Self.Protected_Token; end Protected_Token; overriding function With_Token (Self : Single_Protected_Declaration) return Program.Lexical_Elements.Lexical_Element_Access is begin return Self.With_Token; end With_Token; overriding function Is_Token (Self : Single_Protected_Declaration) return not null Program.Lexical_Elements.Lexical_Element_Access is begin return Self.Is_Token; end Is_Token; overriding function New_Token (Self : Single_Protected_Declaration) return Program.Lexical_Elements.Lexical_Element_Access is begin return Self.New_Token; end New_Token; overriding function With_Token_2 (Self : Single_Protected_Declaration) return Program.Lexical_Elements.Lexical_Element_Access is begin return Self.With_Token_2; end With_Token_2; overriding function Semicolon_Token (Self : Single_Protected_Declaration) return not null Program.Lexical_Elements.Lexical_Element_Access is begin return Self.Semicolon_Token; end Semicolon_Token; overriding function Is_Part_Of_Implicit (Self : Implicit_Single_Protected_Declaration) return Boolean is begin return Self.Is_Part_Of_Implicit; end Is_Part_Of_Implicit; overriding function Is_Part_Of_Inherited (Self : Implicit_Single_Protected_Declaration) return Boolean is begin return Self.Is_Part_Of_Inherited; end Is_Part_Of_Inherited; overriding function Is_Part_Of_Instance (Self : Implicit_Single_Protected_Declaration) return Boolean is begin return Self.Is_Part_Of_Instance; end Is_Part_Of_Instance; procedure Initialize (Self : in out Base_Single_Protected_Declaration'Class) is begin Set_Enclosing_Element (Self.Name, Self'Unchecked_Access); for Item in Self.Aspects.Each_Element loop Set_Enclosing_Element (Item.Element, Self'Unchecked_Access); end loop; for Item in Self.Progenitors.Each_Element loop Set_Enclosing_Element (Item.Element, Self'Unchecked_Access); end loop; Set_Enclosing_Element (Self.Definition, Self'Unchecked_Access); null; end Initialize; overriding function Is_Single_Protected_Declaration (Self : Base_Single_Protected_Declaration) return Boolean is pragma Unreferenced (Self); begin return True; end Is_Single_Protected_Declaration; overriding function Is_Declaration (Self : Base_Single_Protected_Declaration) return Boolean is pragma Unreferenced (Self); begin return True; end Is_Declaration; overriding procedure Visit (Self : not null access Base_Single_Protected_Declaration; Visitor : in out Program.Element_Visitors.Element_Visitor'Class) is begin Visitor.Single_Protected_Declaration (Self); end Visit; overriding function To_Single_Protected_Declaration_Text (Self : in out Single_Protected_Declaration) return Program.Elements.Single_Protected_Declarations .Single_Protected_Declaration_Text_Access is begin return Self'Unchecked_Access; end To_Single_Protected_Declaration_Text; overriding function To_Single_Protected_Declaration_Text (Self : in out Implicit_Single_Protected_Declaration) return Program.Elements.Single_Protected_Declarations .Single_Protected_Declaration_Text_Access is pragma Unreferenced (Self); begin return null; end To_Single_Protected_Declaration_Text; end Program.Nodes.Single_Protected_Declarations;
34.990521
79
0.730597
29a341be362dbd63c6defd6dc75f90ef24ff236c
2,028
ads
Ada
strings_edit-floats.ads
jrcarter/Ada_GUI
65a829c55dec91fd48a0b72f88d76137768bf4fb
[ "BSD-3-Clause" ]
19
2018-03-18T18:07:14.000Z
2022-03-30T03:10:12.000Z
strings_edit-floats.ads
jrcarter/Ada_GUI
65a829c55dec91fd48a0b72f88d76137768bf4fb
[ "BSD-3-Clause" ]
4
2021-08-23T12:52:06.000Z
2022-03-31T10:48:43.000Z
strings_edit-floats.ads
jrcarter/Ada_GUI
65a829c55dec91fd48a0b72f88d76137768bf4fb
[ "BSD-3-Clause" ]
null
null
null
-- -- -- package Strings_Edit.Floats Copyright (c) Dmitry A. Kazakov -- -- Instantiation Luebeck -- -- Spring, 2002 -- -- -- -- Last revision : 21:03 21 Apr 2009 -- -- -- -- This library is free software; you can redistribute it and/or -- -- modify it under the terms of the GNU General Public License as -- -- published by the Free Software Foundation; either version 2 of -- -- the License, or (at your option) any later version. This library -- -- is distributed in the hope that it will be useful, but WITHOUT -- -- 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 along with -- -- this library; if not, write to the Free Software Foundation, -- -- Inc., 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. -- --____________________________________________________________________-- with Strings_Edit.Float_Edit; package Strings_Edit.Floats is new Strings_Edit.Float_Edit (Float);
65.419355
73
0.543886
c7e874b29d734aa9c7b7b51cc96f42d1dab419dd
1,387
ada
Ada
gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/ca/ca1022a2.ada
best08618/asylo
5a520a9f5c461ede0f32acc284017b737a43898c
[ "Apache-2.0" ]
7
2020-05-02T17:34:05.000Z
2021-10-17T10:15:18.000Z
gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/ca/ca1022a2.ada
best08618/asylo
5a520a9f5c461ede0f32acc284017b737a43898c
[ "Apache-2.0" ]
null
null
null
gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/ca/ca1022a2.ada
best08618/asylo
5a520a9f5c461ede0f32acc284017b737a43898c
[ "Apache-2.0" ]
2
2020-07-27T00:22:36.000Z
2021-04-01T09:41:02.000Z
-- CA1022A2.ADA -- Grant of Unlimited Rights -- -- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687, -- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained -- unlimited rights in the software and documentation contained herein. -- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making -- this public release, the Government intends to confer upon all -- recipients unlimited rights equal to those held by the Government. -- These rights include rights to use, duplicate, release or disclose the -- released technical data and computer software in whole or in part, in -- any manner and for any purpose whatsoever, and to have or permit others -- to do so. -- -- DISCLAIMER -- -- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR -- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED -- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE -- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE -- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A -- PARTICULAR PURPOSE OF SAID MATERIAL. --* -- BHS 7/23/84 WITH CA1022A0; FUNCTION CA1022A2 (Z : INTEGER := 1) RETURN BOOLEAN IS BEGIN RETURN TRUE; END CA1022A2;
40.794118
79
0.677722
1a72df0b0e5f1fb8bd6f1053cedc04d9f7b4d206
3,584
ads
Ada
bb-runtimes/runtimes/ravenscar-sfp-stm32f3x4/gnarl/s-bbprot.ads
JCGobbi/Nucleo-STM32F334R8
2a0b1b4b2664c92773703ac5e95dcb71979d051c
[ "BSD-3-Clause" ]
null
null
null
bb-runtimes/runtimes/ravenscar-sfp-stm32f3x4/gnarl/s-bbprot.ads
JCGobbi/Nucleo-STM32F334R8
2a0b1b4b2664c92773703ac5e95dcb71979d051c
[ "BSD-3-Clause" ]
null
null
null
bb-runtimes/runtimes/ravenscar-sfp-stm32f3x4/gnarl/s-bbprot.ads
JCGobbi/Nucleo-STM32F334R8
2a0b1b4b2664c92773703ac5e95dcb71979d051c
[ "BSD-3-Clause" ]
null
null
null
------------------------------------------------------------------------------ -- -- -- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS -- -- -- -- S Y S T E M . B B . P R O T E C T I O N -- -- -- -- S p e c -- -- -- -- Copyright (C) 1999-2002 Universidad Politecnica de Madrid -- -- Copyright (C) 2003-2004 The European Space Agency -- -- Copyright (C) 2003-2021, AdaCore -- -- -- -- GNARL 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 3, or (at your option) any later ver- -- -- sion. GNARL 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. -- -- -- -- -- -- -- -- -- -- -- -- You should have received a copy of the GNU General Public License and -- -- a copy of the GCC Runtime Library Exception along with this program; -- -- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- -- <http://www.gnu.org/licenses/>. -- -- -- -- GNARL was developed by the GNARL team at Florida State University. -- -- Extensive contributions were provided by Ada Core Technologies, Inc. -- -- -- -- The port of GNARL to bare board targets was initially developed by the -- -- Real-Time Systems Group at the Technical University of Madrid. -- -- -- ------------------------------------------------------------------------------ -- This package provides the functionality required to protect the data -- handled by the low level tasking system. pragma Restrictions (No_Elaboration_Code); package System.BB.Protection is pragma Preelaborate; Wakeup_Served_Entry_Callback : access procedure := null; -- Callback set by upper layer procedure Enter_Kernel; pragma Inline (Enter_Kernel); -- This procedure is executed to signal the access to kernel data. Its use -- protect the consistence of the kernel. Interrupts are disabled while -- kernel data is being accessed. procedure Leave_Kernel; -- Leave_Kernel must be called when the access to kernel data finishes. -- Interrupts are enable to the appropriate level (according to the active -- priority of the running thread). end System.BB.Protection;
60.745763
78
0.421038
dfd4cd9452533b6c274298b4683868c3ba35a18a
3,764
adb
Ada
bb-runtimes/runtimes/zfp-stm32f3x4/gnat/s-imageu.adb
JCGobbi/Nucleo-STM32F334R8
2a0b1b4b2664c92773703ac5e95dcb71979d051c
[ "BSD-3-Clause" ]
null
null
null
bb-runtimes/runtimes/zfp-stm32f3x4/gnat/s-imageu.adb
JCGobbi/Nucleo-STM32F334R8
2a0b1b4b2664c92773703ac5e95dcb71979d051c
[ "BSD-3-Clause" ]
null
null
null
bb-runtimes/runtimes/zfp-stm32f3x4/gnat/s-imageu.adb
JCGobbi/Nucleo-STM32F334R8
2a0b1b4b2664c92773703ac5e95dcb71979d051c
[ "BSD-3-Clause" ]
null
null
null
------------------------------------------------------------------------------ -- -- -- GNAT RUN-TIME COMPONENTS -- -- -- -- S Y S T E M . I M A G E _ U -- -- -- -- B o d y -- -- -- -- Copyright (C) 1992-2021, Free Software Foundation, Inc. -- -- -- -- GNAT 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 3, or (at your option) any later ver- -- -- sion. GNAT 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. -- -- -- -- -- -- -- -- -- -- -- -- You should have received a copy of the GNU General Public License and -- -- a copy of the GCC Runtime Library Exception along with this program; -- -- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- -- <http://www.gnu.org/licenses/>. -- -- -- -- GNAT was originally developed by the GNAT team at New York University. -- -- Extensive contributions were provided by Ada Core Technologies Inc. -- -- -- ------------------------------------------------------------------------------ package body System.Image_U is -------------------- -- Image_Unsigned -- -------------------- procedure Image_Unsigned (V : Uns; S : in out String; P : out Natural) is pragma Assert (S'First = 1); begin S (1) := ' '; P := 1; Set_Image_Unsigned (V, S, P); end Image_Unsigned; ------------------------ -- Set_Image_Unsigned -- ------------------------ procedure Set_Image_Unsigned (V : Uns; S : in out String; P : in out Natural) is Nb_Digits : Natural := 0; Value : Uns := V; begin pragma Assert (P >= S'First - 1 and then P < S'Last and then P < Natural'Last); -- No check is done since, as documented in the specification, the -- caller guarantees that S is long enough to hold the result. -- First we compute the number of characters needed for representing -- the number. loop Value := Value / 10; Nb_Digits := Nb_Digits + 1; exit when Value = 0; end loop; Value := V; -- We now populate digits from the end of the string to the beginning for J in reverse 1 .. Nb_Digits loop S (P + J) := Character'Val (48 + (Value rem 10)); Value := Value / 10; end loop; P := P + Nb_Digits; end Set_Image_Unsigned; end System.Image_U;
43.264368
78
0.376196
22f203e252f292124dbf136f9254e3e2cf6a84d0
2,476
ads
Ada
tools/xml2ayacc/encoding/auto/encodings-maps-cp_864.ads
faelys/gela-asis
48a3bee90eda9f0c9d958b4e3c80a5a9b1c65253
[ "BSD-3-Clause" ]
4
2016-02-05T15:51:56.000Z
2022-03-25T20:38:32.000Z
tools/xml2ayacc/encoding/auto/encodings-maps-cp_864.ads
faelys/gela-asis
48a3bee90eda9f0c9d958b4e3c80a5a9b1c65253
[ "BSD-3-Clause" ]
null
null
null
tools/xml2ayacc/encoding/auto/encodings-maps-cp_864.ads
faelys/gela-asis
48a3bee90eda9f0c9d958b4e3c80a5a9b1c65253
[ "BSD-3-Clause" ]
null
null
null
-- Auto generated file. Don't edit -- Read copyright and license at the end of this file package Encodings.Maps.CP_864 is function Decode (Char : Character) return Wide_Character; pragma Inline (Decode); procedure Encode (Text : in Wide_String; Text_Last : out Natural; Result : out Raw_String; Result_Last : out Natural; Map : in Encoding := Encodings.CP_864); procedure Decode (Text : in Raw_String; Text_Last : out Natural; Result : out Wide_String; Result_Last : out Natural; Map : in Encoding := Encodings.CP_864); end Encodings.Maps.CP_864; ------------------------------------------------------------------------------ -- Copyright (c) 2006-2013, Maxim Reznik -- All rights reserved. -- -- Redistribution and use in source and binary forms, with or without -- modification, are permitted provided that the following conditions are met: -- -- * Redistributions of source code must retain the above copyright notice, -- this list of conditions and the following disclaimer. -- * Redistributions in binary form must reproduce the above copyright -- notice, this list of conditions and the following disclaimer in the -- documentation and/or other materials provided with the distribution. -- * Neither the name of the Maxim Reznik, IE nor the names of its -- contributors may be used to endorse or promote products derived from -- this software without specific prior written permission. -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE -- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -- POSSIBILITY OF SUCH DAMAGE. ------------------------------------------------------------------------------
45.851852
79
0.657916
31d11899735aa024508e938bf8f9b5dc24b89b1b
4,071
adb
Ada
tools-src/gnu/gcc/gcc/ada/s-tpinop.adb
modern-tomato/tomato
96f09fab4929c6ddde5c9113f1b2476ad37133c4
[ "FSFAP" ]
80
2015-01-02T10:14:04.000Z
2021-06-07T06:29:49.000Z
tools-src/gnu/gcc/gcc/ada/s-tpinop.adb
modern-tomato/tomato
96f09fab4929c6ddde5c9113f1b2476ad37133c4
[ "FSFAP" ]
9
2015-05-14T11:03:12.000Z
2018-01-04T07:12:58.000Z
tools-src/gnu/gcc/gcc/ada/s-tpinop.adb
modern-tomato/tomato
96f09fab4929c6ddde5c9113f1b2476ad37133c4
[ "FSFAP" ]
69
2015-01-02T10:45:56.000Z
2021-09-06T07:52:13.000Z
------------------------------------------------------------------------------ -- -- -- GNU ADA RUN-TIME LIBRARY (GNARL) COMPONENTS -- -- -- -- S Y S T E M . T A S K _ P R I M I T I V E S . -- -- I N T E R R U P T _ O P E R A T I O N S -- -- -- -- B o d y -- -- -- -- $Revision$ -- -- -- Copyright (C) 1998-2001 Free Software Foundation, Inc. -- -- -- -- GNARL 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. GNARL 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 GNARL; 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. -- -- -- -- GNARL was developed by the GNARL team at Florida State University. -- -- Extensive contributions were provided by Ada Core Technologies Inc. -- -- -- ------------------------------------------------------------------------------ package body System.Task_Primitives.Interrupt_Operations is -- ??? The VxWorks version of System.Interrupt_Management needs to access -- this array, but due to elaboration problems, it can't with this -- package directly, so we export this variable for now. Interrupt_ID_Map : array (IM.Interrupt_ID) of ST.Task_ID; pragma Export (Ada, Interrupt_ID_Map, "system__task_primitives__interrupt_operations__interrupt_id_map"); ---------------------- -- Get_Interrupt_ID -- ---------------------- function Get_Interrupt_ID (T : ST.Task_ID) return IM.Interrupt_ID is use type ST.Task_ID; begin for Interrupt in IM.Interrupt_ID loop if Interrupt_ID_Map (Interrupt) = T then return Interrupt; end if; end loop; raise Program_Error; end Get_Interrupt_ID; ----------------- -- Get_Task_ID -- ----------------- function Get_Task_ID (Interrupt : IM.Interrupt_ID) return ST.Task_ID is begin return Interrupt_ID_Map (Interrupt); end Get_Task_ID; ---------------------- -- Set_Interrupt_ID -- ---------------------- procedure Set_Interrupt_ID (Interrupt : IM.Interrupt_ID; T : ST.Task_ID) is begin Interrupt_ID_Map (Interrupt) := T; end Set_Interrupt_ID; end System.Task_Primitives.Interrupt_Operations;
49.048193
78
0.474576
416f3bf26c642d924f497b68b48373c2e82f5830
385,257
adb
Ada
wayland_ada_scanner/src/wayland_ada_scanner.adb
onox/wayland-ada
9317b87482af03a650e02543a3cb46f20bb747d0
[ "Apache-2.0" ]
5
2021-01-11T01:32:16.000Z
2022-02-03T00:08:11.000Z
wayland_ada_scanner/src/wayland_ada_scanner.adb
onox/wayland-ada
9317b87482af03a650e02543a3cb46f20bb747d0
[ "Apache-2.0" ]
11
2021-01-11T20:12:20.000Z
2022-02-04T09:47:13.000Z
wayland_ada_scanner/src/wayland_ada_scanner.adb
onox/wayland-ada
9317b87482af03a650e02543a3cb46f20bb747d0
[ "Apache-2.0" ]
null
null
null
-- SPDX-License-Identifier: Apache-2.0 -- -- Copyright (c) 2018 - 2019 Joakim Strandberg <[email protected]> -- -- 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. with Ada.Command_Line; with Ada.Containers.Indefinite_Hashed_Maps; with Ada.Containers.Vectors; with Ada.Directories; with Ada.Streams.Stream_IO; with Ada.Strings.Fixed; with Ada.Strings.Hash; with Ada.Strings.Unbounded; with Ada.Text_IO; with Aida.Deepend.XML_DOM_Parser; with Wayland_XML; with Xml_Parser_Utils; procedure Wayland_Ada_Scanner is use type Ada.Containers.Count_Type; use type Wayland_XML.Event_Child; use type Wayland_XML.Request_Child; use all type Wayland_XML.Arg_Tag; use all type Wayland_XML.Copyright_Tag; use all type Wayland_XML.Description_Tag; use all type Wayland_XML.Entry_Tag; use all type Wayland_XML.Enum_Tag; use all type Wayland_XML.Event_Tag; use all type Wayland_XML.Request_Tag; use all type Wayland_XML.Interface_Tag; use all type Wayland_XML.Protocol_Tag; use all type Aida.Deepend.XML_DOM_Parser.Node_Kind_Id; use all type Aida.Deepend.XML_DOM_Parser.Attribute; use all type Aida.Deepend.XML_DOM_Parser.XML_Tag; use all type Wayland_XML.Protocol_Child_Kind_Id; use all type Wayland_XML.Interface_Child_Kind_Id; use all type Wayland_XML.Enum_Child_Kind_Id; use all type Wayland_XML.Event_Child_Kind_Id; use all type Wayland_XML.Arg_Type_Attribute; use all type Wayland_XML.Request_Child_Kind_Id; use all type Wayland_XML.Enum_Child; package SF renames Ada.Strings.Fixed; package SU renames Ada.Strings.Unbounded; package Unbounded_String_Vectors is new Ada.Containers.Vectors (Index_Type => Positive, Element_Type => SU.Unbounded_String, "=" => SU."="); function Trim (Value : String) return String is (SF.Trim (Value, Ada.Strings.Both)); function Is_Reserved_Keyword (Name : String) return Boolean is (Name in "Begin" | "End"); procedure Put (File : Ada.Text_IO.File_Type; Item : String) renames Ada.Text_IO.Put; procedure Put_Line (File : Ada.Text_IO.File_Type; Item : String) renames Ada.Text_IO.Put_Line; procedure Put_Line (Item : String) renames Ada.Text_IO.Put_Line; procedure New_Line (File : Ada.Text_IO.File_Type; Spacing : Ada.Text_IO.Positive_Count := 1) renames Ada.Text_IO.New_Line; function "+" (Value : String) return SU.Unbounded_String renames SU.To_Unbounded_String; function "+" (Value : SU.Unbounded_String) return String renames SU.To_String; XML_Exception : exception; procedure Create_Wayland_Spec_File (Enable_Comments : Boolean); procedure Create_Wayland_Body_File; Protocol_Tag : Wayland_XML.Protocol_Tag_Ptr; function Is_Deprecated (Interface_Tag : Wayland_XML.Interface_Tag) return Boolean is (Name (Interface_Tag) in "wl_shell" | "wl_shell_surface"); -- wl_shell[_surface] are deprecated and replaced by the xdg-shell protocol function Get_Protocol_Name (Name : String) return String is (if Name = "wayland" then "client" else Name); package String_Maps is new Ada.Containers.Indefinite_Hashed_Maps (Key_Type => String, Element_Type => String, Hash => Ada.Strings.Hash, Equivalent_Keys => "="); procedure Generate_Code_For_Arg (File : Ada.Text_IO.File_Type; Interface_Tag : Wayland_XML.Interface_Tag; Arg_Tag : Wayland_XML.Arg_Tag; Max_Length : Natural; Is_Last : Boolean; Enum_Types : in out String_Maps.Map) is function Get_Enum_Type_Name return String is Result : String := Enum (Arg_Tag); begin case SF.Count (Result, ".") is when 0 => return Name (Interface_Tag) & "_" & Result; when 1 => Result (SF.Index (Result, ".")) := '_'; return Result; when others => raise XML_Exception; end case; end Get_Enum_Type_Name; Arg_Name : constant String := Xml_Parser_Utils.Adaify_Variable_Name (Name (Arg_Tag)); Arg_Type : constant String := Xml_Parser_Utils.Arg_Type_As_String (Arg_Tag); Arg_Type_Name : constant String := (if Exists_Enum (Arg_Tag) then Xml_Parser_Utils.Adaify_Name (Get_Enum_Type_Name) else Arg_Type); Arg_Name_Aligned : constant String := SF.Head (Arg_Name, Max_Length, ' '); begin if Arg_Type_Name /= Arg_Type then Enum_Types.Include (Arg_Type_Name, Arg_Type); end if; if Is_Last then Put (File, " " & Arg_Name_Aligned & " : " & Arg_Type_Name & ")"); else Put_Line (File, " " & Arg_Name_Aligned & " : " & Arg_Type_Name & ";"); end if; end Generate_Code_For_Arg; type Parameter is record Name, Ada_Type : SU.Unbounded_String; end record; type Parameter_Array is array (Positive range <>) of Parameter; type Subprogram_Kind is (Declaration, Implementation); Max_Line_Length : constant := 99; Generate_Interfaces_For_Client : constant Boolean := False; Unused_Padding_Name : constant String := "Unused"; procedure Generate_Pretty_Code_For_Subprogram (File : Ada.Text_IO.File_Type; Kind : Subprogram_Kind; Interface_Tag : aliased Wayland_XML.Interface_Tag; Procedure_Name : String; Return_Type : String; Parameters : Parameter_Array := (1 .. 0 => <>)) is Name : constant String := Xml_Parser_Utils.Adaify_Name (Wayland_XML.Name (Interface_Tag)); Ptr_Name : constant String := Xml_Parser_Utils.Adaify_Name (Wayland_XML.Name (Interface_Tag) & "_Ptr"); use Ada.Strings.Fixed; Subprogram_Kind : constant String := (if Return_Type'Length > 0 then "function" else "procedure"); Return_String : constant String := (if Return_Type'Length > 0 then " return " & Return_Type else ""); Max_Name_Length : Natural := Name'Length; function Align (Value : String) return String is (SF.Head (Value, Max_Name_Length, ' ')); Last_Char : constant String := (if Kind = Declaration then ";" else " is"); One_Line : Boolean; begin for Parameter of Parameters loop Max_Name_Length := Natural'Max (Max_Name_Length, SU.Length (Parameter.Name)); end loop; declare Line_Length : Natural := Subprogram_Kind'Length + 8 + 2 * Name'Length + Procedure_Name'Length + Ptr_Name'Length + Return_String'Length + Last_Char'Length + 2 * Parameters'Length; begin for Parameter of Parameters loop Line_Length := Line_Length + SU.Length (Parameter.Name) + SU.Length (Parameter.Ada_Type) + 3; end loop; One_Line := Parameters'Length = 0 and Line_Length <= Max_Line_Length; end; if One_Line then Put (File, " " & Subprogram_Kind & " " & Name & "_" & Procedure_Name & " (" & Name & " : " & Ptr_Name); if Parameters'Length > 0 then Put (File, ";"); for Index in Parameters'Range loop Put (File, " " & (+Parameters (Index).Name) & " : " & (+Parameters (Index).Ada_Type) & (if Index = Parameters'Last then ")" & Return_String & Last_Char else ";")); end loop; Put_Line (File, ""); else Put_Line (File, ")" & Return_String & Last_Char); end if; else Put_Line (File, " " & Subprogram_Kind & " " & Name & "_" & Procedure_Name); if Parameters'Length > 0 then Put_Line (File, " (" & Align (Name) & " : " & Ptr_Name & ";"); for Index in Parameters'Range loop Put_Line (File, " " & Align (+Parameters (Index).Name) & " : " & (+Parameters (Index).Ada_Type) & (if Index = Parameters'Last then ")" & Return_String & Last_Char else ";")); end loop; else Put_Line (File, " (" & Name & " : " & Ptr_Name & ")" & Return_String & Last_Char); end if; end if; end Generate_Pretty_Code_For_Subprogram; procedure Iterate_Over_Interfaces (Process : not null access procedure (Interface_Tag : aliased Wayland_XML.Interface_Tag)) is begin for Child of Children (Protocol_Tag.all) loop if Child.Kind_Id = Child_Interface and then not Is_Deprecated (Child.Interface_Tag.all) then Process (Child.Interface_Tag.all); end if; end loop; end Iterate_Over_Interfaces; procedure Iterate_Over_Requests (Interface_Tag : aliased Wayland_XML.Interface_Tag; Process : not null access procedure (Request_Tag : aliased Wayland_XML.Request_Tag)) is begin for Child of Children (Interface_Tag) loop if Child.Kind_Id = Child_Request then Process (Child.Request_Tag.all); end if; end loop; end Iterate_Over_Requests; procedure Iterate_Over_Events (Interface_Tag : aliased Wayland_XML.Interface_Tag; Process : not null access procedure (Event_Tag : aliased Wayland_XML.Event_Tag)) is begin for Child of Children (Interface_Tag) loop if Child.Kind_Id = Child_Event then Process (Child.Event_Tag.all); end if; end loop; end Iterate_Over_Events; function Get_Name (Arg_Tag : Wayland_XML.Arg_Tag) return String is (Xml_Parser_Utils.Adaify_Variable_Name (Name (Arg_Tag))); procedure Get_Max_Arg_Length (Request_Tag : aliased Wayland_XML.Request_Tag; V : in out Wayland_XML.Request_Child_Vectors.Vector; Length : in out Natural) is begin for Child of Children (Request_Tag) loop if Child.Kind_Id = Child_Arg then if Type_Attribute (Child.Arg_Tag.all) /= Type_New_Id then V.Append (Child); Length := Natural'Max (Length, Get_Name (Child.Arg_Tag.all)'Length); end if; end if; end loop; end Get_Max_Arg_Length; procedure Read_Wayland_XML_File (File_Name, Out_Folder : String; Enable_Comments : Boolean) is procedure Identify_Protocol_Tag; procedure Identify_Protocol_Children; procedure Allocate_Space_For_Wayland_XML_Contents (File_Name : String; File_Contents : out Aida.Deepend.String_Ptr) is package IO renames Ada.Streams.Stream_IO; Size : constant Natural := Natural (Ada.Directories.Size (File_Name)); File : IO.File_Type; subtype File_String is String (1 .. Size); begin IO.Open (File, IO.In_File, File_Name); File_Contents := new File_String; File_String'Read (IO.Stream (File), File_Contents.all); IO.Close (File); end Allocate_Space_For_Wayland_XML_Contents; Root_Node : Aida.Deepend.XML_DOM_Parser.Node_Ptr; procedure Parse_Contents (File_Contents : Aida.Deepend.String_Ptr) is Call_Result : Aida.Call_Result; begin Aida.Deepend.XML_DOM_Parser.Parse (File_Contents.all, Call_Result, Root_Node); if Call_Result.Has_Failed then raise XML_Exception with Call_Result.Message; else Identify_Protocol_Tag; Identify_Protocol_Children; end if; end Parse_Contents; procedure Identify_Protocol_Tag is begin if Root_Node.Id /= Node_Kind_Tag or else Name (Root_Node.Tag) /= "protocol" then raise XML_Exception with "Root node is not <protocol>"; end if; if Attributes (Root_Node.Tag).Length /= 1 or else Name (Attributes (Root_Node.Tag) (1).all) /= "name" then raise XML_Exception with "<protocol> node has no name attribute"; end if; Protocol_Tag := new Wayland_XML.Protocol_Tag; Set_Name (Protocol_Tag.all, Value (Attributes (Root_Node.Tag) (1).all)); end Identify_Protocol_Tag; procedure Identify_Protocol_Children is function Identify_Copyright (Node : not null Aida.Deepend.XML_DOM_Parser.Node_Ptr) return not null Wayland_XML.Copyright_Ptr is Copyright_Tag : constant not null Wayland_XML.Copyright_Ptr := new Wayland_XML.Copyright_Tag; begin if Child_Nodes (Node.Tag).Length = 1 then if Child_Nodes (Node.Tag) (1).Id = Node_Kind_Text then Set_Text (Copyright_Tag.all, Trim (Child_Nodes (Node.Tag) (1).Text.all)); else raise XML_Exception; end if; else raise XML_Exception; end if; return Copyright_Tag; end Identify_Copyright; function Identify_Description (Node : not null Aida.Deepend.XML_DOM_Parser.Node_Ptr) return not null Wayland_XML.Description_Tag_Ptr is Description_Tag : constant not null Wayland_XML.Description_Tag_Ptr := new Wayland_XML.Description_Tag; Text : SU.Unbounded_String; begin if Attributes (Node.Tag).Length = 1 and then Name (Attributes (Node.Tag) (1).all) = "summary" then Set_Summary (Description_Tag.all, Value (Attributes (Node.Tag) (1).all)); else raise XML_Exception with "Expected tag 'description' to have 1 attribute 'summary'"; end if; for Child of Child_Nodes (Node.Tag) loop if Child.Id = Node_Kind_Text then SU.Append (Text, Trim (Child.Text.all)); elsif Child.Id /= Node_Kind_Comment then raise XML_Exception with "Tag 'description' has unexpected child " & Child.Id'Image; end if; end loop; Set_Text (Description_Tag.all, +Text); return Description_Tag; end Identify_Description; function Identify_Arg (Node : not null Aida.Deepend.XML_DOM_Parser.Node_Ptr) return not null Wayland_XML.Arg_Tag_Ptr is Arg_Tag : constant not null Wayland_XML.Arg_Tag_Ptr := new Wayland_XML.Arg_Tag; procedure Iterate (Tag : aliased Aida.Deepend.XML_DOM_Parser.XML_Tag) is begin for A of Attributes (Tag) loop if Name (A.all) = "name" then Set_Name (Arg_Tag.all, Value (A.all)); elsif Name (A.all) = "type" then Set_Type_Attribute (Arg_Tag.all, Value (A.all)); elsif Name (A.all) = "summary" then Set_Summary (Arg_Tag.all, Value (A.all)); elsif Name (A.all) = "interface" then Set_Interface_Attribute (Arg_Tag.all, Value (A.all)); elsif Name (A.all) = "allow-null" then if Value (A.all) = "true" then Set_Allow_Null (Arg_Tag.all, True); elsif Value (A.all) = "false" then Set_Allow_Null (Arg_Tag.all, False); else raise XML_Exception with "Attribute 'allow-null' must be 'true' or 'false'"; end if; elsif Name (A.all) = "enum" then Set_Enum (Arg_Tag.all, Value (A.all)); else raise XML_Exception; end if; end loop; end Iterate; begin Iterate (Node.Tag); -- Patch in missing enum values for old versions (1.16) of Wayland if Name (Protocol_Tag.all) = "wayland" then if not Exists_Enum (Arg_Tag.all) and then Exists_Type_Attribute (Arg_Tag.all) and then Type_Attribute (Arg_Tag.all) = Type_Unsigned_Integer and then Name (Arg_Tag.all) in "dnd_action" | "dnd_actions" | "preferred_action" | "source_actions" then Set_Enum (Arg_Tag.all, "wl_data_device_manager.dnd_action"); Put_Line ("Patched in missing enum for " & Name (Arg_Tag.all)); end if; end if; return Arg_Tag; end Identify_Arg; function Identify_Request (Node : not null Aida.Deepend.XML_DOM_Parser.Node_Ptr) return not null Wayland_XML.Request_Tag_Ptr is Request_Tag : constant not null Wayland_XML.Request_Tag_Ptr := new Wayland_XML.Request_Tag; procedure Iterate (Tag : aliased Aida.Deepend.XML_DOM_Parser.XML_Tag) is begin for A of Attributes (Tag) loop if Name (A.all) = "name" then Set_Name (Request_Tag.all, Value (A.all)); elsif Name (A.all) = "type" then Set_Type_Attribute (Request_Tag.all, Value (A.all)); elsif Name (A.all) = "since" then declare V : Integer; Has_Failed : Boolean; begin Aida.To_Integer (Value (A.all), V, Has_Failed); if Has_Failed then raise XML_Exception; else Set_Since (Request_Tag.all, Wayland_XML.Version_Number (V)); end if; end; else raise XML_Exception; end if; end loop; for Child of Child_Nodes (Tag) loop if Child.Id = Node_Kind_Tag then if Name (Child.Tag) = "description" then Append_Child (Request_Tag.all, Identify_Description (Child)); elsif Name (Child.Tag) = "arg" then Append_Child (Request_Tag.all, Identify_Arg (Child)); else raise XML_Exception; end if; else raise XML_Exception; end if; end loop; end Iterate; begin Iterate (Node.Tag); return Request_Tag; end Identify_Request; function Identify_Event (Node : not null Aida.Deepend.XML_DOM_Parser.Node_Ptr) return not null Wayland_XML.Event_Tag_Ptr is Event_Tag : constant not null Wayland_XML.Event_Tag_Ptr := new Wayland_XML.Event_Tag; procedure Iterate (Tag : aliased Aida.Deepend.XML_DOM_Parser.XML_Tag) is begin for A of Attributes (Tag) loop if Name (A.all) = "name" then Set_Name (Event_Tag.all, Value (A.all)); elsif Name (A.all) = "since" then declare V : Integer; Has_Failed : Boolean; begin Aida.To_Integer (Value (A.all), V, Has_Failed); if Has_Failed then raise XML_Exception; else Set_Since (Event_Tag.all, Wayland_XML.Version_Number (V)); end if; end; elsif Name (A.all) = "type" and Value (A.all) = "destructor" then -- FIXME Handle destructor events by destroying the proxy -- See https://gitlab.freedesktop.org/wayland/wayland/-/issues/96 null; else raise XML_Exception with "Tag 'event' has unexpected attribute " & Value (A.all); end if; end loop; for Child of Child_Nodes (Tag) loop if Child.Id = Node_Kind_Tag then if Name (Child.Tag) = "description" then Append_Child (Event_Tag.all, Identify_Description (Child)); elsif Name (Child.Tag) = "arg" then Append_Child (Event_Tag.all, Identify_Arg (Child)); else raise XML_Exception; end if; else raise XML_Exception; end if; end loop; end Iterate; begin Iterate (Node.Tag); return Event_Tag; end Identify_Event; function Identify_Entry (Node : not null Aida.Deepend.XML_DOM_Parser.Node_Ptr) return not null Wayland_XML.Entry_Tag_Ptr is Entry_Tag : constant not null Wayland_XML.Entry_Tag_Ptr := new Wayland_XML.Entry_Tag; procedure Iterate (Tag : aliased Aida.Deepend.XML_DOM_Parser.XML_Tag) is begin for A of Attributes (Tag) loop if Name (A.all) = "name" then Set_Name (Entry_Tag.all, Value (A.all)); elsif Name (A.all) = "value" then declare V : Integer; Has_Failed : Boolean; begin Aida.To_Integer (Value (A.all), V, Has_Failed); if Has_Failed then declare S : String renames Value (A.all); begin if S (S'First .. S'First + 1) = "0x" then V := Integer'Value ( "16#" & S (S'First + 2 .. S'Last) & "#" ); Set_Value (Entry_Tag.all, Wayland_XML.Entry_Value (V)); else raise XML_Exception; end if; end; else Set_Value (Entry_Tag.all, Wayland_XML.Entry_Value (V)); end if; end; elsif Name (A.all) = "summary" then Set_Summary (Entry_Tag.all, Value (A.all)); elsif Name (A.all) = "since" then declare The_Value : Integer; Has_Failed : Boolean; begin Aida.To_Integer (Value (A.all), The_Value, Has_Failed); if Has_Failed then raise XML_Exception; else Set_Since (Entry_Tag.all, Wayland_XML.Version_Number (The_Value)); end if; end; else raise XML_Exception; end if; end loop; -- Some files have <entry> nodes with a <description summary> -- child node instead of summary attribute if Child_Nodes (Tag).Length > 0 then for Child of Child_Nodes (Tag) loop case Child.Id is when Node_Kind_Text => -- TODO Check Trim (X.Text.all) is just whitespace null; when Node_Kind_Tag => if Name (Child.Tag) = "description" then for A of Attributes (Child.Tag) loop if Name (A.all) = "summary" then Set_Summary (Entry_Tag.all, Value (A.all)); else raise XML_Exception; end if; end loop; else raise XML_Exception; end if; when others => raise XML_Exception; end case; end loop; end if; end Iterate; begin Iterate (Node.Tag); return Entry_Tag; end Identify_Entry; function Identify_Enum (Node : not null Aida.Deepend.XML_DOM_Parser.Node_Ptr) return not null Wayland_XML.Enum_Tag_Ptr is Enum_Tag : constant not null Wayland_XML.Enum_Tag_Ptr := new Wayland_XML.Enum_Tag; procedure Iterate (Tag : aliased Aida.Deepend.XML_DOM_Parser.XML_Tag) is begin for A of Attributes (Tag) loop if Name (A.all) = "name" then Set_Name (Enum_Tag.all, Value (A.all)); elsif Name (A.all) = "bitfield" then if Value (A.all) = "true" then Set_Bitfield (Enum_Tag.all, True); elsif Value (A.all) = "false" then Set_Bitfield (Enum_Tag.all, False); else raise XML_Exception; end if; elsif Name (A.all) = "since" then declare The_Value : Integer; Has_Failed : Boolean; begin Aida.To_Integer (Value (A.all), The_Value, Has_Failed); if Has_Failed then raise XML_Exception; else Set_Since (Enum_Tag.all, Wayland_XML.Version_Number (The_Value)); end if; end; else raise XML_Exception; end if; end loop; for Child of Child_Nodes (Tag) loop if Child.Id = Node_Kind_Tag then if Name (Child.Tag) = "description" then Append_Child (Enum_Tag.all, Identify_Description (Child)); elsif Name (Child.Tag) = "entry" then Append_Child (Enum_Tag.all, Identify_Entry (Child)); else raise XML_Exception; end if; elsif Child.Id = Node_Kind_Comment then -- Ignore any comments inside <enum> null; else raise XML_Exception with "Tag 'enum' has unexpected child " & Child.Id'Image; end if; end loop; Sort_Entries (Enum_Tag.all); end Iterate; begin Iterate (Node.Tag); return Enum_Tag; end Identify_Enum; function Identify_Interface (Node : not null Aida.Deepend.XML_DOM_Parser.Node_Ptr) return not null Wayland_XML.Interface_Tag_Ptr is Interface_Tag : constant not null Wayland_XML.Interface_Tag_Ptr := new Wayland_XML.Interface_Tag; procedure Iterate (Tag : aliased Aida.Deepend.XML_DOM_Parser.XML_Tag) is begin if Attributes (Tag).Length = 2 then if Name (Attributes (Tag) (1).all) = "name" then Set_Name (Interface_Tag.all, Value (Attributes (Tag) (1).all)); else raise XML_Exception; end if; if Name (Attributes (Tag) (2).all) = "version" then declare The_Value : Integer; Has_Failed : Boolean; begin Aida.To_Integer (Value (Attributes (Tag) (2).all), The_Value, Has_Failed); if Has_Failed then raise XML_Exception; else Set_Version (Interface_Tag.all, Wayland_XML.Version_Number (The_Value)); for Child of Child_Nodes (Tag) loop if Child.Id = Node_Kind_Tag then if Name (Child.Tag) = "description" then Append_Child (Interface_Tag.all, Identify_Description (Child)); elsif Name (Child.Tag) = "request" then Append_Child (Interface_Tag.all, Identify_Request (Child)); elsif Name (Child.Tag) = "event" then Append_Child (Interface_Tag.all, Identify_Event (Child)); elsif Name (Child.Tag) = "enum" then Append_Child (Interface_Tag.all, Identify_Enum (Child)); else raise XML_Exception; end if; elsif Child.Id = Node_Kind_Comment then null; else raise XML_Exception; end if; end loop; end if; end; else raise XML_Exception; end if; else raise XML_Exception; end if; end Iterate; begin Iterate (Node.Tag); return Interface_Tag; end Identify_Interface; procedure Iterate (Tag : aliased Aida.Deepend.XML_DOM_Parser.XML_Tag) is begin for Child of Child_Nodes (Tag) loop if Child.Id = Node_Kind_Tag then if Name (Child.Tag) = "interface" then Append_Child (Protocol_Tag.all, Identify_Interface (Child)); elsif Name (Child.Tag) = "copyright" then Append_Child (Protocol_Tag.all, Identify_Copyright (Child)); elsif Name (Child.Tag) = "description" then Append_Child (Protocol_Tag.all, Identify_Description (Child)); else raise XML_Exception with "Unexpected tag " & Name (Child.Tag); end if; elsif Child.Id /= Node_Kind_Comment then raise XML_Exception with "Unexpected kind " & Child.Id'Image; end if; end loop; end Iterate; begin Iterate (Root_Node.Tag); Create_Wayland_Spec_File (Enable_Comments); Create_Wayland_Body_File; end Identify_Protocol_Children; File_Contents : Aida.Deepend.String_Ptr; use type Ada.Directories.File_Kind; begin if not Ada.Directories.Exists (File_Name) then raise Constraint_Error with File_Name & " does not exist"; end if; Allocate_Space_For_Wayland_XML_Contents (File_Name, File_Contents); if not Ada.Directories.Exists (Out_Folder) then Ada.Directories.Create_Directory (Out_Folder); elsif Ada.Directories.Kind (Out_Folder) /= Ada.Directories.Directory then raise Constraint_Error with Out_Folder & " is not a directory"; end if; declare Current_Folder : constant String := Ada.Directories.Current_Directory; begin Ada.Directories.Set_Directory (Out_Folder); begin Parse_Contents (File_Contents); exception when others => Ada.Directories.Set_Directory (Current_Folder); raise; end; Ada.Directories.Set_Directory (Current_Folder); end; end Read_Wayland_XML_File; procedure Generate_Code_For_Numeric_Constants (File : Ada.Text_IO.File_Type) is procedure Handle_Interface (Interface_Tag : aliased Wayland_XML.Interface_Tag) is procedure Generate_Code_For_Opcodes is I : Integer := 0; procedure Generate_Code (Request_Tag : aliased Wayland_XML.Request_Tag) is Name : constant String := Xml_Parser_Utils.Adaify_Name (Wayland_XML.Name (Interface_Tag) & "_" & Wayland_XML.Name (Request_Tag)); begin if I = 0 then New_Line (File); end if; Put_Line (File, " " & Name & " : constant := " & Aida.To_String (I) & ";"); I := I + 1; end Generate_Code; begin Iterate_Over_Requests (Interface_Tag, Generate_Code'Access); end Generate_Code_For_Opcodes; begin Generate_Code_For_Opcodes; -- Note: See git history for *_Since_Version constants end Handle_Interface; begin Iterate_Over_Interfaces (Handle_Interface'Access); end Generate_Code_For_Numeric_Constants; All_Types : Unbounded_String_Vectors.Vector; procedure Create_Wayland_Spec_File (Enable_Comments : Boolean) is File : Ada.Text_IO.File_Type; procedure Create_Wl_Thin_Spec_File (Protocol_Name : String); procedure Generate_Code_For_Type_Declarations; procedure Generate_Code_For_External_Proxies (Protocol_Name : String); procedure Generate_Code_For_The_Interface_Constants; procedure Generate_Code_For_Enum_Constants; procedure Generate_Private_Code_For_Enum_Constants; procedure Generate_Manually_Edited_Partial_Type_Declarations (Protocol_Name : String); procedure Generate_Use_Type_Declarions (Package_Name : String); procedure Generate_Manually_Edited_Code_For_Type_Definitions; procedure Generate_Private_Code_For_The_Interface_Constants; procedure Create_File is Protocol_Name : constant String := Get_Protocol_Name (Name (Protocol_Tag.all)); Package_Name : constant String := Xml_Parser_Utils.Adaify_Name (Protocol_Name); begin Ada.Text_IO.Create (File, Ada.Text_IO.Out_File, "wayland-protocols-" & Protocol_Name & ".ads"); Put_Line (File, "private with Wayland.Protocols.Thin_" & Package_Name & ";"); New_Line (File); Put_Line (File, "with Wayland.Enums." & Package_Name & ";"); if Protocol_Name = "client" then null; elsif Protocol_Name = "xdg_decoration_unstable_v1" then New_Line (File); Put_Line (File, "with Wayland.Protocols.Client;"); Put_Line (File, "with Wayland.Protocols.Xdg_Shell;"); else New_Line (File); Put_Line (File, "with Wayland.Protocols.Client;"); end if; New_Line (File); Put_Line (File, "package Wayland.Protocols." & Package_Name & " is"); Put_Line (File, " pragma Preelaborate;"); New_Line (File); Put_Line (File, " use Wayland.Enums." & Package_Name & ";"); if Protocol_Name = "xdg_shell" then New_Line (File); Put_Line (File, " type State_Array is array (Positive range <>) of Xdg_Toplevel_State;"); end if; Generate_Code_For_Type_Declarations; Generate_Code_For_External_Proxies (Protocol_Name); Generate_Code_For_The_Interface_Constants; if Generate_Interfaces_For_Client or Protocol_Name /= "client" then New_Line (File); Put_Line (File, " procedure Initialize;"); end if; if Protocol_Name = "client" then Put_Line (File, ""); Put_Line (File, " function Bind"); Put_Line (File, " (Object : Registry;"); Put_Line (File, " Iface : Interface_Type;"); Put_Line (File, " Id : Unsigned_32;"); Put_Line (File, " Version : Unsigned_32) return Secret_Proxy;"); end if; Generate_Manually_Edited_Partial_Type_Declarations (Protocol_Name); New_Line (File); Put_Line (File, "private"); New_Line (File); Generate_Use_Type_Declarions (Package_Name); Generate_Manually_Edited_Code_For_Type_Definitions; if Protocol_Name = "client" then Put_Line (File, ""); Put_Line (File, " function Get_Proxy (Object : Surface) return Secret_Proxy is (Secret_Proxy (Object.Proxy));"); Put_Line (File, " function Get_Proxy (Object : Seat) return Secret_Proxy is (Secret_Proxy (Object.Proxy));"); Put_Line (File, " function Get_Proxy (Object : Shm) return Secret_Proxy is (Secret_Proxy (Object.Proxy));"); Put_Line (File, " function Get_Proxy (Object : Output) return Secret_Proxy is (Secret_Proxy (Object.Proxy));"); Put_Line (File, " function Get_Proxy (Object : Pointer) return Secret_Proxy is (Secret_Proxy (Object.Proxy));"); Put_Line (File, " function Get_Proxy (Object : Region) return Secret_Proxy is (Secret_Proxy (Object.Proxy));"); elsif Protocol_Name = "xdg_shell" then Put_Line (File, ""); Put_Line (File, " function Get_Proxy (Object : Xdg_Toplevel) return Secret_Proxy is (Secret_Proxy (Object.Proxy));"); end if; Generate_Private_Code_For_The_Interface_Constants; Put_Line (File, ""); Put_Line (File, "end Wayland.Protocols." & Package_Name & ";"); Ada.Text_IO.Close (File); ----------------------------------------------------------------------- -- TODO Do not generate file if there are no enum constants Ada.Text_IO.Create (File, Ada.Text_IO.Out_File, "wayland-enums-" & Protocol_Name & ".ads"); Put_Line (File, "package Wayland.Enums." & Package_Name & " is"); Put_Line (File, " pragma Preelaborate;"); Generate_Code_For_Enum_Constants; New_Line (File); Put_Line (File, "private"); New_Line (File); Generate_Private_Code_For_Enum_Constants; Put_Line (File, "end Wayland.Enums." & Package_Name & ";"); Ada.Text_IO.Close (File); Ada.Text_IO.Create (File, Ada.Text_IO.Out_File, "wayland-protocols-thin_" & Protocol_Name & ".ads"); Put_Line (File, "with Interfaces.C.Strings;"); Put_Line (File, ""); Put_Line (File, "with Wayland.API;"); Put_Line (File, "with Wayland.Enums." & Package_Name & ";"); if Protocol_Name = "client" then null; elsif Protocol_Name = "xdg_decoration_unstable_v1" then Put_Line (File, "with Wayland.Protocols.Thin_Xdg_Shell;"); else Put_Line (File, "with Wayland.Protocols.Thin_Client;"); end if; Put_Line (File, ""); Put_Line (File, "private package Wayland.Protocols.Thin_" & Package_Name & " is"); Put_Line (File, " pragma Preelaborate;"); Put_Line (File, ""); Put_Line (File, " use Wayland.Enums." & Package_Name & ";"); Put_Line (File, ""); Put_Line (File, " subtype chars_ptr is Interfaces.C.Strings.chars_ptr;"); Put_Line (File, ""); Put_Line (File, " subtype Interface_T is Wayland.API.Interface_T;"); Put_Line (File, ""); Put_Line (File, " subtype Proxy_Ptr is Wayland.API.Proxy_Ptr;"); Put_Line (File, " subtype Interface_Ptr is Wayland.API.Interface_Ptr;"); Put_Line (File, ""); Create_Wl_Thin_Spec_File (Protocol_Name); Put_Line (File, "end Wayland.Protocols.Thin_" & Package_Name & ";"); Ada.Text_IO.Close (File); end Create_File; procedure Generate_Code_For_Type_Declarations is procedure Handle_Interface (Interface_Tag : aliased Wayland_XML.Interface_Tag) is Name : constant String := Xml_Parser_Utils.Adaify_Name (Wayland_XML.Name (Interface_Tag)); begin Put_Line (File, " type " & Name & " is tagged limited private;"); end Handle_Interface; begin New_Line (File); Iterate_Over_Interfaces (Handle_Interface'Access); end Generate_Code_For_Type_Declarations; procedure Generate_Code_For_External_Proxies (Protocol_Name : String) is begin if Protocol_Name = "client" then Put_Line (File, ""); Put_Line (File, " function Get_Proxy (Object : Surface) return Secret_Proxy;"); Put_Line (File, " function Get_Proxy (Object : Seat) return Secret_Proxy;"); Put_Line (File, " function Get_Proxy (Object : Shm) return Secret_Proxy;"); Put_Line (File, " function Get_Proxy (Object : Output) return Secret_Proxy;"); Put_Line (File, " function Get_Proxy (Object : Pointer) return Secret_Proxy;"); Put_Line (File, " function Get_Proxy (Object : Region) return Secret_Proxy;"); Put_Line (File, ""); Put_Line (File, " package Constructors is"); Put_Line (File, " function Set_Proxy (Proxy : Secret_Proxy) return Buffer;"); Put_Line (File, " function Set_Proxy (Proxy : Secret_Proxy) return Output;"); Put_Line (File, " function Set_Proxy (Proxy : Secret_Proxy) return Surface;"); Put_Line (File, " end Constructors;"); elsif Protocol_Name = "xdg_shell" then Put_Line (File, ""); Put_Line (File, " function Get_Proxy (Object : Xdg_Toplevel) return Secret_Proxy;"); end if; end Generate_Code_For_External_Proxies; procedure Generate_Code_For_The_Interface_Constants is procedure Handle_Interface (Interface_Tag : aliased Wayland_XML.Interface_Tag) is Name : constant String := Xml_Parser_Utils.Adaify_Name (Wayland_XML.Name (Interface_Tag) & "_Interface"); begin Put_Line (File, " " & Name & " : constant Interface_Type;"); end Handle_Interface; begin New_Line (File); Iterate_Over_Interfaces (Handle_Interface'Access); end Generate_Code_For_The_Interface_Constants; function Get_Name (Entry_Tag : Wayland_XML.Entry_Tag) return String is -- Just because some entries in wl_output.transform start with a digit :/ Entry_Name : constant String := Name (Entry_Tag); begin return (if Entry_Name in "90" | "180" | "270" then "Rotate_" & Entry_Name else Xml_Parser_Utils.Adaify_Name (Entry_Name)); end Get_Name; function Get_Max_Child_Length (Enum_Tag : aliased Wayland_XML.Enum_Tag) return Natural is Result : Natural := 0; begin for Child of Wayland_XML.Entries (Enum_Tag) loop Result := Natural'Max (Result, Get_Name (Child.Entry_Tag.all)'Length); end loop; return Result; end Get_Max_Child_Length; procedure Generate_Code_For_Enum_Constants is procedure Handle_Interface (Interface_Tag : aliased Wayland_XML.Interface_Tag) is procedure Generate_Code (Enum_Tag : aliased Wayland_XML.Enum_Tag) is Enum_Type_Name : constant String := Xml_Parser_Utils.Adaify_Name (Name (Interface_Tag) & "_" & Name (Enum_Tag)); Is_Bitfield : constant Boolean := Exists_Bitfield (Enum_Tag) and then Bitfield (Enum_Tag); Max_Length : constant Natural := Natural'Max (Get_Max_Child_Length (Enum_Tag), Unused_Padding_Name'Length); procedure Generate_Summary_For_Entry (Entry_Tag : Wayland_XML.Entry_Tag) is Summary_String : constant String := (if Enable_Comments and Exists_Summary (Entry_Tag) then Summary (Entry_Tag) else ""); begin if Summary_String'Length > 0 then Put_Line (File, " -- " & Summary_String); end if; end Generate_Summary_For_Entry; Count_components : Natural := 0; procedure Generate_Code_For_Entry_Component (Entry_Tag : Wayland_XML.Entry_Tag) is Aligned_Name : constant String := SF.Head (Get_Name (Entry_Tag), Max_Length, ' '); Value : constant Natural := Natural'Value (Value_As_String (Entry_Tag)); begin -- Ignore entry with value 0 because then all components of -- the record are False if Value = 0 then return; end if; Count_components := Count_components + 1; Put_Line (File, " " & Aligned_Name & " : Boolean := False;"); Generate_Summary_For_Entry (Entry_Tag); end Generate_Code_For_Entry_Component; procedure Generate_Code_For_Entry (Entry_Tag : Wayland_XML.Entry_Tag; Is_First : Boolean; Is_Last : Boolean) is Aligned_Name : constant String := Get_Name (Entry_Tag); Prefix : constant String := (if Is_First then "" else " "); Suffix : constant String := (if Is_Last then ");" else ","); begin Put_Line (File, Prefix & Aligned_Name & Suffix); Generate_Summary_For_Entry (Entry_Tag); end Generate_Code_For_Entry; begin New_Line (File); if Is_Bitfield then Put_Line (File, " type " & Enum_Type_Name & " is record"); for Child of Wayland_XML.Entries (Enum_Tag) loop Generate_Code_For_Entry_Component (Child.Entry_Tag.all); end loop; if Count_components < 32 then declare Aligned_Name : constant String := SF.Head (Unused_Padding_Name, Max_Length, ' '); begin Put_Line (File, " " & Aligned_Name & " : Unused_Type;"); end; end if; Put_Line (File, " end record"); Put_Line (File, " with Convention => C_Pass_By_Copy;"); else Put_Line (File, " type " & Enum_Type_Name & " is"); Put (File, " ("); for Child of Wayland_XML.Entries (Enum_Tag) loop Generate_Code_For_Entry (Child.Entry_Tag.all, Wayland_XML.Entries (Enum_Tag).First_Element = Child, Wayland_XML.Entries (Enum_Tag).Last_Element = Child); end loop; end if; end Generate_Code; begin for Child of Children (Interface_Tag) loop if Child.Kind_Id = Child_Enum then Generate_Code (Child.Enum_Tag.all); end if; end loop; end Handle_Interface; begin Iterate_Over_Interfaces (Handle_Interface'Access); end Generate_Code_For_Enum_Constants; procedure Generate_Private_Code_For_Enum_Constants is procedure Handle_Interface (Interface_Tag : aliased Wayland_XML.Interface_Tag) is procedure Generate_Code (Enum_Tag : aliased Wayland_XML.Enum_Tag) is Enum_Type_Name : constant String := Xml_Parser_Utils.Adaify_Name (Name (Interface_Tag) & "_" & Name (Enum_Tag)); Is_Bitfield : constant Boolean := Exists_Bitfield (Enum_Tag) and then Bitfield (Enum_Tag); Max_Length : constant Natural := Natural'Max (Get_Max_Child_Length (Enum_Tag), Unused_Padding_Name'Length); Count_Components : Natural := 0; procedure Generate_Code_For_Entry_Component (Entry_Tag : Wayland_XML.Entry_Tag) is Aligned_Name : constant String := SF.Head (Get_Name (Entry_Tag), Max_Length, ' '); type U32 is mod 2 ** 32 with Size => 32; Value : constant U32 := U32'Value (Value_As_String (Entry_Tag)); begin -- Ignore entry with value 0 because then all components of -- the record are False if Value = 0 then return; end if; if (Value and (Value - 1)) /= 0 then raise Constraint_Error with Value'Image & " is not a power of two"; end if; Count_Components := Count_Components + 1; declare Bit : Natural := 0; begin while Value > 2 ** Bit loop Bit := Bit + 1; end loop; Put_Line (File, " " & Aligned_Name & " at 0 range " & Trim (Bit'Image) & " .. " & Trim (Bit'Image) & ";"); end; end Generate_Code_For_Entry_Component; procedure Generate_Code_For_Entry (Entry_Tag : Wayland_XML.Entry_Tag; Is_First : Boolean; Is_Last : Boolean) is Aligned_Name : constant String := SF.Head (Get_Name (Entry_Tag), Max_Length, ' '); Prefix : constant String := (if Is_First then "" else " "); Suffix : constant String := (if Is_Last then ");" else ","); begin Put_Line (File, Prefix & Aligned_Name & " => " & Value_As_String (Entry_Tag) & Suffix); end Generate_Code_For_Entry; begin if Is_Bitfield then Put_Line (File, " for " & Enum_Type_Name & " use record"); for Child of Wayland_XML.Entries (Enum_Tag) loop Generate_Code_For_Entry_Component (Child.Entry_Tag.all); end loop; if Count_Components < 32 then declare Aligned_Name : constant String := SF.Head (Unused_Padding_Name, Max_Length, ' '); begin Put_Line (File, " " & Aligned_Name & " at 0 range " & Trim (Count_Components'Image) & " .. 31;"); end; end if; Put_Line (File, " end record;"); Put_Line (File, " for " & Enum_Type_Name & "'Size use Unsigned_32'Size;"); else Put_Line (File, " for " & Enum_Type_Name & " use"); Put (File, " ("); for Child of Wayland_XML.Entries (Enum_Tag) loop Generate_Code_For_Entry (Child.Entry_Tag.all, Wayland_XML.Entries (Enum_Tag).First_Element = Child, Wayland_XML.Entries (Enum_Tag).Last_Element = Child); end loop; Put_Line (File, " for " & Enum_Type_Name & "'Size use Unsigned_32'Size;"); end if; New_Line (File); end Generate_Code; begin for Child of Children (Interface_Tag) loop if Child.Kind_Id = Child_Enum then Generate_Code (Child.Enum_Tag.all); end if; end loop; end Handle_Interface; begin Iterate_Over_Interfaces (Handle_Interface'Access); end Generate_Private_Code_For_Enum_Constants; procedure Generate_Manually_Edited_Partial_Type_Declarations (Protocol_Name : String) is procedure Generate_Spec_Utility_Functions (Name : String) is begin Put_Line (File, ""); Put_Line (File, " function Get_ID (Object : " & Name & ") return Unsigned_32"); Put_Line (File, " with Pre => Object.Has_Proxy;"); Put_Line (File, ""); Put_Line (File, " function Get_Version (Object : " & Name & ") return Unsigned_32"); Put_Line (File, " with Pre => Object.Has_Proxy;"); Put_Line (File, ""); Put_Line (File, " function Has_Proxy (Object : " & Name & ") return Boolean;"); Put_Line (File, ""); Put_Line (File, " function ""="" (Left, Right : " & Name & "'Class) return Boolean;"); if Protocol_Name = "client" and Name in "Data_Offer" then Put_Line (File, ""); Put_Line (File, " procedure Move (From, To : in out " & Name & ")"); Put_Line (File, " with Pre => From.Has_Proxy and not To.Has_Proxy,"); Put_Line (File, " Post => not From.Has_Proxy and To.Has_Proxy;"); end if; end Generate_Spec_Utility_Functions; procedure Generate_Spec_Destroy_Subprogram (Interface_Tag : aliased Wayland_XML.Interface_Tag) is Name : constant String := Xml_Parser_Utils.Adaify_Name (Wayland_XML.Name (Interface_Tag)); Destructor_Name : constant String := Xml_Parser_Utils.Get_Destructor (Interface_Tag); Request_Name : constant String := Xml_Parser_Utils.Adaify_Name (if Destructor_Name /= "" then Destructor_Name else "Destroy"); begin Put_Line (File, ""); Put_Line (File, " procedure " & Request_Name & " (Object : in out " & Name & ")"); Put_Line (File, " with Pre => Object.Has_Proxy,"); Put_Line (File, " Post => not Object.Has_Proxy;"); end Generate_Spec_Destroy_Subprogram; procedure Generate_Spec_User_Data_Subprogram (Name : String) is begin Put_Line (File, ""); Put_Line (File, " generic"); Put_Line (File, " type Data_Type (<>) is limited private;"); Put_Line (File, " package " & Name & "_User_Data is"); Put_Line (File, ""); Put_Line (File, " procedure Set_Data"); Put_Line (File, " (Object : " & Name & "'Class;"); Put_Line (File, " Subject : aliased in out Data_Type)"); Put_Line (File, " with Pre => Object.Has_Proxy;"); Put_Line (File, ""); Put_Line (File, " function Get_Data"); Put_Line (File, " (Object : " & Name & "'Class) return access Data_Type"); Put_Line (File, " with Pre => Object.Has_Proxy;"); Put_Line (File, ""); Put_Line (File, " end " & Name & "_User_Data;"); end Generate_Spec_User_Data_Subprogram; procedure Generate_Spec_Bind_Subprogram (Name : String) is begin Put_Line (File, ""); Put_Line (File, " procedure Bind"); Put_Line (File, " (Object : in out " & Name & ";"); Put_Line (File, " Registry : Client.Registry'Class;"); Put_Line (File, " Id : Unsigned_32;"); Put_Line (File, " Version : Unsigned_32)"); Put_Line (File, " with Pre => not Object.Has_Proxy and Registry.Has_Proxy;"); end Generate_Spec_Bind_Subprogram; procedure Generate_Prefix_Spec_Events is begin Put_Line (File, ""); Put_Line (File, " generic"); end Generate_Prefix_Spec_Events; procedure Generate_Suffix_Spec_Events (Name : String) is begin Put_Line (File, " package " & Name & "_Events is"); Put_Line (File, ""); Put_Line (File, " procedure Subscribe"); Put_Line (File, " (Object : aliased in out " & Name & "'Class)"); Put_Line (File, " with Pre => Object.Has_Proxy;"); Put_Line (File, ""); Put_Line (File, " end " & Name & "_Events;"); end Generate_Suffix_Spec_Events; procedure Handle_Interface_Subprograms_Client (Interface_Tag : aliased Wayland_XML.Interface_Tag) is Name : constant String := Xml_Parser_Utils.Adaify_Name (Wayland_XML.Name (Interface_Tag)); begin if Name in "Compositor" | "Seat" | "Shm" | "Output" | "Data_Device_Manager" then Generate_Spec_Bind_Subprogram (Name); end if; if Name = "Display" then Put_Line (File, ""); Put_Line (File, " function Is_Connected (Object : Display) return Boolean renames Has_Proxy;"); Put_Line (File, ""); Put_Line (File, " procedure Connect (Object : in out Display)"); Put_Line (File, " with Pre => not Object.Is_Connected;"); Put_Line (File, " -- Attempts connecting with the Wayland server"); Put_Line (File, ""); Put_Line (File, " type Events_Status is (Has_Events, No_Events, Error);"); Put_Line (File, ""); Put_Line (File, " type Events_Status_Array is array (Positive range <>) of Events_Status;"); Put_Line (File, ""); Put_Line (File, " type File_Descriptor_Array is array (Positive range <>) of File_Descriptor;"); Put_Line (File, ""); Put_Line (File, " function Check_For_Events"); Put_Line (File, " (Object : Display;"); Put_Line (File, " Timeout : Duration;"); Put_Line (File, " Descriptors : File_Descriptor_Array := (1 .. 0 => 0)) return Events_Status_Array"); Put_Line (File, " with Post => Check_For_Events'Result'Length = Descriptors'Length + 1;"); Put_Line (File, ""); Put_Line (File, " function Flush (Object : Display) return Optional_Result"); Put_Line (File, " with Pre => Object.Is_Connected;"); Put_Line (File, " -- Send all buffered requests to the Wayland compositor"); Put_Line (File, " --"); Put_Line (File, " -- Returns the number of bytes sent if successful."); Put_Line (File, ""); Put_Line (File, " procedure Flush (Object : Display)"); Put_Line (File, " with Pre => Object.Is_Connected;"); Put_Line (File, " -- Send all buffered requests to the Wayland compositor"); Put_Line (File, " --"); Put_Line (File, " -- Raises Program_Error if flushing failed."); Put_Line (File, ""); Put_Line (File, " function Dispatch (Object : Display) return Optional_Result"); Put_Line (File, " with Pre => Object.Is_Connected;"); Put_Line (File, " -- Process incoming events"); Put_Line (File, ""); Put_Line (File, " procedure Dispatch (Object : Display)"); Put_Line (File, " with Pre => Object.Is_Connected;"); Put_Line (File, " -- Process incoming events"); Put_Line (File, " --"); Put_Line (File, " -- Raises Program_Error if dispatching failed."); Put_Line (File, ""); Put_Line (File, " function Dispatch_Pending (Object : Display) return Optional_Result"); Put_Line (File, " with Pre => Object.Is_Connected;"); Put_Line (File, " -- Dispatch events on the default queue without reading from"); Put_Line (File, " -- the display's file descriptor"); Put_Line (File, " --"); Put_Line (File, " -- It does not attempt to read the display's file descriptor and simply"); Put_Line (File, " -- returns zero if the main queue is empty, i.e., it does not block."); Put_Line (File, " --"); Put_Line (File, " -- Returns the number of dispatched events if successful."); Put_Line (File, ""); Put_Line (File, " function Prepare_Read (Object : Display) return Call_Result_Code"); Put_Line (File, " with Pre => Object.Is_Connected;"); Put_Line (File, " -- Prepare to read events from the display's file descriptor"); Put_Line (File, ""); Put_Line (File, " function Read_Events (Object : Display) return Call_Result_Code"); Put_Line (File, " with Pre => Object.Is_Connected;"); Put_Line (File, ""); Put_Line (File, " procedure Cancel_Read (Object : Display)"); Put_Line (File, " with Pre => Object.Is_Connected;"); Put_Line (File, " -- Cancel read intention on display's file descriptor"); Put_Line (File, ""); Put_Line (File, " function Roundtrip (Object : Display) return Integer"); Put_Line (File, " with Pre => Object.Is_Connected;"); Put_Line (File, ""); Put_Line (File, " procedure Roundtrip (Object : Display)"); Put_Line (File, " with Pre => Object.Is_Connected;"); Put_Line (File, ""); Put_Line (File, " procedure Disconnect (Object : in out Display)"); Put_Line (File, " with Pre => Object.Is_Connected,"); Put_Line (File, " Post => not Object.Is_Connected;"); Put_Line (File, ""); Put_Line (File, " procedure Get_Registry"); Put_Line (File, " (Object : Display;"); Put_Line (File, " Registry : in out Client.Registry'Class)"); Put_Line (File, " with Pre => Object.Is_Connected and not Registry.Has_Proxy;"); Put_Line (File, ""); Put_Line (File, " function Sync (Object : Display) return Callback'Class"); Put_Line (File, " with Pre => Object.Is_Connected;"); elsif Name = "Compositor" then Put_Line (File, ""); Put_Line (File, " procedure Create_Surface (Object : Compositor;"); Put_Line (File, " Surface : in out Client.Surface'Class)"); Put_Line (File, " with Pre => Object.Has_Proxy;"); Put_Line (File, ""); Put_Line (File, " procedure Create_Region (Object : Compositor;"); Put_Line (File, " Region : in out Client.Region'Class)"); Put_Line (File, " with Pre => Object.Has_Proxy;"); elsif Name = "Seat" then Put_Line (File, ""); Put_Line (File, " procedure Get_Pointer (Object : Seat;"); Put_Line (File, " Pointer : in out Client.Pointer'Class)"); Put_Line (File, " with Pre => Object.Has_Proxy and not Pointer.Has_Proxy;"); Put_Line (File, ""); Put_Line (File, " procedure Get_Keyboard (Object : Seat;"); Put_Line (File, " Keyboard : in out Client.Keyboard'Class)"); Put_Line (File, " with Pre => Object.Has_Proxy and not Keyboard.Has_Proxy;"); Put_Line (File, ""); Put_Line (File, " procedure Get_Touch (Object : Seat;"); Put_Line (File, " Touch : in out Client.Touch'Class)"); Put_Line (File, " with Pre => Object.Has_Proxy and not Touch.Has_Proxy;"); elsif Name = "Shm_Pool" then Put_Line (File, ""); Put_Line (File, " procedure Create_Buffer (Object : Shm_Pool;"); Put_Line (File, " Offset : Natural;"); Put_Line (File, " Width : Natural;"); Put_Line (File, " Height : Natural;"); Put_Line (File, " Stride : Natural;"); Put_Line (File, " Format : Shm_Format;"); Put_Line (File, " Buffer : in out Client.Buffer'Class)"); Put_Line (File, " with Pre => Object.Has_Proxy;"); Put_Line (File, ""); Put_Line (File, " procedure Resize (Object : Shm_Pool;"); Put_Line (File, " Size : Positive)"); Put_Line (File, " with Pre => Object.Has_Proxy;"); elsif Name = "Shm" then Put_Line (File, ""); Put_Line (File, " procedure Create_Pool (Object : Shm;"); Put_Line (File, " File_Descriptor : Wayland.File_Descriptor;"); Put_Line (File, " Size : Positive;"); Put_Line (File, " Pool : in out Shm_Pool'Class);"); elsif Name = "Data_Offer" then Put_Line (File, ""); Put_Line (File, " procedure Do_Accept (Object : Data_Offer;"); Put_Line (File, " Serial : Unsigned_32;"); Put_Line (File, " Mime_Type : String)"); Put_Line (File, " with Pre => Object.Has_Proxy;"); Put_Line (File, ""); Put_Line (File, " procedure Do_Not_Accept (Object : Data_Offer;"); Put_Line (File, " Serial : Unsigned_32)"); Put_Line (File, " with Pre => Object.Has_Proxy;"); Put_Line (File, ""); Put_Line (File, " procedure Receive (Object : Data_Offer;"); Put_Line (File, " Mime_Type : String;"); Put_Line (File, " File_Descriptor : Wayland.File_Descriptor)"); Put_Line (File, " with Pre => Object.Has_Proxy;"); Put_Line (File, ""); Put_Line (File, " procedure Finish (Object : Data_Offer)"); Put_Line (File, " with Pre => Object.Has_Proxy;"); Put_Line (File, ""); Put_Line (File, " procedure Set_Actions (Object : Data_Offer;"); Put_Line (File, " Dnd_Actions : Data_Device_Manager_Dnd_Action;"); Put_Line (File, " Preferred_Action : Data_Device_Manager_Dnd_Action)"); Put_Line (File, " with Pre => Object.Has_Proxy;"); elsif Name = "Data_Source" then Put_Line (File, ""); Put_Line (File, " procedure Offer (Object : Data_Source;"); Put_Line (File, " Mime_Type : String)"); Put_Line (File, " with Pre => Object.Has_Proxy;"); Put_Line (File, ""); Put_Line (File, " procedure Set_Actions (Object : Data_Source;"); Put_Line (File, " Dnd_Actions : Data_Device_Manager_Dnd_Action)"); Put_Line (File, " with Pre => Object.Has_Proxy;"); elsif Name = "Data_Device" then Put_Line (File, ""); Put_Line (File, " procedure Start_Drag (Object : Data_Device;"); Put_Line (File, " Source : Data_Source'Class;"); Put_Line (File, " Origin : Surface'Class;"); Put_Line (File, " Icon : Surface'Class;"); Put_Line (File, " Serial : Unsigned_32)"); Put_Line (File, " with Pre => Object.Has_Proxy and Source.Has_Proxy and Origin.Has_Proxy and Icon.Has_Proxy;"); Put_Line (File, ""); Put_Line (File, " procedure Set_Selection (Object : Data_Device;"); Put_Line (File, " Source : Data_Source'Class;"); Put_Line (File, " Serial : Unsigned_32)"); Put_Line (File, " with Pre => Object.Has_Proxy and Source.Has_Proxy;"); elsif Name = "Data_Device_Manager" then Put_Line (File, ""); Put_Line (File, " procedure Create_Data_Source (Object : Data_Device_Manager;"); Put_Line (File, " Source : in out Data_Source'Class)"); Put_Line (File, " with Pre => Object.Has_Proxy;"); Put_Line (File, ""); Put_Line (File, " procedure Get_Data_Device (Object : Data_Device_Manager;"); Put_Line (File, " Seat : Client.Seat'Class;"); Put_Line (File, " Device : in out Data_Device'Class)"); Put_Line (File, " with Pre => Object.Has_Proxy and Seat.Has_Proxy;"); elsif Name = "Surface" then Put_Line (File, ""); Put_Line (File, " procedure Attach (Object : Surface;"); Put_Line (File, " Buffer : Client.Buffer'Class;"); Put_Line (File, " X, Y : Integer)"); Put_Line (File, " with Pre => Object.Has_Proxy;"); Put_Line (File, ""); Put_Line (File, " procedure Damage (Object : Surface;"); Put_Line (File, " X, Y : Integer;"); Put_Line (File, " Width : Natural;"); Put_Line (File, " Height : Natural)"); Put_Line (File, " with Pre => Object.Has_Proxy;"); Put_Line (File, ""); Put_Line (File, " procedure Frame (Object : Surface; Subject : in out Callback'Class)"); Put_Line (File, " with Pre => Object.Has_Proxy and not Subject.Has_Proxy;"); Put_Line (File, ""); Put_Line (File, " procedure Set_Opaque_Region (Object : Surface;"); Put_Line (File, " Region : Client.Region'Class)"); Put_Line (File, " with Pre => Object.Has_Proxy;"); Put_Line (File, ""); Put_Line (File, " procedure Set_Input_Region (Object : Surface;"); Put_Line (File, " Region : Client.Region'Class)"); Put_Line (File, " with Pre => Object.Has_Proxy;"); Put_Line (File, ""); Put_Line (File, " procedure Commit (Object : Surface)"); Put_Line (File, " with Pre => Object.Has_Proxy;"); Put_Line (File, ""); Put_Line (File, " procedure Set_Buffer_Transform (Object : Surface;"); Put_Line (File, " Transform : Output_Transform)"); Put_Line (File, " with Pre => Object.Has_Proxy;"); Put_Line (File, ""); Put_Line (File, " procedure Set_Buffer_Scale (Object : Surface;"); Put_Line (File, " Scale : Positive)"); Put_Line (File, " with Pre => Object.Has_Proxy;"); Put_Line (File, ""); Put_Line (File, " procedure Damage_Buffer (Object : Surface;"); Put_Line (File, " X, Y : Integer;"); Put_Line (File, " Width : Natural;"); Put_Line (File, " Height : Natural)"); Put_Line (File, " with Pre => Object.Has_Proxy;"); elsif Name = "Pointer" then Put_Line (File, ""); Put_Line (File, " procedure Set_Cursor (Object : Pointer;"); Put_Line (File, " Serial : Unsigned_32;"); Put_Line (File, " Surface : Client.Surface'Class;"); Put_Line (File, " Hotspot_X : Integer;"); Put_Line (File, " Hotspot_Y : Integer)"); Put_Line (File, " with Pre => Object.Has_Proxy;"); elsif Name = "Region" then Put_Line (File, ""); Put_Line (File, " procedure Add (Object : Region;"); Put_Line (File, " X, Y : Integer;"); Put_Line (File, " Width : Natural;"); Put_Line (File, " Height : Natural)"); Put_Line (File, " with Pre => Object.Has_Proxy;"); Put_Line (File, ""); Put_Line (File, " procedure Subtract (Object : Region;"); Put_Line (File, " X, Y : Integer;"); Put_Line (File, " Width : Natural;"); Put_Line (File, " Height : Natural)"); Put_Line (File, " with Pre => Object.Has_Proxy;"); elsif Name = "Subcompositor" then Put_Line (File, ""); Put_Line (File, " procedure Get_Subsurface (Object : Subcompositor;"); Put_Line (File, " Surface : Client.Surface'Class;"); Put_Line (File, " Parent : Client.Surface'Class;"); Put_Line (File, " Subsurface : in out Client.Subsurface'Class)"); Put_Line (File, " with Pre => Object.Has_Proxy and Surface.Has_Proxy and Parent.Has_Proxy;"); elsif Name = "Subsurface" then Put_Line (File, ""); Put_Line (File, " procedure Set_Position (Object : Subsurface; X, Y : Integer)"); Put_Line (File, " with Pre => Object.Has_Proxy;"); Put_Line (File, ""); Put_Line (File, " procedure Place_Above (Object : Subsurface;"); Put_Line (File, " Sibling : Surface'Class)"); Put_Line (File, " with Pre => Object.Has_Proxy and Sibling.Has_Proxy;"); Put_Line (File, ""); Put_Line (File, " procedure Place_Below (Object : Subsurface;"); Put_Line (File, " Sibling : Surface'Class)"); Put_Line (File, " with Pre => Object.Has_Proxy and Sibling.Has_Proxy;"); Put_Line (File, ""); Put_Line (File, " procedure Set_Sync (Object : Subsurface)"); Put_Line (File, " with Pre => Object.Has_Proxy;"); Put_Line (File, ""); Put_Line (File, " procedure Set_Desync (Object : Subsurface)"); Put_Line (File, " with Pre => Object.Has_Proxy;"); end if; end Handle_Interface_Subprograms_Client; procedure Handle_Interface_Events_Client (Interface_Tag : aliased Wayland_XML.Interface_Tag) is Name : constant String := Xml_Parser_Utils.Adaify_Name (Wayland_XML.Name (Interface_Tag)); begin if not Exists_Events (Interface_Tag) then return; end if; Generate_Prefix_Spec_Events; if Name = "Display" then Put_Line (File, " with procedure Error"); Put_Line (File, " (Display : in out Client.Display'Class;"); Put_Line (File, " Code : Unsigned_32;"); Put_Line (File, " Message : String) is null;"); Put_Line (File, ""); Put_Line (File, " with procedure Delete_Id"); Put_Line (File, " (Display : in out Client.Display'Class;"); Put_Line (File, " Id : Unsigned_32) is null;"); elsif Name = "Registry" then Put_Line (File, " with procedure Global_Object_Added"); Put_Line (File, " (Registry : in out Client.Registry'Class;"); Put_Line (File, " Id : Unsigned_32;"); Put_Line (File, " Name : String;"); Put_Line (File, " Version : Unsigned_32);"); Put_Line (File, ""); Put_Line (File, " with procedure Global_Object_Removed"); Put_Line (File, " (Registry : in out Client.Registry'Class;"); Put_Line (File, " Id : Unsigned_32) is null;"); elsif Name = "Callback" then Put_Line (File, " with procedure Done"); Put_Line (File, " (Callback : in out Client.Callback'Class;"); Put_Line (File, " Callback_Data : Unsigned_32);"); elsif Name = "Shm" then Put_Line (File, " with procedure Format"); Put_Line (File, " (Shm : in out Client.Shm'Class;"); Put_Line (File, " Format : Shm_Format);"); elsif Name = "Buffer" then Put_Line (File, " with procedure Release"); Put_Line (File, " (Buffer : in out Client.Buffer'Class);"); elsif Name = "Data_Offer" then Put_Line (File, " with procedure Offer"); Put_Line (File, " (Data_Offer : in out Client.Data_Offer'Class;"); Put_Line (File, " Mime_Type : String) is null;"); Put_Line (File, ""); Put_Line (File, " with procedure Source_Actions"); Put_Line (File, " (Data_Offer : in out Client.Data_Offer'Class;"); Put_Line (File, " Source_Actions : Data_Device_Manager_Dnd_Action) is null;"); Put_Line (File, ""); Put_Line (File, " with procedure Action"); Put_Line (File, " (Data_Offer : in out Client.Data_Offer'Class;"); Put_Line (File, " Dnd_Action : Data_Device_Manager_Dnd_Action) is null;"); elsif Name = "Data_Source" then Put_Line (File, " with procedure Target"); Put_Line (File, " (Data_Source : in out Client.Data_Source'Class;"); Put_Line (File, " Mime_Type : String) is null;"); Put_Line (File, ""); Put_Line (File, " with procedure Send"); Put_Line (File, " (Data_Source : in out Client.Data_Source'Class;"); Put_Line (File, " Mime_Type : String;"); Put_Line (File, " Fd : File_Descriptor) is null;"); Put_Line (File, ""); Put_Line (File, " with procedure Cancelled"); Put_Line (File, " (Data_Source : in out Client.Data_Source'Class) is null;"); Put_Line (File, ""); Put_Line (File, " with procedure Performed"); Put_Line (File, " (Data_Source : in out Client.Data_Source'Class) is null;"); Put_Line (File, ""); Put_Line (File, " with procedure Finished"); Put_Line (File, " (Data_Source : in out Client.Data_Source'Class) is null;"); Put_Line (File, ""); Put_Line (File, " with procedure Action"); Put_Line (File, " (Data_Source : in out Client.Data_Source'Class;"); Put_Line (File, " Dnd_Action : Data_Device_Manager_Dnd_Action) is null;"); elsif Name = "Data_Device" then Put_Line (File, " with procedure Data_Offer"); Put_Line (File, " (Data_Device : in out Client.Data_Device'Class;"); Put_Line (File, " Data_Offer : in out Client.Data_Offer) is null;"); Put_Line (File, ""); Put_Line (File, " with procedure Enter"); Put_Line (File, " (Data_Device : in out Client.Data_Device'Class;"); Put_Line (File, " Serial : Unsigned_32;"); Put_Line (File, " Surface : Client.Surface;"); Put_Line (File, " X, Y : Fixed;"); Put_Line (File, " Data_Offer : in out Client.Data_Offer) is null;"); Put_Line (File, ""); Put_Line (File, " with procedure Leave"); Put_Line (File, " (Data_Device : in out Client.Data_Device'Class) is null;"); Put_Line (File, ""); Put_Line (File, " with procedure Motion"); Put_Line (File, " (Data_Device : in out Client.Data_Device'Class;"); Put_Line (File, " Time : Unsigned_32;"); Put_Line (File, " X, Y : Fixed) is null;"); Put_Line (File, ""); Put_Line (File, " with procedure Drop"); Put_Line (File, " (Data_Device : in out Client.Data_Device'Class) is null;"); Put_Line (File, ""); Put_Line (File, " with procedure Selection"); Put_Line (File, " (Data_Device : in out Client.Data_Device'Class;"); Put_Line (File, " Data_Offer : in out Client.Data_Offer) is null;"); elsif Name = "Surface" then Put_Line (File, " with procedure Enter"); Put_Line (File, " (Surface : in out Client.Surface'Class;"); Put_Line (File, " Output : Client.Output) is null;"); Put_Line (File, ""); Put_Line (File, " with procedure Leave"); Put_Line (File, " (Surface : in out Client.Surface'Class;"); Put_Line (File, " Output : Client.Output) is null;"); elsif Name = "Seat" then Put_Line (File, " with procedure Seat_Capabilities"); Put_Line (File, " (Seat : in out Client.Seat'Class;"); Put_Line (File, " Capabilities : Seat_Capability) is null;"); Put_Line (File, ""); Put_Line (File, " with procedure Seat_Name"); Put_Line (File, " (Seat : in out Client.Seat'Class;"); Put_Line (File, " Name : String) is null;"); elsif Name = "Pointer" then Put_Line (File, " with procedure Pointer_Enter"); Put_Line (File, " (Pointer : in out Client.Pointer'Class;"); Put_Line (File, " Serial : Unsigned_32;"); Put_Line (File, " Surface : Client.Surface;"); Put_Line (File, " Surface_X : Fixed;"); Put_Line (File, " Surface_Y : Fixed) is null;"); Put_Line (File, ""); Put_Line (File, " with procedure Pointer_Leave"); Put_Line (File, " (Pointer : in out Client.Pointer'Class;"); Put_Line (File, " Serial : Unsigned_32;"); Put_Line (File, " Surface : Client.Surface) is null;"); Put_Line (File, ""); Put_Line (File, " with procedure Pointer_Motion"); Put_Line (File, " (Pointer : in out Client.Pointer'Class;"); Put_Line (File, " Time : Unsigned_32;"); Put_Line (File, " Surface_X : Fixed;"); Put_Line (File, " Surface_Y : Fixed) is null;"); Put_Line (File, ""); Put_Line (File, " with procedure Pointer_Button"); Put_Line (File, " (Pointer : in out Client.Pointer'Class;"); Put_Line (File, " Serial : Unsigned_32;"); Put_Line (File, " Time : Unsigned_32;"); Put_Line (File, " Button : Unsigned_32;"); Put_Line (File, " State : Pointer_Button_State) is null;"); Put_Line (File, ""); Put_Line (File, " with procedure Pointer_Scroll"); Put_Line (File, " (Pointer : in out Client.Pointer'Class;"); Put_Line (File, " Time : Unsigned_32;"); Put_Line (File, " Axis : Pointer_Axis;"); Put_Line (File, " Value : Fixed) is null;"); Put_Line (File, ""); Put_Line (File, " with procedure Pointer_Frame"); Put_Line (File, " (Pointer : in out Client.Pointer'Class) is null;"); Put_Line (File, ""); Put_Line (File, " with procedure Pointer_Scroll_Source"); Put_Line (File, " (Pointer : in out Client.Pointer'Class;"); Put_Line (File, " Axis_Source : Pointer_Axis_Source) is null;"); Put_Line (File, ""); Put_Line (File, " with procedure Pointer_Scroll_Stop"); Put_Line (File, " (Pointer : in out Client.Pointer'Class;"); Put_Line (File, " Time : Unsigned_32;"); Put_Line (File, " Axis : Pointer_Axis) is null;"); Put_Line (File, ""); Put_Line (File, " with procedure Pointer_Scroll_Discrete"); Put_Line (File, " (Pointer : in out Client.Pointer'Class;"); Put_Line (File, " Axis : Pointer_Axis;"); Put_Line (File, " Discrete : Integer) is null;"); elsif Name = "Keyboard" then Put_Line (File, " with procedure Keymap"); Put_Line (File, " (Keyboard : in out Client.Keyboard'Class;"); Put_Line (File, " Format : Keyboard_Keymap_Format;"); Put_Line (File, " Fd : File_Descriptor;"); Put_Line (File, " Size : Unsigned_32) is null;"); Put_Line (File, ""); Put_Line (File, " with procedure Enter"); Put_Line (File, " (Keyboard : in out Client.Keyboard'Class;"); Put_Line (File, " Serial : Unsigned_32;"); Put_Line (File, " Surface : Client.Surface;"); Put_Line (File, " Keys : Unsigned_32_Array) is null;"); Put_Line (File, ""); Put_Line (File, " with procedure Leave"); Put_Line (File, " (Keyboard : in out Client.Keyboard'Class;"); Put_Line (File, " Serial : Unsigned_32;"); Put_Line (File, " Surface : Client.Surface) is null;"); Put_Line (File, ""); Put_Line (File, " with procedure Key"); Put_Line (File, " (Keyboard : in out Client.Keyboard'Class;"); Put_Line (File, " Serial : Unsigned_32;"); Put_Line (File, " Time : Unsigned_32;"); Put_Line (File, " Key : Unsigned_32;"); Put_Line (File, " State : Keyboard_Key_State) is null;"); Put_Line (File, ""); Put_Line (File, " with procedure Modifiers"); Put_Line (File, " (Keyboard : in out Client.Keyboard'Class;"); Put_Line (File, " Serial : Unsigned_32;"); Put_Line (File, " Mods_Depressed : Unsigned_32;"); Put_Line (File, " Mods_Latched : Unsigned_32;"); Put_Line (File, " Mods_Locked : Unsigned_32;"); Put_Line (File, " Group : Unsigned_32) is null;"); Put_Line (File, ""); Put_Line (File, " with procedure Repeat_Info"); Put_Line (File, " (Keyboard : in out Client.Keyboard'Class;"); Put_Line (File, " Rate : Integer;"); Put_Line (File, " Delay_V : Integer) is null;"); elsif Name = "Touch" then Put_Line (File, " with procedure Down"); Put_Line (File, " (Touch : in out Client.Touch'Class;"); Put_Line (File, " Serial : Unsigned_32;"); Put_Line (File, " Time : Unsigned_32;"); Put_Line (File, " Surface : Client.Surface;"); Put_Line (File, " Id : Integer;"); Put_Line (File, " X, Y : Fixed) is null;"); Put_Line (File, ""); Put_Line (File, " with procedure Up"); Put_Line (File, " (Touch : in out Client.Touch'Class;"); Put_Line (File, " Serial : Unsigned_32;"); Put_Line (File, " Time : Unsigned_32;"); Put_Line (File, " Id : Integer) is null;"); Put_Line (File, ""); Put_Line (File, " with procedure Motion"); Put_Line (File, " (Touch : in out Client.Touch'Class;"); Put_Line (File, " Time : Unsigned_32;"); Put_Line (File, " Id : Integer;"); Put_Line (File, " X, Y : Fixed) is null;"); Put_Line (File, ""); Put_Line (File, " with procedure Frame"); Put_Line (File, " (Touch : in out Client.Touch'Class) is null;"); Put_Line (File, ""); Put_Line (File, " with procedure Cancel"); Put_Line (File, " (Touch : in out Client.Touch'Class) is null;"); Put_Line (File, ""); Put_Line (File, " with procedure Shape"); Put_Line (File, " (Touch : in out Client.Touch'Class;"); Put_Line (File, " Id : Integer;"); Put_Line (File, " Major : Fixed;"); Put_Line (File, " Minor : Fixed) is null;"); Put_Line (File, ""); Put_Line (File, " with procedure Orientation"); Put_Line (File, " (Touch : in out Client.Touch'Class;"); Put_Line (File, " Id : Integer;"); Put_Line (File, " Orientation : Fixed) is null;"); elsif Name = "Output" then Put_Line (File, " with procedure Geometry"); Put_Line (File, " (Output : in out Client.Output'Class;"); Put_Line (File, " X, Y : Integer;"); Put_Line (File, " Physical_Width : Integer;"); Put_Line (File, " Physical_Height : Integer;"); Put_Line (File, " Subpixel : Output_Subpixel;"); Put_Line (File, " Make : String;"); Put_Line (File, " Model : String;"); Put_Line (File, " Transform : Output_Transform) is null;"); Put_Line (File, ""); Put_Line (File, " with procedure Mode"); Put_Line (File, " (Output : in out Client.Output'Class;"); Put_Line (File, " Flags : Output_Mode;"); Put_Line (File, " Width : Integer;"); Put_Line (File, " Height : Integer;"); Put_Line (File, " Refresh : Integer) is null;"); Put_Line (File, ""); Put_Line (File, " with procedure Done"); Put_Line (File, " (Output : in out Client.Output'Class) is null;"); Put_Line (File, ""); Put_Line (File, " with procedure Scale"); Put_Line (File, " (Output : in out Client.Output'Class;"); Put_Line (File, " Factor : Integer) is null;"); end if; Generate_Suffix_Spec_Events (Name); end Handle_Interface_Events_Client; procedure Handle_Interface_Subprograms_Xdg_Shell (Interface_Tag : aliased Wayland_XML.Interface_Tag) is Name : constant String := Xml_Parser_Utils.Adaify_Name (Wayland_XML.Name (Interface_Tag)); begin if Name in "Xdg_Wm_Base" then Generate_Spec_Bind_Subprogram (Name); end if; if Name = "Xdg_Wm_Base" then Put_Line (File, ""); Put_Line (File, " procedure Pong (Object : Xdg_Wm_Base; Serial : Unsigned_32)"); Put_Line (File, " with Pre => Object.Has_Proxy;"); Put_Line (File, ""); Put_Line (File, " procedure Create_Positioner"); Put_Line (File, " (Object : Xdg_Wm_Base;"); Put_Line (File, " Positioner : in out Xdg_Shell.Xdg_Positioner'Class)"); Put_Line (File, " with Pre => Object.Has_Proxy;"); Put_Line (File, ""); Put_Line (File, " procedure Get_Surface"); Put_Line (File, " (Object : Xdg_Wm_Base;"); Put_Line (File, " Window : Protocols.Client.Surface'Class;"); Put_Line (File, " Surface : in out Xdg_Shell.Xdg_Surface'Class)"); Put_Line (File, " with Pre => Object.Has_Proxy and Window.Has_Proxy;"); elsif Name = "Xdg_Positioner" then Put_Line (File, ""); Put_Line (File, " procedure Set_Size"); Put_Line (File, " (Object : Xdg_Positioner;"); Put_Line (File, " Width : Natural;"); Put_Line (File, " Height : Natural)"); Put_Line (File, " with Pre => Object.Has_Proxy;"); Put_Line (File, ""); Put_Line (File, " procedure Set_Anchor_Rect"); Put_Line (File, " (Object : Xdg_Positioner;"); Put_Line (File, " X, Y : Integer;"); Put_Line (File, " Width : Natural;"); Put_Line (File, " Height : Natural)"); Put_Line (File, " with Pre => Object.Has_Proxy;"); Put_Line (File, ""); Put_Line (File, " procedure Set_Anchor"); Put_Line (File, " (Object : Xdg_Positioner;"); Put_Line (File, " Anchor : Xdg_Positioner_Anchor)"); Put_Line (File, " with Pre => Object.Has_Proxy;"); Put_Line (File, ""); Put_Line (File, " procedure Set_Gravity"); Put_Line (File, " (Object : Xdg_Positioner;"); Put_Line (File, " Gravity : Xdg_Positioner_Gravity)"); Put_Line (File, " with Pre => Object.Has_Proxy;"); Put_Line (File, ""); Put_Line (File, " procedure Set_Constraint_Adjustment"); Put_Line (File, " (Object : Xdg_Positioner;"); Put_Line (File, " Adjustment : Unsigned_32)"); Put_Line (File, " with Pre => Object.Has_Proxy;"); Put_Line (File, ""); Put_Line (File, " procedure Set_Offset"); Put_Line (File, " (Object : Xdg_Positioner;"); Put_Line (File, " X, Y : Integer)"); Put_Line (File, " with Pre => Object.Has_Proxy;"); Put_Line (File, ""); Put_Line (File, " procedure Set_Reactive (Object : Xdg_Positioner)"); Put_Line (File, " with Pre => Object.Has_Proxy;"); Put_Line (File, ""); Put_Line (File, " procedure Set_Parent_Size"); Put_Line (File, " (Object : Xdg_Positioner;"); Put_Line (File, " Width : Natural;"); Put_Line (File, " Height : Natural)"); Put_Line (File, " with Pre => Object.Has_Proxy;"); Put_Line (File, ""); Put_Line (File, " procedure Set_Parent_Configure"); Put_Line (File, " (Object : Xdg_Positioner;"); Put_Line (File, " Serial : Unsigned_32)"); Put_Line (File, " with Pre => Object.Has_Proxy;"); elsif Name = "Xdg_Surface" then Put_Line (File, ""); Put_Line (File, " procedure Get_Toplevel"); Put_Line (File, " (Object : Xdg_Surface;"); Put_Line (File, " Toplevel : in out Xdg_Shell.Xdg_Toplevel'Class)"); Put_Line (File, " with Pre => Object.Has_Proxy;"); Put_Line (File, ""); Put_Line (File, " procedure Get_Popup"); Put_Line (File, " (Object : Xdg_Surface;"); Put_Line (File, " Parent : Xdg_Surface'Class;"); Put_Line (File, " Positioner : Xdg_Shell.Xdg_Positioner'Class;"); Put_Line (File, " Popup : in out Xdg_Shell.Xdg_Popup'Class)"); Put_Line (File, " with Pre => Object.Has_Proxy;"); Put_Line (File, ""); Put_Line (File, " procedure Set_Window_Geometry"); Put_Line (File, " (Object : Xdg_Surface;"); Put_Line (File, " X, Y : Integer;"); Put_Line (File, " Width : Natural;"); Put_Line (File, " Height : Natural)"); Put_Line (File, " with Pre => Object.Has_Proxy;"); Put_Line (File, ""); Put_Line (File, " procedure Ack_Configure"); Put_Line (File, " (Object : Xdg_Surface;"); Put_Line (File, " Serial : Unsigned_32)"); Put_Line (File, " with Pre => Object.Has_Proxy;"); elsif Name = "Xdg_Toplevel" then Put_Line (File, ""); Put_Line (File, " procedure Set_Parent"); Put_Line (File, " (Object : Xdg_Toplevel;"); Put_Line (File, " Parent : Xdg_Toplevel'Class)"); Put_Line (File, " with Pre => Object.Has_Proxy and Parent.Has_Proxy;"); Put_Line (File, ""); Put_Line (File, " procedure Set_Title (Object : Xdg_Toplevel; Value : String)"); Put_Line (File, " with Pre => Object.Has_Proxy;"); Put_Line (File, ""); Put_Line (File, " procedure Set_App_Id (Object : Xdg_Toplevel; Value : String)"); Put_Line (File, " with Pre => Object.Has_Proxy;"); Put_Line (File, ""); Put_Line (File, " procedure Show_Window_Menu"); Put_Line (File, " (Object : Xdg_Toplevel;"); Put_Line (File, " Seat : Protocols.Client.Seat'Class;"); Put_Line (File, " Serial : Unsigned_32;"); Put_Line (File, " X, Y : Integer)"); Put_Line (File, " with Pre => Object.Has_Proxy;"); Put_Line (File, ""); Put_Line (File, " procedure Move"); Put_Line (File, " (Object : Xdg_Toplevel;"); Put_Line (File, " Seat : Protocols.Client.Seat'Class;"); Put_Line (File, " Serial : Unsigned_32)"); Put_Line (File, " with Pre => Object.Has_Proxy;"); Put_Line (File, ""); Put_Line (File, " procedure Resize"); Put_Line (File, " (Object : Xdg_Toplevel;"); Put_Line (File, " Seat : Protocols.Client.Seat'Class;"); Put_Line (File, " Serial : Unsigned_32;"); Put_Line (File, " Edges : Xdg_Toplevel_Resize_Edge)"); Put_Line (File, " with Pre => Object.Has_Proxy;"); Put_Line (File, ""); Put_Line (File, " procedure Set_Min_Size"); Put_Line (File, " (Object : Xdg_Toplevel;"); Put_Line (File, " Width : Natural;"); Put_Line (File, " Height : Natural)"); Put_Line (File, " with Pre => Object.Has_Proxy;"); Put_Line (File, ""); Put_Line (File, " procedure Set_Max_Size"); Put_Line (File, " (Object : Xdg_Toplevel;"); Put_Line (File, " Width : Natural;"); Put_Line (File, " Height : Natural)"); Put_Line (File, " with Pre => Object.Has_Proxy;"); Put_Line (File, ""); Put_Line (File, " procedure Minimize (Object : Xdg_Toplevel)"); Put_Line (File, " with Pre => Object.Has_Proxy;"); Put_Line (File, ""); Put_Line (File, " procedure Set_Maximized (Object : Xdg_Toplevel; Enable : Boolean)"); Put_Line (File, " with Pre => Object.Has_Proxy;"); Put_Line (File, ""); Put_Line (File, " procedure Set_Fullscreen"); Put_Line (File, " (Object : Xdg_Toplevel;"); Put_Line (File, " Enable : Boolean)"); Put_Line (File, " with Pre => Object.Has_Proxy;"); Put_Line (File, ""); Put_Line (File, " procedure Set_Fullscreen"); Put_Line (File, " (Object : Xdg_Toplevel;"); Put_Line (File, " Enable : Boolean;"); Put_Line (File, " Output : Protocols.Client.Output'Class)"); Put_Line (File, " with Pre => Object.Has_Proxy and Output.Has_Proxy;"); elsif Name = "Xdg_Popup" then Put_Line (File, ""); Put_Line (File, " procedure Grab"); Put_Line (File, " (Object : Xdg_Popup;"); Put_Line (File, " Seat : Protocols.Client.Seat'Class;"); Put_Line (File, " Serial : Unsigned_32)"); Put_Line (File, " with Pre => Object.Has_Proxy and Seat.Has_Proxy;"); Put_Line (File, ""); Put_Line (File, " procedure Reposition"); Put_Line (File, " (Object : Xdg_Popup;"); Put_Line (File, " Positioner : Xdg_Shell.Xdg_Positioner'Class;"); Put_Line (File, " Token : Unsigned_32)"); Put_Line (File, " with Pre => Object.Has_Proxy and Positioner.Has_Proxy;"); end if; end Handle_Interface_Subprograms_Xdg_Shell; procedure Handle_Interface_Events_Xdg_Shell (Interface_Tag : aliased Wayland_XML.Interface_Tag) is Name : constant String := Xml_Parser_Utils.Adaify_Name (Wayland_XML.Name (Interface_Tag)); begin if not Exists_Events (Interface_Tag) then return; end if; Generate_Prefix_Spec_Events; if Name = "Xdg_Wm_Base" then Put_Line (File, " with procedure Ping"); Put_Line (File, " (Xdg_Wm_Base : in out Xdg_Shell.Xdg_Wm_Base'Class;"); Put_Line (File, " Serial : Unsigned_32);"); elsif Name = "Xdg_Surface" then Put_Line (File, " with procedure Configure"); Put_Line (File, " (Xdg_Surface : in out Xdg_Shell.Xdg_Surface'Class;"); Put_Line (File, " Serial : Unsigned_32);"); elsif Name = "Xdg_Toplevel" then Put_Line (File, " with procedure Configure"); Put_Line (File, " (Xdg_Toplevel : in out Xdg_Shell.Xdg_Toplevel'Class;"); Put_Line (File, " Width : Natural;"); Put_Line (File, " Height : Natural;"); Put_Line (File, " States : State_Array);"); Put_Line (File, ""); Put_Line (File, " with procedure Close"); Put_Line (File, " (Xdg_Toplevel : in out Xdg_Shell.Xdg_Toplevel'Class) is null;"); elsif Name = "Xdg_Popup" then Put_Line (File, " with procedure Configure"); Put_Line (File, " (Xdg_Popup : in out Xdg_Shell.Xdg_Popup'Class;"); Put_Line (File, " X, Y : Integer;"); Put_Line (File, " Width : Natural;"); Put_Line (File, " Height : Natural);"); Put_Line (File, ""); Put_Line (File, " with procedure Popup_Done"); Put_Line (File, " (Xdg_Popup : in out Xdg_Shell.Xdg_Popup'Class) is null;"); Put_Line (File, ""); Put_Line (File, " with procedure Repositioned"); Put_Line (File, " (Xdg_Popup : in out Xdg_Shell.Xdg_Popup'Class;"); Put_Line (File, " Token : Unsigned_32) is null;"); end if; Generate_Suffix_Spec_Events (Name); end Handle_Interface_Events_Xdg_Shell; procedure Handle_Interface_Subprograms_Presentation_Time (Interface_Tag : aliased Wayland_XML.Interface_Tag) is Name : constant String := Xml_Parser_Utils.Adaify_Name (Wayland_XML.Name (Interface_Tag)); begin if Name in "Presentation" then Generate_Spec_Bind_Subprogram (Name); end if; if Name = "Presentation" then Put_Line (File, ""); Put_Line (File, " procedure Feedback"); Put_Line (File, " (Object : Presentation;"); Put_Line (File, " Surface : Protocols.Client.Surface'Class;"); Put_Line (File, " Feedback : in out Presentation_Feedback'Class)"); Put_Line (File, " with Pre => Object.Has_Proxy and Surface.Has_Proxy;"); end if; end Handle_Interface_Subprograms_Presentation_Time; procedure Handle_Interface_Events_Presentation_Time (Interface_Tag : aliased Wayland_XML.Interface_Tag) is Name : constant String := Xml_Parser_Utils.Adaify_Name (Wayland_XML.Name (Interface_Tag)); begin if not Exists_Events (Interface_Tag) then return; end if; Generate_Prefix_Spec_Events; if Name = "Presentation" then Put_Line (File, " with procedure Clock"); Put_Line (File, " (Presentation : in out Presentation_Time.Presentation'Class;"); Put_Line (File, " Id : Unsigned_32);"); elsif Name = "Presentation_Feedback" then Put_Line (File, " with procedure Synchronized_Output"); Put_Line (File, " (Presentation_Feedback : in out Presentation_Time.Presentation_Feedback'Class;"); Put_Line (File, " Output : Protocols.Client.Output'Class);"); Put_Line (File, ""); Put_Line (File, " with procedure Presented"); Put_Line (File, " (Presentation_Feedback : in out Presentation_Time.Presentation_Feedback'Class;"); Put_Line (File, " Timestamp : Duration;"); Put_Line (File, " Refresh : Duration;"); Put_Line (File, " Counter : Unsigned_64;"); Put_Line (File, " Flags : Enums.Presentation_Time.Presentation_Feedback_Kind);"); Put_Line (File, ""); Put_Line (File, " with procedure Discarded"); Put_Line (File, " (Presentation_Feedback : in out Presentation_Time.Presentation_Feedback'Class);"); end if; Generate_Suffix_Spec_Events (Name); end Handle_Interface_Events_Presentation_Time; procedure Handle_Interface_Subprograms_Viewporter (Interface_Tag : aliased Wayland_XML.Interface_Tag) is Name : constant String := Xml_Parser_Utils.Adaify_Name (Wayland_XML.Name (Interface_Tag)); begin if Name in "Viewporter" then Generate_Spec_Bind_Subprogram (Name); end if; if Name = "Viewporter" then Put_Line (File, ""); Put_Line (File, " procedure Get_Viewport"); Put_Line (File, " (Object : Viewporter;"); Put_Line (File, " Surface : Client.Surface'Class;"); Put_Line (File, " Viewport : in out Protocols.Viewporter.Viewport'Class)"); Put_Line (File, " with Pre => Object.Has_Proxy and Surface.Has_Proxy;"); elsif Name = "Viewport" then Put_Line (File, ""); Put_Line (File, " procedure Set_Source"); Put_Line (File, " (Object : Viewport;"); Put_Line (File, " X, Y, Width, Height : Fixed)"); Put_Line (File, " with Pre => (X = -1.0 and Y = -1.0 and Width = -1.0 and Height = -1.0)"); Put_Line (File, " or (Width > 0.0 and Height > 0.0 and X >= 0.0 and Y >= 0.0);"); Put_Line (File, ""); Put_Line (File, " procedure Set_Destination"); Put_Line (File, " (Object : Viewport;"); Put_Line (File, " Width, Height : Integer)"); Put_Line (File, " with Pre => (Width = -1 and Height = -1) or (Width > 0 and Height > 0);"); end if; end Handle_Interface_Subprograms_Viewporter; procedure Handle_Interface_Subprogram_Idle_Inhibit (Interface_Tag : aliased Wayland_XML.Interface_Tag) is Name : constant String := Xml_Parser_Utils.Adaify_Name (Wayland_XML.Name (Interface_Tag)); begin if Name in "Idle_Inhibit_Manager_V1" then Generate_Spec_Bind_Subprogram (Name); end if; if Name = "Idle_Inhibit_Manager_V1" then Put_Line (File, ""); Put_Line (File, " procedure Create_Inhibitor"); Put_Line (File, " (Object : Idle_Inhibit_Manager_V1;"); Put_Line (File, " Surface : Client.Surface'Class;"); Put_Line (File, " Inhibitor : in out Idle_Inhibitor_V1'Class)"); Put_Line (File, " with Pre => Object.Has_Proxy and Surface.Has_Proxy;"); elsif Name = "Idle_Inhibitor_V1" then null; end if; end Handle_Interface_Subprogram_Idle_Inhibit; procedure Handle_Interface_Subprogram_Xdg_Decoration (Interface_Tag : aliased Wayland_XML.Interface_Tag) is Name : constant String := Xml_Parser_Utils.Adaify_Name (Wayland_XML.Name (Interface_Tag)); begin if Name in "Decoration_Manager_V1" then Generate_Spec_Bind_Subprogram (Name); end if; if Name = "Decoration_Manager_V1" then Put_Line (File, ""); Put_Line (File, " procedure Get_Toplevel_Decoration"); Put_Line (File, " (Object : Decoration_Manager_V1;"); Put_Line (File, " Toplevel : Xdg_Shell.Xdg_Toplevel'Class;"); Put_Line (File, " Decoration : in out Toplevel_Decoration_V1'Class)"); Put_Line (File, " with Pre => Object.Has_Proxy and Toplevel.Has_Proxy;"); elsif Name = "Toplevel_Decoration_V1" then Put_Line (File, ""); Put_Line (File, " procedure Set_Mode"); Put_Line (File, " (Object : Toplevel_Decoration_V1;"); Put_Line (File, " Mode : Toplevel_Decoration_V1_Mode)"); Put_Line (File, " with Pre => Object.Has_Proxy;"); Put_Line (File, ""); Put_Line (File, " procedure Unset_Mode (Object : Toplevel_Decoration_V1)"); Put_Line (File, " with Pre => Object.Has_Proxy;"); end if; end Handle_Interface_Subprogram_Xdg_Decoration; procedure Handle_Interface_Events_Xdg_Decoration (Interface_Tag : aliased Wayland_XML.Interface_Tag) is Name : constant String := Xml_Parser_Utils.Adaify_Name (Wayland_XML.Name (Interface_Tag)); begin if not Exists_Events (Interface_Tag) then return; end if; Generate_Prefix_Spec_Events; if Name = "Toplevel_Decoration_V1" then Put_Line (File, " with procedure Configure"); Put_Line (File, " (Decoration : in out Toplevel_Decoration_V1'Class;"); Put_Line (File, " Mode : Toplevel_Decoration_V1_Mode);"); end if; Generate_Suffix_Spec_Events (Name); end Handle_Interface_Events_Xdg_Decoration; procedure Handle_Interface_Subprogram_Relative_Pointer (Interface_Tag : aliased Wayland_XML.Interface_Tag) is Name : constant String := Xml_Parser_Utils.Adaify_Name (Wayland_XML.Name (Interface_Tag)); begin if Name in "Relative_Pointer_Manager_V1" then Generate_Spec_Bind_Subprogram (Name); end if; if Name = "Relative_Pointer_Manager_V1" then Put_Line (File, ""); Put_Line (File, " procedure Get_Relative_Pointer"); Put_Line (File, " (Object : Relative_Pointer_Manager_V1;"); Put_Line (File, " Pointer : Client.Pointer'Class;"); Put_Line (File, " Relative : in out Relative_Pointer_V1'Class)"); Put_Line (File, " with Pre => Object.Has_Proxy and Pointer.Has_Proxy;"); elsif Name = "Relative_Pointer_V1" then null; end if; end Handle_Interface_Subprogram_Relative_Pointer; procedure Handle_Interface_Events_Relative_Pointer (Interface_Tag : aliased Wayland_XML.Interface_Tag) is Name : constant String := Xml_Parser_Utils.Adaify_Name (Wayland_XML.Name (Interface_Tag)); begin if not Exists_Events (Interface_Tag) then return; end if; Generate_Prefix_Spec_Events; if Name = "Relative_Pointer_V1" then Put_Line (File, " with procedure Relative_Motion"); Put_Line (File, " (Pointer : in out Relative_Pointer_V1'Class;"); Put_Line (File, " Timestamp : Duration;"); Put_Line (File, " Dx : Fixed;"); Put_Line (File, " Dy : Fixed;"); Put_Line (File, " Dx_Unaccel : Fixed;"); Put_Line (File, " Dy_Unaccel : Fixed);"); end if; Generate_Suffix_Spec_Events (Name); end Handle_Interface_Events_Relative_Pointer; procedure Handle_Interface_Subprogram_Pointer_Constraints (Interface_Tag : aliased Wayland_XML.Interface_Tag) is Name : constant String := Xml_Parser_Utils.Adaify_Name (Wayland_XML.Name (Interface_Tag)); begin if Name in "Pointer_Constraints_V1" then Generate_Spec_Bind_Subprogram (Name); end if; if Name = "Pointer_Constraints_V1" then Put_Line (File, ""); Put_Line (File, " procedure Lock_Pointer"); Put_Line (File, " (Object : Pointer_Constraints_V1;"); Put_Line (File, " Surface : Client.Surface'Class;"); Put_Line (File, " Pointer : Client.Pointer'Class;"); Put_Line (File, " Region : Client.Region'Class;"); Put_Line (File, " Lifetime : Pointer_Constraints_V1_Lifetime;"); Put_Line (File, " Locked : in out Locked_Pointer_V1'Class)"); Put_Line (File, " with Pre => Object.Has_Proxy and Surface.Has_Proxy and Pointer.Has_Proxy;"); Put_Line (File, ""); Put_Line (File, " procedure Confine_Pointer"); Put_Line (File, " (Object : Pointer_Constraints_V1;"); Put_Line (File, " Surface : Client.Surface'Class;"); Put_Line (File, " Pointer : Client.Pointer'Class;"); Put_Line (File, " Region : Client.Region'Class;"); Put_Line (File, " Lifetime : Pointer_Constraints_V1_Lifetime;"); Put_Line (File, " Confined : in out Confined_Pointer_V1'Class)"); Put_Line (File, " with Pre => Object.Has_Proxy and Surface.Has_Proxy and Pointer.Has_Proxy;"); elsif Name = "Locked_Pointer_V1" then Put_Line (File, ""); Put_Line (File, " procedure Set_Cursor_Position_Hint"); Put_Line (File, " (Object : Locked_Pointer_V1;"); Put_Line (File, " X, Y : Fixed)"); Put_Line (File, " with Pre => Object.Has_Proxy;"); Put_Line (File, ""); Put_Line (File, " procedure Set_Region"); Put_Line (File, " (Object : Locked_Pointer_V1;"); Put_Line (File, " Region : Client.Region'Class)"); Put_Line (File, " with Pre => Object.Has_Proxy and Region.Has_Proxy;"); elsif Name = "Confined_Pointer_V1" then Put_Line (File, ""); Put_Line (File, " procedure Set_Region"); Put_Line (File, " (Object : Confined_Pointer_V1;"); Put_Line (File, " Region : Client.Region'Class)"); Put_Line (File, " with Pre => Object.Has_Proxy and Region.Has_Proxy;"); end if; end Handle_Interface_Subprogram_Pointer_Constraints; procedure Handle_Interface_Events_Pointer_Constraints (Interface_Tag : aliased Wayland_XML.Interface_Tag) is Name : constant String := Xml_Parser_Utils.Adaify_Name (Wayland_XML.Name (Interface_Tag)); begin if not Exists_Events (Interface_Tag) then return; end if; Generate_Prefix_Spec_Events; if Name = "Locked_Pointer_V1" then Put_Line (File, " with procedure Locked"); Put_Line (File, " (Pointer : in out Locked_Pointer_V1'Class);"); Put_Line (File, ""); Put_Line (File, " with procedure Unlocked"); Put_Line (File, " (Pointer : in out Locked_Pointer_V1'Class);"); elsif Name = "Confined_Pointer_V1" then Put_Line (File, " with procedure Confined"); Put_Line (File, " (Pointer : in out Confined_Pointer_V1'Class);"); Put_Line (File, ""); Put_Line (File, " with procedure Unconfined"); Put_Line (File, " (Pointer : in out Confined_Pointer_V1'Class);"); end if; Generate_Suffix_Spec_Events (Name); end Handle_Interface_Events_Pointer_Constraints; procedure Handle_Interface_Subprogram_Pointer_Gestures (Interface_Tag : aliased Wayland_XML.Interface_Tag) is Name : constant String := Xml_Parser_Utils.Adaify_Name (Wayland_XML.Name (Interface_Tag)); begin if Name in "Pointer_Gestures_V1" then Generate_Spec_Bind_Subprogram (Name); end if; if Name in "Pointer_Gestures_V1" then Put_Line (File, ""); Put_Line (File, " procedure Get_Swipe_Gesture"); Put_Line (File, " (Object : Pointer_Gestures_V1;"); Put_Line (File, " Pointer : Client.Pointer'Class;"); Put_Line (File, " Gesture : in out Pointer_Gesture_Swipe_V1'Class)"); Put_Line (File, " with Pre => Object.Has_Proxy and Pointer.Has_Proxy;"); Put_Line (File, ""); Put_Line (File, " procedure Get_Pinch_Gesture"); Put_Line (File, " (Object : Pointer_Gestures_V1;"); Put_Line (File, " Pointer : Client.Pointer'Class;"); Put_Line (File, " Gesture : in out Pointer_Gesture_Pinch_V1'Class)"); Put_Line (File, " with Pre => Object.Has_Proxy and Pointer.Has_Proxy;"); end if; end Handle_Interface_Subprogram_Pointer_Gestures; procedure Handle_Interface_Events_Pointer_Gestures (Interface_Tag : aliased Wayland_XML.Interface_Tag) is Name : constant String := Xml_Parser_Utils.Adaify_Name (Wayland_XML.Name (Interface_Tag)); begin if not Exists_Events (Interface_Tag) then return; end if; Generate_Prefix_Spec_Events; if Name = "Pointer_Gesture_Swipe_V1" then Put_Line (File, " with procedure Gesture_Begin"); Put_Line (File, " (Gesture : in out Pointer_Gesture_Swipe_V1'Class;"); Put_Line (File, " Serial : Unsigned_32;"); Put_Line (File, " Timestamp : Duration;"); Put_Line (File, " Surface : Client.Surface;"); Put_Line (File, " Fingers : Unsigned_32);"); Put_Line (File, ""); Put_Line (File, " with procedure Gesture_Update"); Put_Line (File, " (Gesture : in out Pointer_Gesture_Swipe_V1'Class;"); Put_Line (File, " Timestamp : Duration;"); Put_Line (File, " Dx, Dy : Fixed);"); Put_Line (File, ""); Put_Line (File, " with procedure Gesture_End"); Put_Line (File, " (Gesture : in out Pointer_Gesture_Swipe_V1'Class;"); Put_Line (File, " Serial : Unsigned_32;"); Put_Line (File, " Timestamp : Duration;"); Put_Line (File, " Cancelled : Boolean);"); elsif Name = "Pointer_Gesture_Pinch_V1" then Put_Line (File, " with procedure Gesture_Begin"); Put_Line (File, " (Gesture : in out Pointer_Gesture_Pinch_V1'Class;"); Put_Line (File, " Serial : Unsigned_32;"); Put_Line (File, " Timestamp : Duration;"); Put_Line (File, " Surface : Client.Surface;"); Put_Line (File, " Fingers : Unsigned_32);"); Put_Line (File, ""); Put_Line (File, " with procedure Gesture_Update"); Put_Line (File, " (Gesture : in out Pointer_Gesture_Pinch_V1'Class;"); Put_Line (File, " Timestamp : Duration;"); Put_Line (File, " Dx, Dy : Fixed;"); Put_Line (File, " Scale : Fixed;"); Put_Line (File, " Rotation : Fixed);"); Put_Line (File, ""); Put_Line (File, " with procedure Gesture_End"); Put_Line (File, " (Gesture : in out Pointer_Gesture_Pinch_V1'Class;"); Put_Line (File, " Serial : Unsigned_32;"); Put_Line (File, " Timestamp : Duration;"); Put_Line (File, " Cancelled : Boolean);"); end if; Generate_Suffix_Spec_Events (Name); end Handle_Interface_Events_Pointer_Gestures; procedure Handle_Interface_Common_Subprograms (Interface_Tag : aliased Wayland_XML.Interface_Tag) is Name : constant String := Xml_Parser_Utils.Adaify_Name (Wayland_XML.Name (Interface_Tag)); begin if Protocol_Name /= "client" or Name /= "Display" then Generate_Spec_Destroy_Subprogram (Interface_Tag); end if; Generate_Spec_Utility_Functions (Name); if Protocol_Name /= "client" or Name /= "Display" then Generate_Spec_User_Data_Subprogram (Name); end if; end Handle_Interface_Common_Subprograms; procedure Handle_Interface_Common_Events (Interface_Tag : aliased Wayland_XML.Interface_Tag) is Name : constant String := Xml_Parser_Utils.Adaify_Name (Wayland_XML.Name (Interface_Tag)); begin if not Exists_Events (Interface_Tag) then return; end if; Generate_Prefix_Spec_Events; Put_Line (File, " -- FIXME Add generic `with procedure`'s here"); Generate_Suffix_Spec_Events (Name); end Handle_Interface_Common_Events; begin Iterate_Over_Interfaces (Handle_Interface_Common_Subprograms'Access); if Protocol_Name = "client" then Iterate_Over_Interfaces (Handle_Interface_Subprograms_Client'Access); Iterate_Over_Interfaces (Handle_Interface_Events_Client'Access); elsif Protocol_Name = "xdg_shell" then Iterate_Over_Interfaces (Handle_Interface_Subprograms_Xdg_Shell'Access); Iterate_Over_Interfaces (Handle_Interface_Events_Xdg_Shell'Access); elsif Protocol_Name = "presentation_time" then Iterate_Over_Interfaces (Handle_Interface_Subprograms_Presentation_Time'Access); Iterate_Over_Interfaces (Handle_Interface_Events_Presentation_Time'Access); elsif Protocol_Name = "viewporter" then Iterate_Over_Interfaces (Handle_Interface_Subprograms_Viewporter'Access); elsif Protocol_Name = "idle_inhibit_unstable_v1" then Iterate_Over_Interfaces (Handle_Interface_Subprogram_Idle_Inhibit'Access); elsif Protocol_Name = "xdg_decoration_unstable_v1" then Iterate_Over_Interfaces (Handle_Interface_Subprogram_Xdg_Decoration'Access); Iterate_Over_Interfaces (Handle_Interface_Events_Xdg_Decoration'Access); elsif Protocol_Name = "relative_pointer_unstable_v1" then Iterate_Over_Interfaces (Handle_Interface_Subprogram_Relative_Pointer'Access); Iterate_Over_Interfaces (Handle_Interface_Events_Relative_Pointer'Access); elsif Protocol_Name = "pointer_constraints_unstable_v1" then Iterate_Over_Interfaces (Handle_Interface_Subprogram_Pointer_Constraints'Access); Iterate_Over_Interfaces (Handle_Interface_Events_Pointer_Constraints'Access); elsif Protocol_Name = "pointer_gestures_unstable_v1" then Iterate_Over_Interfaces (Handle_Interface_Subprogram_Pointer_Gestures'Access); Iterate_Over_Interfaces (Handle_Interface_Events_Pointer_Gestures'Access); else Iterate_Over_Interfaces (Handle_Interface_Common_Events'Access); end if; end Generate_Manually_Edited_Partial_Type_Declarations; procedure Create_Wl_Thin_Spec_File (Protocol_Name : String) is procedure Generate_Code_For_Interface_Constants is procedure Handle_Interface (Interface_Tag : aliased Wayland_XML.Interface_Tag) is Name : constant String := Xml_Parser_Utils.Adaify_Name (Wayland_XML.Name (Interface_Tag) & "_Interface"); begin if not Generate_Interfaces_For_Client and Protocol_Name = "client" then Put_Line (File, " " & Name & " : aliased constant Interface_T"); Put_Line (File, " with Import, Convention => C, External_Name => """ & Wayland_XML.Name (Interface_Tag) & "_interface"";"); New_Line (File); else Put_Line (File, " " & Name & " : aliased constant Interface_T;"); end if; end Handle_Interface; begin Iterate_Over_Interfaces (Handle_Interface'Access); end Generate_Code_For_Interface_Constants; procedure Generate_Private_Code_For_Interface_Constants is type Partial_Match (Is_Match : Boolean) is record case Is_Match is when True => null; when False => Index : Positive; end case; end record; type Match (Is_Match : Boolean) is record case Is_Match is when False => null; when True => Index : Positive; end case; end record; function Contains_At_Index (Index : Positive; Vector, Sub_Vector : Unbounded_String_Vectors.Vector) return Partial_Match is use type SU.Unbounded_String; begin for Sub_Index in Sub_Vector.First_Index .. Sub_Vector.Last_Index loop declare Vector_Index : constant Positive := Index + (Sub_Index - Sub_Vector.First_Index); begin if Vector_Index > Vector.Last_Index or else Sub_Vector (Sub_Index) /= Vector (Vector_Index) then return (Is_Match => False, Index => Sub_Index); end if; end; end loop; return (Is_Match => True); end Contains_At_Index; procedure Append_To_Vector (Vector : in out Unbounded_String_Vectors.Vector; Sub_Vector : Unbounded_String_Vectors.Vector) is Search_Index : Unbounded_String_Vectors.Extended_Index := Vector.First_Index; Index : Unbounded_String_Vectors.Extended_Index; begin loop Index := Vector.Find_Index (Sub_Vector.First_Element, Search_Index); if Index = Unbounded_String_Vectors.No_Index then Vector.Append (Sub_Vector); exit; else declare Result : constant Partial_Match := Contains_At_Index (Index, Vector, Sub_Vector); begin case Result.Is_Match is when False => if Result.Index - Sub_Vector.First_Index + Index - 1 = Vector.Last_Index then -- Append remaining items of Sub_Vector to Vector declare Remaining_Vector : Unbounded_String_Vectors.Vector := Sub_Vector; begin Remaining_Vector.Delete_First (Count => Ada.Containers.Count_Type (Result.Index - Sub_Vector.First_Index)); Vector.Append (Remaining_Vector); end; exit; end if; when True => exit; end case; end; end if; if Index >= Vector.Last_Index then Vector.Append (Sub_Vector); exit; end if; Search_Index := Index + 1; end loop; end Append_To_Vector; function Find_Match (Vector : Unbounded_String_Vectors.Vector; Sub_Vector : Unbounded_String_Vectors.Vector) return Match is Search_Index : Unbounded_String_Vectors.Extended_Index := Vector.First_Index; Index : Unbounded_String_Vectors.Extended_Index; begin loop Index := Vector.Find_Index (Sub_Vector.First_Element, Search_Index); if Index = Unbounded_String_Vectors.No_Index then return (Is_Match => False); else declare Result : constant Partial_Match := Contains_At_Index (Index, Vector, Sub_Vector); begin case Result.Is_Match is when False => if Result.Index - Sub_Vector.First_Index + Index - 1 = Vector.Last_Index then return (Is_Match => False); end if; when True => return (Is_Match => True, Index => Index); end case; end; end if; if Index >= Vector.Last_Index then return (Is_Match => False); end if; Search_Index := Index + 1; end loop; end Find_Match; function Get_Types (Request_Tag : aliased Wayland_XML.Request_Tag) return Unbounded_String_Vectors.Vector is Result : Unbounded_String_Vectors.Vector; begin for Child of Children (Request_Tag) loop if Child.Kind_Id = Child_Arg then case Type_Attribute (Child.Arg_Tag.all) is when Type_New_Id | Type_Object => if not Wayland_XML.Exists_Interface_Attribute (Child.Arg_Tag.all) then -- raise XML_Exception with Put_Line ("Request " & Name (Request_Tag) & ": " & "Argument of type 'object' or 'new_id' has no attribute 'interface'"); Result.Append (+""); Result.Append (+""); Result.Append (+""); else Result.Append (+Wayland_XML.Interface_Attribute (Child.Arg_Tag.all)); end if; when others => Result.Append (+""); end case; end if; end loop; return Result; end Get_Types; function Get_Types (Event_Tag : aliased Wayland_XML.Event_Tag) return Unbounded_String_Vectors.Vector is Result : Unbounded_String_Vectors.Vector; begin for Child of Children (Event_Tag) loop if Child.Kind_Id = Child_Arg then case Type_Attribute (Child.Arg_Tag.all) is when Type_New_Id | Type_Object => if not Wayland_XML.Exists_Interface_Attribute (Child.Arg_Tag.all) then -- raise XML_Exception with Put_Line ("Event " & Name (Event_Tag) & ": " & "Argument of type 'object' or 'new_id' has no attribute 'interface'"); Result.Append (+""); Result.Append (+""); Result.Append (+""); else Result.Append (+Wayland_XML.Interface_Attribute (Child.Arg_Tag.all)); end if; when others => Result.Append (+""); end case; end if; end loop; return Result; end Get_Types; procedure Append_Argument (Signature : in out SU.Unbounded_String; Argument : Wayland_XML.Arg_Tag) is begin if Wayland_XML.Exists_Allow_Null (Argument) and then Wayland_XML.Allow_Null (Argument) then SU.Append (Signature, "?"); end if; case Type_Attribute (Argument) is when Type_Integer => SU.Append (Signature, "i"); when Type_Unsigned_Integer => SU.Append (Signature, "u"); when Type_String => SU.Append (Signature, "s"); when Type_FD => SU.Append (Signature, "h"); when Type_New_Id => -- TODO For Type_Object as well if no interface attribute exists? if not Wayland_XML.Exists_Interface_Attribute (Argument) then SU.Append (Signature, "su"); end if; SU.Append (Signature, "n"); when Type_Object => SU.Append (Signature, "o"); when Type_Fixed => SU.Append (Signature, "f"); when Type_Array => SU.Append (Signature, "a"); end case; end Append_Argument; function Signature_To_String (Signature : SU.Unbounded_String) return String is (if SU.Length (Signature) > 0 then """" & (+Signature) & """" else "Nul"); procedure Handle_Interface (Interface_Tag : aliased Wayland_XML.Interface_Tag) is Wayland_Interface_Name : constant String := Wayland_XML.Name (Interface_Tag); Interface_Name : constant String := Xml_Parser_Utils.Adaify_Name (Wayland_Interface_Name); Request_Count : Natural := 0; Event_Count : Natural := 0; procedure Handle_Request_Name (Request_Tag : aliased Wayland_XML.Request_Tag) is Wayland_Name : constant String := Wayland_XML.Name (Request_Tag); Name : constant String := Xml_Parser_Utils.Adaify_Name (Wayland_Name); begin Put_Line (File, " " & Interface_Name & "_" & Name & "_Name : aliased char_array := " & """" & Wayland_Name & """ & Nul;"); end Handle_Request_Name; procedure Handle_Request_Type (Request_Tag : aliased Wayland_XML.Request_Tag) is Name : constant String := Xml_Parser_Utils.Adaify_Name (Wayland_XML.Name (Request_Tag)); Signature : SU.Unbounded_String; Types : Unbounded_String_Vectors.Vector := Get_Types (Request_Tag); begin if Wayland_XML.Exists_Since (Request_Tag) then SU.Append (Signature, Aida.To_String (Positive (Wayland_XML.Since (Request_Tag)))); end if; for Child of Children (Request_Tag) loop if Child.Kind_Id = Child_Arg then Append_Argument (Signature, Child.Arg_Tag.all); end if; end loop; if Types.Length = 0 then Types.Append (+""); end if; -- Append Types to All_Types if Types is not a subset of All_Types Append_To_Vector (All_Types, Types); Put_Line (File, " " & Interface_Name & "_" & Name & "_Type : aliased char_array := " & Signature_To_String (Signature) & " & Nul;"); end Handle_Request_Type; procedure Handle_Event_Name (Event_Tag : aliased Wayland_XML.Event_Tag) is Wayland_Name : constant String := Wayland_XML.Name (Event_Tag); Name : constant String := Xml_Parser_Utils.Adaify_Name (Wayland_Name); begin Put_Line (File, " " & Interface_Name & "_" & Name & "_Name : aliased char_array := " & """" & Wayland_Name & """ & Nul;"); end Handle_Event_Name; procedure Handle_Event_Type (Event_Tag : aliased Wayland_XML.Event_Tag) is Name : constant String := Xml_Parser_Utils.Adaify_Name (Wayland_XML.Name (Event_Tag)); Signature : SU.Unbounded_String; Types : Unbounded_String_Vectors.Vector := Get_Types (Event_Tag); begin if Wayland_XML.Exists_Since (Event_Tag) then SU.Append (Signature, Aida.To_String (Positive (Wayland_XML.Since (Event_Tag)))); end if; for Child of Children (Event_Tag) loop if Child.Kind_Id = Child_Arg then Append_Argument (Signature, Child.Arg_Tag.all); end if; end loop; if Types.Length = 0 then Types.Append (+""); end if; -- Append Types to All_Types if Types is not a subset of All_Types Append_To_Vector (All_Types, Types); Put_Line (File, " " & Interface_Name & "_" & Name & "_Type : aliased char_array := " & Signature_To_String (Signature) & " & Nul;"); end Handle_Event_Type; begin for Child of Children (Interface_Tag) loop if Child.Kind_Id = Child_Request then Request_Count := Request_Count + 1; end if; end loop; for Child of Children (Interface_Tag) loop if Child.Kind_Id = Child_Event then Event_Count := Event_Count + 1; end if; end loop; if Request_Count > 0 then Put_Line (File, ""); Iterate_Over_Requests (Interface_Tag, Handle_Request_Name'Access); Put_Line (File, ""); Iterate_Over_Requests (Interface_Tag, Handle_Request_Type'Access); end if; if Event_Count > 0 then Put_Line (File, ""); Iterate_Over_Events (Interface_Tag, Handle_Event_Name'Access); Put_Line (File, ""); Iterate_Over_Events (Interface_Tag, Handle_Event_Type'Access); end if; end Handle_Interface; procedure Handle_Interface_2 (Interface_Tag : aliased Wayland_XML.Interface_Tag) is Version : constant String := (if Wayland_XML.Exists_Version (Interface_Tag) then Aida.To_String (Positive (Wayland_XML.Version (Interface_Tag))) else "1"); Wayland_Interface_Name : constant String := Wayland_XML.Name (Interface_Tag); Interface_Name : constant String := Xml_Parser_Utils.Adaify_Name (Wayland_Interface_Name); Name : constant String := Xml_Parser_Utils.Adaify_Name (Wayland_Interface_Name & "_Interface"); Request_Count : Natural := 0; Event_Count : Natural := 0; Request_Index : Positive := 1; Event_Index : Positive := 1; procedure Handle_Request_Tuple (Request_Tag : aliased Wayland_XML.Request_Tag) is Prefix : constant String := (if Request_Count = 1 then "(1 => " elsif Request_Index = 1 then "(" else " "); Suffix : constant String := (if Request_Index = Request_Count then ");" else ","); Name : constant String := Xml_Parser_Utils.Adaify_Name (Wayland_XML.Name (Request_Tag)); Name_String : constant String := Interface_Name & "_" & Name & "_Name"; Type_String : constant String := Interface_Name & "_" & Name & "_Type"; Types : Unbounded_String_Vectors.Vector := Get_Types (Request_Tag); begin if Types.Length = 0 then Types.Append (+""); end if; declare Index_Match : constant Match := Find_Match (All_Types, Types); pragma Assert (Index_Match.Is_Match); begin Put_Line (File, " " & Prefix & "(" & Name_String & "'Access,"); Put_Line (File, " " & " " & Type_String & "'Access,"); Put_Line (File, " " & " " & "Interface_Pointers (" & Trim (Index_Match.Index'Image) & ")'Access)" & Suffix); end; Request_Index := Request_Index + 1; end Handle_Request_Tuple; procedure Handle_Event_Tuple (Event_Tag : aliased Wayland_XML.Event_Tag) is Prefix : constant String := (if Event_Count = 1 then "(1 => " elsif Event_Index = 1 then "(" else " "); Suffix : constant String := (if Event_Index = Event_Count then ");" else ","); Name : constant String := Xml_Parser_Utils.Adaify_Name (Wayland_XML.Name (Event_Tag)); Name_String : constant String := Interface_Name & "_" & Name & "_Name"; Type_String : constant String := Interface_Name & "_" & Name & "_Type"; Types : Unbounded_String_Vectors.Vector := Get_Types (Event_Tag); begin if Types.Length = 0 then Types.Append (+""); end if; declare Index_Match : constant Match := Find_Match (All_Types, Types); pragma Assert (Index_Match.Is_Match); begin Put_Line (File, " " & Prefix & "(" & Name_String & "'Access,"); Put_Line (File, " " & " " & Type_String & "'Access,"); Put_Line (File, " " & " " & "Interface_Pointers (" & Trim (Index_Match.Index'Image) & ")'Access)" & Suffix); end; Event_Index := Event_Index + 1; end Handle_Event_Tuple; begin for Child of Children (Interface_Tag) loop if Child.Kind_Id = Child_Request then Request_Count := Request_Count + 1; end if; end loop; for Child of Children (Interface_Tag) loop if Child.Kind_Id = Child_Event then Event_Count := Event_Count + 1; end if; end loop; if Request_Count > 0 then Put_Line (File, ""); Put_Line (File, " " & Interface_Name & "_Requests : aliased constant Wayland.API.Message_Array :="); Iterate_Over_Requests (Interface_Tag, Handle_Request_Tuple'Access); end if; if Event_Count > 0 then Put_Line (File, ""); Put_Line (File, " " & Interface_Name & "_Events : aliased constant Wayland.API.Message_Array :="); Iterate_Over_Events (Interface_Tag, Handle_Event_Tuple'Access); end if; Put_Line (File, ""); Put_Line (File, " " & Interface_Name & "_Interface_Name : aliased char_array := """ & Wayland_Interface_Name & """ & Nul;"); Put_Line (File, ""); Put_Line (File, " " & Name & " : aliased constant Interface_T :="); Put_Line (File, " (Name => " & Interface_Name & "_Interface_Name'Access,"); Put_Line (File, " Version => " & Version & ","); Put_Line (File, " Method_Count => " & Aida.To_String (Request_Count) & ","); Put_Line (File, " Methods => " & (if Request_Count > 0 then Interface_Name & "_Requests'Access," else "null,")); Put_Line (File, " Event_Count => " & Aida.To_String (Event_Count) & ","); Put_Line (File, " Events => " & (if Event_Count > 0 then Interface_Name & "_Events'Access);" else "null);")); end Handle_Interface_2; begin Put_Line (File, " use Interfaces.C;"); Put_Line (File, ""); Put_Line (File, " Nul : char renames Interfaces.C.nul;"); Iterate_Over_Interfaces (Handle_Interface'Access); Put_Line (File, ""); Put_Line (File, " Interface_Pointers : Wayland.API.Interface_Ptr_Array (1 .." & All_Types.Length'Image & ");"); Iterate_Over_Interfaces (Handle_Interface_2'Access); end Generate_Private_Code_For_Interface_Constants; procedure Generate_Code_For_Interface_Ptrs is procedure Handle_Interface (Interface_Tag : aliased Wayland_XML.Interface_Tag) is Interface_Ptr_Name : constant String := Xml_Parser_Utils.Adaify_Name (Name (Interface_Tag)) & "_Ptr"; begin if Interface_Ptr_Name /= "Display_Ptr" then Put_Line (File, " type " & Interface_Ptr_Name & " is new Proxy_Ptr;"); New_Line (File); end if; end Handle_Interface; begin Iterate_Over_Interfaces (Handle_Interface'Access); end Generate_Code_For_Interface_Ptrs; procedure Generate_Code_For_Each_Interface is procedure Handle_Interface (Interface_Tag : aliased Wayland_XML.Interface_Tag) is procedure Generate_Code_For_Subprogram_Ptrs is procedure Generate_Code_For_Subprogram (Event_Tag : aliased Wayland_XML.Event_Tag) is V : Wayland_XML.Event_Child_Vectors.Vector; Subprogram_Name : constant String := Xml_Parser_Utils.Adaify_Name (Name (Interface_Tag) & "_" & Name (Event_Tag) & "_Subprogram_Ptr"); Interface_Name : constant String := Xml_Parser_Utils.Adaify_Name (Name (Interface_Tag)); begin for Child of Wayland_XML.Children (Event_Tag) loop if Child.Kind_Id = Child_Arg then V.Append (Child); end if; end loop; declare Max_Name_Length : Natural := Interface_Name'Length; Dont_Care : String_Maps.Map; begin for Child of V loop declare Arg_Name : constant String := Xml_Parser_Utils.Adaify_Variable_Name (Name (Child.Arg_Tag.all)); begin Max_Name_Length := Natural'Max (Max_Name_Length, Arg_Name'Length); end; end loop; Put_Line (File, " type " & Subprogram_Name & " is access procedure"); declare Interface_Name_Aligned : constant String := SF.Head (Interface_Name, Max_Name_Length, ' '); begin Put_Line (File, " (" & SF.Head ("Data", Max_Name_Length, ' ') & " : Void_Ptr;"); Put (File, " " & Interface_Name_Aligned & " : " & Interface_Name & "_Ptr"); end; if V.Length = 0 then Put (File, ")"); else Put_Line (File, ";"); end if; for Child of V loop if Child.Kind_Id = Child_Arg then Generate_Code_For_Arg (File, Interface_Tag, Child.Arg_Tag.all, Max_Name_Length, Children (Event_Tag).Last_Element = Child, Dont_Care); end if; end loop; end; New_Line (File); Put_Line (File, " with Convention => C;"); New_Line (File); end Generate_Code_For_Subprogram; begin Iterate_Over_Events (Interface_Tag, Generate_Code_For_Subprogram'Access); end Generate_Code_For_Subprogram_Ptrs; procedure Generate_Code_For_Listener_Type_Definition is function Get_Name (Event_Tag : Wayland_XML.Event_Tag) return String is (Xml_Parser_Utils.Adaify_Name (Name (Event_Tag))); Name_Length : Natural := 0; procedure Generate_Code_For_Record_Component (Event_Tag : aliased Wayland_XML.Event_Tag) is Component_Name : constant String := Get_Name (Event_Tag); Component_Type_Name : constant String := Xml_Parser_Utils.Adaify_Name (Name (Interface_Tag) & "_" & Name (Event_Tag) & "_Subprogram_Ptr"); Component_Name_Aligned : constant String := SF.Head (Component_Name & (if Is_Reserved_Keyword (Component_Name) then "_F" else ""), Name_Length, ' '); begin Put_Line (File, " " & Component_Name_Aligned & " : " & Component_Type_Name & ";"); end Generate_Code_For_Record_Component; Name : constant String := Xml_Parser_Utils.Adaify_Name (Wayland_XML.Name (Interface_Tag) & "_Listener_T"); Ptr_Name : constant String := Xml_Parser_Utils.Adaify_Name (Wayland_XML.Name (Interface_Tag) & "_Listener_Ptr"); begin Put_Line (File, " type " & Name & " is record"); for Child of Children (Interface_Tag) loop if Child.Kind_Id = Child_Event then declare Arg_Name : constant String := Get_Name (Child.Event_Tag.all); begin Name_Length := Natural'Max (Name_Length, Arg_Name'Length + (if Is_Reserved_Keyword (Arg_Name) then 2 else 0)); end; end if; end loop; Iterate_Over_Events (Interface_Tag, Generate_Code_For_Record_Component'Access); Put_Line (File, " end record"); Put_Line (File, " with Convention => C_Pass_By_Copy;"); Put_Line (File, ""); Put_Line (File, " type " & Ptr_Name & " is access all " & Name & ";"); end Generate_Code_For_Listener_Type_Definition; procedure Generate_Code_For_Add_Listener_Subprogram_Declaration is Ptr_Listener_Name : constant String := Xml_Parser_Utils.Adaify_Name (Wayland_XML.Name (Interface_Tag) & "_Listener_Ptr"); begin Generate_Pretty_Code_For_Subprogram (File, Declaration, Interface_Tag, "Add_Listener", "Interfaces.C.int", ((+"Listener", +Ptr_Listener_Name), (+"Data", +"Void_Ptr"))); end Generate_Code_For_Add_Listener_Subprogram_Declaration; procedure Generate_Code_For_Set_User_Data_Subprogram_Declaration is begin Generate_Pretty_Code_For_Subprogram (File, Declaration, Interface_Tag, "Set_User_Data", "", (1 => (+"Data", +"Void_Ptr"))); end Generate_Code_For_Set_User_Data_Subprogram_Declaration; procedure Generate_Code_For_Get_User_Data_Subprogram_Declaration is begin Generate_Pretty_Code_For_Subprogram (File, Declaration, Interface_Tag, "Get_User_Data", "Void_Ptr"); end Generate_Code_For_Get_User_Data_Subprogram_Declaration; procedure Generate_Code_For_Get_ID_Subprogram_Declaration is begin Generate_Pretty_Code_For_Subprogram (File, Declaration, Interface_Tag, "Get_ID", "Unsigned_32"); end Generate_Code_For_Get_ID_Subprogram_Declaration; procedure Generate_Code_For_Get_Version_Subprogram_Declaration is begin Generate_Pretty_Code_For_Subprogram (File, Declaration, Interface_Tag, "Get_Version", "Unsigned_32"); end Generate_Code_For_Get_Version_Subprogram_Declaration; procedure Generate_Code_For_Destroy_Subprogram_Declaration is begin Generate_Pretty_Code_For_Subprogram (File, Declaration, Interface_Tag, "Destroy", ""); end Generate_Code_For_Destroy_Subprogram_Declaration; procedure Generate_Code_For_Requests is procedure Generate_Code_For_Subprogram_Declaration (Request_Tag : aliased Wayland_XML.Request_Tag) is procedure Generate_Comment (Text : String) is Interval_Identifier : constant Xml_Parser_Utils.Interval_Identifier := Xml_Parser_Utils.Make (Text); begin for Interval of Interval_Identifier.Intervals loop declare Comment : constant String := Trim (Text (Interval.First .. Interval.Last)); begin if Comment'Length > 0 then Put_Line (File, " -- " & Comment); else Put_Line (File, " --"); end if; end; end loop; end Generate_Comment; Request_Name : constant String := Xml_Parser_Utils.Adaify_Name (Name (Request_Tag)); Subprogram_Name : constant String := Xml_Parser_Utils.Adaify_Name (Name (Interface_Tag) & "_" & Request_Name); Name : constant String := Xml_Parser_Utils.Adaify_Name (Wayland_XML.Name (Interface_Tag)); Ptr_Name : constant String := Xml_Parser_Utils.Adaify_Name (Wayland_XML.Name (Interface_Tag) & "_Ptr"); procedure Generate_Pretty_Function_Code (Subprogram_Kind : String; Max_Name_Length : in out Natural; Have_Last : Boolean := True) is V : Wayland_XML.Request_Child_Vectors.Vector; Dont_Care : String_Maps.Map; function Align (Value : String) return String is (SF.Head (Value, Max_Name_Length, ' ')); begin Get_Max_Arg_Length (Request_Tag, V, Max_Name_Length); Put_Line (File, " " & Subprogram_Kind & " " & Subprogram_Name); Put_Line (File, " (" & Align (Name) & " : " & Ptr_Name & ";"); for Child of V loop if Child.Kind_Id = Child_Arg then Generate_Code_For_Arg (File, Interface_Tag, Child.Arg_Tag.all, Max_Name_Length, Have_Last and Child = V.Last_Element, Dont_Care); end if; end loop; end Generate_Pretty_Function_Code; begin Put_Line (File, ""); if Xml_Parser_Utils.Is_New_Id_Argument_Present (Request_Tag) then if Enable_Comments and Exists_Description (Request_Tag) then Generate_Comment (Xml_Parser_Utils.Remove_Tabs (Description (Request_Tag))); end if; if Xml_Parser_Utils.Is_Interface_Specified (Request_Tag) then declare Return_Type : constant String := Xml_Parser_Utils.Adaify_Name (Xml_Parser_Utils.Find_Specified_Interface (Request_Tag) & "_Ptr"); begin if Xml_Parser_Utils.Number_Of_Args (Request_Tag) > 1 then declare Max_Name_Length : Natural := Name'Length; begin Generate_Pretty_Function_Code ("function", Max_Name_Length); end; Put_Line (File, " return " & Return_Type & ";"); else if 27 + Subprogram_Name'Length + Name'Length + Ptr_Name'Length + Return_Type'Length <= Max_Line_Length then Put_Line (File, " function " & Subprogram_Name & " (" & Name & " : " & Ptr_Name & ") return " & Return_Type & ";"); else Put_Line (File, " function " & Subprogram_Name); Put_Line (File, " (" & Name & " : " & Ptr_Name & ") return " & Return_Type & ";"); end if; end if; end; else if Xml_Parser_Utils.Number_Of_Args (Request_Tag) > 1 then declare Max_Name_Length : Natural := Natural'Max (Name'Length, 11); -- TODO Use parameter list in Generate_Pretty_Function_Code function Align (Value : String) return String is (SF.Head (Value, Max_Name_Length, ' ')); begin Generate_Pretty_Function_Code ("function", Max_Name_Length, False); Put_Line (File, " " & Align ("Interface_V") & " : Interface_Ptr;"); Put_Line (File, " " & Align ("New_Id") & " : Unsigned_32) return Proxy_Ptr;"); end; else Put_Line (File, " function " & Subprogram_Name & " (" & Name & " : " & Ptr_Name & ") return Proxy_Ptr;"); end if; end if; elsif Xml_Parser_Utils.Is_Request_Destructor (Request_Tag) then Generate_Pretty_Code_For_Subprogram (File, Declaration, Interface_Tag, Request_Name, ""); else if Enable_Comments and Exists_Description (Request_Tag) then Generate_Comment (Xml_Parser_Utils.Remove_Tabs (Description (Request_Tag))); end if; if Xml_Parser_Utils.Number_Of_Args (Request_Tag) > 0 then declare Max_Name_Length : Natural := Name'Length; begin Generate_Pretty_Function_Code ("procedure", Max_Name_Length); Put_Line (File, ";"); end; else Put_Line (File, " procedure " & Subprogram_Name & " (" & Name & " : " & Ptr_Name & ");"); end if; end if; end Generate_Code_For_Subprogram_Declaration; begin Iterate_Over_Requests (Interface_Tag, Generate_Code_For_Subprogram_Declaration'Access); end Generate_Code_For_Requests; begin Generate_Code_For_Subprogram_Ptrs; if Xml_Parser_Utils.Exists_Any_Event_Tag (Interface_Tag) then Generate_Code_For_Listener_Type_Definition; Put_Line (File, ""); Generate_Code_For_Add_Listener_Subprogram_Declaration; Put_Line (File, ""); end if; Generate_Code_For_Set_User_Data_Subprogram_Declaration; Put_Line (File, ""); Generate_Code_For_Get_User_Data_Subprogram_Declaration; Put_Line (File, ""); Generate_Code_For_Get_ID_Subprogram_Declaration; Put_Line (File, ""); Generate_Code_For_Get_Version_Subprogram_Declaration; if Wayland_XML.Name (Interface_Tag) /= "wl_display" and then Xml_Parser_Utils.Get_Destructor (Interface_Tag) = "" then Put_Line (File, ""); Generate_Code_For_Destroy_Subprogram_Declaration; end if; Generate_Code_For_Requests; New_Line (File); end Handle_Interface; begin Iterate_Over_Interfaces (Handle_Interface'Access); end Generate_Code_For_Each_Interface; begin if Protocol_Name = "client" then Put_Line (File, " subtype Display_Ptr is Wayland.API.Display_Ptr;"); Put_Line (File, ""); Put_Line (File, " function Display_Connect return Display_Ptr;"); Put_Line (File, ""); Put_Line (File, " procedure Display_Disconnect (This : in out Display_Ptr);"); elsif Protocol_Name = "xdg_decoration_unstable_v1" then Put_Line (File, " use Wayland.Protocols.Thin_Xdg_Shell;"); else Put_Line (File, " use Wayland.Protocols.Thin_Client;"); end if; Put_Line (File, ""); Generate_Code_For_Interface_Constants; if Generate_Interfaces_For_Client or Protocol_Name /= "client" then New_Line (File); Put_Line (File, " procedure Initialize;"); New_Line (File); end if; Generate_Code_For_Interface_Ptrs; Generate_Code_For_Each_Interface; if Generate_Interfaces_For_Client or Protocol_Name /= "client" then Put_Line (File, "private"); New_Line (File); Generate_Private_Code_For_Interface_Constants; New_Line (File); end if; end Create_Wl_Thin_Spec_File; procedure Generate_Use_Type_Declarions (Package_Name : String) is procedure Handle_Interface (Interface_Tag : aliased Wayland_XML.Interface_Tag) is Name : constant String := Xml_Parser_Utils.Adaify_Name (Wayland_XML.Name (Interface_Tag)); begin Put_Line (File, " use type Thin." & Name & "_Ptr;"); end Handle_Interface; begin Put_Line (File, " package Thin renames Wayland.Protocols.Thin_" & Package_Name & ";"); Put_Line (File, ""); Iterate_Over_Interfaces (Handle_Interface'Access); end Generate_Use_Type_Declarions; procedure Generate_Manually_Edited_Code_For_Type_Definitions is procedure Handle_Interface (Interface_Tag : aliased Wayland_XML.Interface_Tag) is Name : constant String := Xml_Parser_Utils.Adaify_Name (Wayland_XML.Name (Interface_Tag)); begin Put_Line (File, ""); Put_Line (File, " type " & Name & " is tagged limited record"); Put_Line (File, " Proxy : Thin." & Name & "_Ptr;"); Put_Line (File, " end record;"); -- FIXME add Initialized : Boolean := Thin.Initialize; for Xdg_Wm_Base and Wp_Presentation end Handle_Interface; begin Iterate_Over_Interfaces (Handle_Interface'Access); end Generate_Manually_Edited_Code_For_Type_Definitions; procedure Generate_Private_Code_For_The_Interface_Constants is procedure Handle_Interface (Interface_Tag : aliased Wayland_XML.Interface_Tag) is Name : constant String := Xml_Parser_Utils.Adaify_Name (Wayland_XML.Name (Interface_Tag) & "_Interface"); begin Put_Line (File, ""); Put_Line (File, " " & Name & " : constant Interface_Type :="); Put_Line (File, " (My_Interface => Thin." & Name & "'Access);"); end Handle_Interface; begin Iterate_Over_Interfaces (Handle_Interface'Access); end Generate_Private_Code_For_The_Interface_Constants; begin Create_File; end Create_Wayland_Spec_File; procedure Create_Wayland_Body_File is File : Ada.Text_IO.File_Type; procedure Create_Wl_Thin_Body_File; procedure Generate_Manually_Edited_Code (Protocol_Name : String); procedure Create_File is Protocol_Name : constant String := Get_Protocol_Name (Name (Protocol_Tag.all)); Package_Name : constant String := Xml_Parser_Utils.Adaify_Name (Protocol_Name); begin Ada.Text_IO.Create (File, Ada.Text_IO.Out_File, "wayland-protocols-" & Protocol_Name & ".adb"); -- TODO Do not import System.Address_To_Access_Conversions if -- there are no generic *_Events packages Put_Line (File, "with System.Address_To_Access_Conversions;"); New_Line (File); Put_Line (File, "with Interfaces.C.Strings;"); New_Line (File); if Protocol_Name = "client" then Put_Line (File, "with Wayland.Posix;"); elsif Protocol_Name in "presentation_time" | "relative_pointer_unstable_v1" then Put_Line (File, "with Ada.Unchecked_Conversion;"); Put_Line (File, ""); Put_Line (File, "with Wayland.Protocols.Thin_Client;"); elsif Protocol_Name = "xdg_decoration_unstable_v1" then Put_Line (File, "with Wayland.Protocols.Thin_Xdg_Shell;"); else Put_Line (File, "with Wayland.Protocols.Thin_Client;"); end if; New_Line (File); Put_Line (File, "package body Wayland.Protocols." & Package_Name & " is"); New_Line (File); if Generate_Interfaces_For_Client or Protocol_Name /= "client" then Put_Line (File, " procedure Initialize renames Thin.Initialize;"); Put_Line (File, ""); end if; if Protocol_Name = "client" then Put_Line (File, " package body Constructors is"); Put_Line (File, " function Set_Proxy (Proxy : Secret_Proxy) return Buffer is"); Put_Line (File, " (Proxy => Thin.Buffer_Ptr (Proxy));"); Put_Line (File, ""); Put_Line (File, " function Set_Proxy (Proxy : Secret_Proxy) return Output is"); Put_Line (File, " (Proxy => Thin.Output_Ptr (Proxy));"); Put_Line (File, ""); Put_Line (File, " function Set_Proxy (Proxy : Secret_Proxy) return Surface is"); Put_Line (File, " (Proxy => Thin.Surface_Ptr (Proxy));"); Put_Line (File, " end Constructors;"); Put_Line (File, ""); end if; Generate_Manually_Edited_Code (Protocol_Name); Put_Line (File, "end Wayland.Protocols." & Package_Name & ";"); Ada.Text_IO.Close (File); ----------------------------------------------------------------------- Ada.Text_IO.Create (File, Ada.Text_IO.Out_File, "wayland-protocols-thin_" & Protocol_Name & ".adb"); Put_Line (File, "with Ada.Unchecked_Conversion;"); Put_Line (File, ""); Put_Line (File, "package body Wayland.Protocols.Thin_" & Package_Name & " is"); Put_Line (File, ""); if Generate_Interfaces_For_Client or Protocol_Name /= "client" then Put_Line (File, " procedure Initialize is"); Put_Line (File, " begin"); Put_Line (File, " Interface_Pointers :="); for Index in All_Types.First_Index .. All_Types.Last_Index loop declare Value : constant String := +All_Types (Index); Prefix : constant String := (if Index = All_Types.First_Index then "(" else " "); Suffix : constant String := (if Index = All_Types.Last_Index then ");" else ","); begin Put_Line (File, " " & Prefix & (if Value'Length > 0 then Xml_Parser_Utils.Adaify_Name (Value) & "_Interface'Access" else "null") & Suffix); end; end loop; Put_Line (File, " end Initialize;"); Put_Line (File, ""); end if; Put (File, " package Constants is"); Generate_Code_For_Numeric_Constants (File); Put_Line (File, " end Constants;"); Put_Line (File, ""); Put_Line (File, " use type Proxy_Ptr;"); if Protocol_Name = "client" then Put_Line (File, ""); Put_Line (File, " function Display_Connect return Display_Ptr is"); Put_Line (File, " begin"); Put_Line (File, " return Wayland.API.Display_Connect (Interfaces.C.Strings.Null_Ptr);"); Put_Line (File, " end Display_Connect;"); Put_Line (File, ""); Put_Line (File, " procedure Display_Disconnect (This : in out Display_Ptr) is"); Put_Line (File, " use type Wayland.API.Display_Ptr;"); Put_Line (File, " begin"); Put_Line (File, " if This /= null then"); Put_Line (File, " Wayland.API.Display_Disconnect (This);"); Put_Line (File, " This := null;"); Put_Line (File, " end if;"); Put_Line (File, " end Display_Disconnect;"); end if; Create_Wl_Thin_Body_File; Put_Line (File, ""); Put_Line (File, "end Wayland.Protocols.Thin_" & Package_Name & ";"); Ada.Text_IO.Close (File); end Create_File; procedure Create_Wl_Thin_Body_File is procedure Generate_Code_For_Protocol_Tag_Children is procedure Handle_Interface (Interface_Tag : aliased Wayland_XML.Interface_Tag) is procedure Generate_Code_For_Add_Listener_Subprogram_Implementations (Name : String) is Ptr_Listener_Name : constant String := Name & "_Listener_Ptr"; begin Generate_Pretty_Code_For_Subprogram (File, Implementation, Interface_Tag, "Add_Listener", "Interfaces.C.int", ((+"Listener", +Ptr_Listener_Name), (+"Data", +"Void_Ptr"))); Put_Line (File, " begin"); Put_Line (File, " return Wayland.API.Proxy_Add_Listener"); Put_Line (File, " (" & Name & ".all, Listener.all'Address, Data);"); Put_Line (File, " end " & Name & "_Add_Listener;"); end Generate_Code_For_Add_Listener_Subprogram_Implementations; procedure Generate_Code_For_Set_User_Data_Subprogram_Implementations (Name : String) is begin Generate_Pretty_Code_For_Subprogram (File, Implementation, Interface_Tag, "Set_User_Data", "", (1 => (+"Data", +"Void_Ptr"))); Put_Line (File, " begin"); Put_Line (File, " Wayland.API.Proxy_Set_User_Data (" & Name & ".all, Data);"); Put_Line (File, " end " & Name & "_Set_User_Data;"); end Generate_Code_For_Set_User_Data_Subprogram_Implementations; procedure Generate_Code_For_Get_User_Data_Subprogram_Implementations (Name : String) is begin Generate_Pretty_Code_For_Subprogram (File, Implementation, Interface_Tag, "Get_User_Data", "Void_Ptr"); Put_Line (File, " begin"); Put_Line (File, " return Wayland.API.Proxy_Get_User_Data (" & Name & ".all);"); Put_Line (File, " end " & Name & "_Get_User_Data;"); end Generate_Code_For_Get_User_Data_Subprogram_Implementations; procedure Generate_Code_For_Get_ID_Subprogram_Implementations (Name : String) is begin Generate_Pretty_Code_For_Subprogram (File, Implementation, Interface_Tag, "Get_ID", "Unsigned_32"); Put_Line (File, " begin"); Put_Line (File, " return Wayland.API.Proxy_Get_Id (" & Name & ".all);"); Put_Line (File, " end " & Name & "_Get_ID;"); end Generate_Code_For_Get_ID_Subprogram_Implementations; procedure Generate_Code_For_Get_Version_Subprogram_Implementations (Name : String) is begin Generate_Pretty_Code_For_Subprogram (File, Implementation, Interface_Tag, "Get_Version", "Unsigned_32"); Put_Line (File, " begin"); Put_Line (File, " return Wayland.API.Proxy_Get_Version (" & Name & ".all);"); Put_Line (File, " end " & Name & "_Get_Version;"); end Generate_Code_For_Get_Version_Subprogram_Implementations; procedure Generate_Code_For_Destroy_Subprogram_Implementations (Name : String) is begin Generate_Pretty_Code_For_Subprogram (File, Implementation, Interface_Tag, "Destroy", ""); Put_Line (File, " begin"); Put_Line (File, " Wayland.API.Proxy_Destroy (" & Name & ".all);"); Put_Line (File, " end " & Name & "_Destroy;"); end Generate_Code_For_Destroy_Subprogram_Implementations; procedure Generate_Code_For_Requests is procedure Generate_Code_For_Subprogram_Implementation (Request_Tag : aliased Wayland_XML.Request_Tag) is Request_Name : constant String := Xml_Parser_Utils.Adaify_Name (Name (Request_Tag)); Subprogram_Name : constant String := Xml_Parser_Utils.Adaify_Name (Name (Interface_Tag) & "_" & Request_Name); Opcode : constant String := "Constants." & Subprogram_Name; Name : constant String := Xml_Parser_Utils.Adaify_Name (Wayland_XML.Name (Interface_Tag)); Ptr_Name : constant String := Xml_Parser_Utils.Adaify_Name (Wayland_XML.Name (Interface_Tag) & "_Ptr"); procedure Generate_Arguments (Spaces : Natural; Null_Id : Boolean) is use SF; function Get_Value (Child : Wayland_XML.Arg_Tag; Value : String) return String is (if Exists_Enum (Child) then "Convert (" & Value & ")" else Value); First_Element : Boolean := True; begin for Child of Children (Request_Tag) loop if Child.Kind_Id = Child_Arg then if not First_Element then Put_Line (File, ","); end if; First_Element := False; if Type_Attribute (Child.Arg_Tag.all) /= Type_Object then if Type_Attribute (Child.Arg_Tag.all) = Type_New_Id then if Null_Id then Put (File, Spaces * " " & "0"); end if; else Put (File, Spaces * " " & Get_Value (Child.Arg_Tag.all, Xml_Parser_Utils.Adaify_Variable_Name (Wayland_XML.Name (Child.Arg_Tag.all)))); end if; else Put (File, Spaces * " " & "Proxy_Ptr (" & Get_Value (Child.Arg_Tag.all, Xml_Parser_Utils.Adaify_Variable_Name (Wayland_XML.Name (Child.Arg_Tag.all))) & ")"); end if; end if; end loop; end Generate_Arguments; procedure Generate_Code_Before_Arguments is Interface_Name : constant String := Xml_Parser_Utils.Adaify_Name (Xml_Parser_Utils.Find_Specified_Interface (Request_Tag)) & "_Interface"; begin Put_Line (File, " P : constant Proxy_Ptr :="); Put_Line (File, " Wayland.API.Proxy_Marshal_Constructor"); Put_Line (File, " (" & Name & ".all,"); Put_Line (File, " " & Opcode & ","); Put_Line (File, " " & Interface_Name & "'Access,"); end Generate_Code_Before_Arguments; procedure Generate_Code_After_Arguments is begin Put_Line (File, ");"); Put_Line (File, " begin"); Put_Line (File, " return (if P /= null then P.all'Access else null);"); Put_Line (File, " end " & Subprogram_Name & ";"); end Generate_Code_After_Arguments; Enum_Types : String_Maps.Map; procedure Generate_Conversion_Code_For_Args is procedure Generate_Convert (Cursor : String_Maps.Cursor) is From : constant String := String_Maps.Key (Cursor); To : constant String := String_Maps.Element (Cursor); begin Put_Line (File, " function Convert is new Ada.Unchecked_Conversion"); Put_Line (File, " (" & From & ", " & To & ");"); end Generate_Convert; begin Enum_Types.Iterate (Generate_Convert'Access); end Generate_Conversion_Code_For_Args; V : Wayland_XML.Request_Child_Vectors.Vector; Max_Name_Length : Natural := Name'Length; function Align (Value : String) return String is (SF.Head (Value, Max_Name_Length, ' ')); begin Put_Line (File, ""); if Xml_Parser_Utils.Is_New_Id_Argument_Present (Request_Tag) then if Xml_Parser_Utils.Is_Interface_Specified (Request_Tag) then declare Return_Type : constant String := Xml_Parser_Utils.Adaify_Name (Xml_Parser_Utils.Find_Specified_Interface (Request_Tag) & "_Ptr"); begin Get_Max_Arg_Length (Request_Tag, V, Max_Name_Length); if Xml_Parser_Utils.Number_Of_Args (Request_Tag) > 1 then Put_Line (File, " function " & Subprogram_Name); Put_Line (File, " (" & Align (Name) & " : " & Ptr_Name & ";"); for Child of V loop if Child.Kind_Id = Child_Arg then Generate_Code_For_Arg (File, Interface_Tag, Child.Arg_Tag.all, Max_Name_Length, Child = V.Last_Element, Enum_Types); end if; end loop; Put_Line (File, " return " & Return_Type); Put_Line (File, " is"); Generate_Conversion_Code_For_Args; if not Enum_Types.Is_Empty then Put_Line (File, ""); end if; else if 27 + Subprogram_Name'Length + Name'Length + Ptr_Name'Length + Return_Type'Length <= Max_Line_Length then Put_Line (File, " function " & Subprogram_Name & " (" & Name & " : " & Ptr_Name & ") return " & Return_Type & " is"); else Put_Line (File, " function " & Subprogram_Name); Put_Line (File, " (" & Name & " : " & Ptr_Name & ") return " & Return_Type); Put_Line (File, " is"); end if; end if; Generate_Code_Before_Arguments; Generate_Arguments (11, True); Generate_Code_After_Arguments; end; else if Xml_Parser_Utils.Number_Of_Args (Request_Tag) > 1 then Max_Name_Length := Natural'Max (11, Name'Length); Get_Max_Arg_Length (Request_Tag, V, Max_Name_Length); Put_Line (File, " function " & Subprogram_Name); Put_Line (File, " (" & Align (Name) & " : " & Ptr_Name & ";"); for Child of V loop if Child.Kind_Id = Child_Arg then Generate_Code_For_Arg (File, Interface_Tag, Child.Arg_Tag.all, Max_Name_Length, False, Enum_Types); end if; end loop; Put_Line (File, " " & Align ("Interface_V") & " : Interface_Ptr;"); Put (File, " " & Align ("New_Id") & " : Unsigned_32) return Proxy_Ptr"); if Enum_Types.Is_Empty then Put_Line (File, " is"); else Put_Line (File, ""); Put_Line (File, "is"); Generate_Conversion_Code_For_Args; end if; Put_Line (File, " begin"); Put_Line (File, " return Wayland.API.Proxy_Marshal_Constructor_Versioned"); Put_Line (File, " (" & Name & ".all,"); Put_Line (File, " " & Opcode & ","); Put_Line (File, " Interface_V,"); Put_Line (File, " New_Id,"); Generate_Arguments (9, False); Put_Line (File, " Interface_V.Name,"); Put_Line (File, " New_Id,"); Put_Line (File, " 0);"); Put_Line (File, " end " & Subprogram_Name & ";"); else Put_Line (File, " function " & Subprogram_Name & " (" & Name & " : " & Ptr_Name & ") return Proxy_Ptr is"); Generate_Code_Before_Arguments; Put (File, " 0"); Generate_Code_After_Arguments; end if; end if; else if Xml_Parser_Utils.Number_Of_Args (Request_Tag) > 0 then Get_Max_Arg_Length (Request_Tag, V, Max_Name_Length); Put_Line (File, " procedure " & Subprogram_Name); Put_Line (File, " (" & Align (Name) & " : " & Ptr_Name & ";"); for Child of V loop if Child.Kind_Id = Child_Arg then Generate_Code_For_Arg (File, Interface_Tag, Child.Arg_Tag.all, Max_Name_Length, Child = Children (Request_Tag).Last_Element, Enum_Types); end if; end loop; if Enum_Types.Is_Empty then Put_Line (File, " is"); else Put_Line (File, ""); Put_Line (File, " is"); Generate_Conversion_Code_For_Args; end if; Put_Line (File, " begin"); Put_Line (File, " Wayland.API.Proxy_Marshal"); Put_Line (File, " (" & Name & ".all,"); Put_Line (File, " " & Opcode & ","); Generate_Arguments (9, False); Put_Line (File, ");"); if Xml_Parser_Utils.Is_Request_Destructor (Request_Tag) then Put_Line (File, ""); Put_Line (File, " Wayland.API.Proxy_Destroy (" & Name & ".all);"); end if; Put_Line (File, " end " & Subprogram_Name & ";"); else Put_Line (File, " procedure " & Subprogram_Name & " (" & Name & " : " & Ptr_Name & ") is"); Put_Line (File, " begin"); Put_Line (File, " Wayland.API.Proxy_Marshal (" & Name & ".all, " & Opcode & ");"); if Xml_Parser_Utils.Is_Request_Destructor (Request_Tag) then Put_Line (File, ""); Put_Line (File, " Wayland.API.Proxy_Destroy (" & Name & ".all);"); end if; Put_Line (File, " end " & Subprogram_Name & ";"); end if; end if; end Generate_Code_For_Subprogram_Implementation; begin Iterate_Over_Requests (Interface_Tag, Generate_Code_For_Subprogram_Implementation'Access); end Generate_Code_For_Requests; Name : constant String := Xml_Parser_Utils.Adaify_Name (Wayland_XML.Name (Interface_Tag)); begin if Xml_Parser_Utils.Exists_Any_Event_Tag (Interface_Tag) then Put_Line (File, ""); Generate_Code_For_Add_Listener_Subprogram_Implementations (Name); end if; Put_Line (File, ""); Generate_Code_For_Set_User_Data_Subprogram_Implementations (Name); Put_Line (File, ""); Generate_Code_For_Get_User_Data_Subprogram_Implementations (Name); Put_Line (File, ""); Generate_Code_For_Get_ID_Subprogram_Implementations (Name); Put_Line (File, ""); Generate_Code_For_Get_Version_Subprogram_Implementations (Name); if Wayland_XML.Name (Interface_Tag) /= "wl_display" and then Xml_Parser_Utils.Get_Destructor (Interface_Tag) = "" then Put_Line (File, ""); Generate_Code_For_Destroy_Subprogram_Implementations (Name); end if; Generate_Code_For_Requests; end Handle_Interface; begin Iterate_Over_Interfaces (Handle_Interface'Access); end Generate_Code_For_Protocol_Tag_Children; begin Generate_Code_For_Protocol_Tag_Children; end Create_Wl_Thin_Body_File; procedure Generate_Manually_Edited_Code (Protocol_Name : String) is procedure Generate_Body_Utility_Functions (Name : String) is begin Put_Line (File, ""); Put_Line (File, " function Get_ID (Object : " & Name & ") return Unsigned_32 is"); Put_Line (File, " (Thin." & Name & "_Get_ID (Object.Proxy));"); Put_Line (File, ""); Put_Line (File, " function Get_Version (Object : " & Name & ") return Unsigned_32 is"); Put_Line (File, " (Thin." & Name & "_Get_Version (Object.Proxy));"); Put_Line (File, ""); Put_Line (File, " function Has_Proxy (Object : " & Name & ") return Boolean is"); Put_Line (File, " (Object.Proxy /= null);"); Put_Line (File, ""); Put_Line (File, " function ""="" (Left, Right : " & Name & "'Class) return Boolean is"); Put_Line (File, " (Left.Proxy = Right.Proxy);"); if Protocol_Name = "client" and Name in "Data_Offer" then Put_Line (File, ""); Put_Line (File, " procedure Move (From, To : in out " & Name & ") is"); Put_Line (File, " begin"); Put_Line (File, " To.Proxy := From.Proxy;"); Put_Line (File, " From.Proxy := null;"); Put_Line (File, " end Move;"); end if; end Generate_Body_Utility_Functions; procedure Generate_Body_Destroy_Subprogram (Interface_Tag : aliased Wayland_XML.Interface_Tag) is Name : constant String := Xml_Parser_Utils.Adaify_Name (Wayland_XML.Name (Interface_Tag)); Destructor_Name : constant String := Xml_Parser_Utils.Get_Destructor (Interface_Tag); Request_Name : constant String := Xml_Parser_Utils.Adaify_Name (if Destructor_Name /= "" then Destructor_Name else "Destroy"); begin Put_Line (File, ""); Put_Line (File, " procedure " & Request_Name & " (Object : in out " & Name & ") is"); Put_Line (File, " begin"); Put_Line (File, " if Object.Proxy /= null then"); Put_Line (File, " Thin." & Name & "_" & Request_Name & " (Object.Proxy);"); Put_Line (File, " Object.Proxy := null;"); Put_Line (File, " end if;"); Put_Line (File, " end " & Request_Name & ";"); end Generate_Body_Destroy_Subprogram; procedure Generate_Body_User_Data_Subprogram (Name : String) is begin Put_Line (File, ""); Put_Line (File, " package body " & Name & "_User_Data is"); Put_Line (File, ""); Put_Line (File, " package Conversion is new System.Address_To_Access_Conversions (Data_Type);"); Put_Line (File, ""); Put_Line (File, " function Set_Data"); Put_Line (File, " (Object : " & Name & "'Class;"); Put_Line (File, " Subject : aliased in out Data_Type) return Call_Result_Code is"); Put_Line (File, " begin"); Put_Line (File, " Thin." & Name & "_Set_User_Data"); Put_Line (File, " (Object.Proxy, Subject'Address);"); Put_Line (File, " return Success;"); Put_Line (File, " end Set_Data;"); Put_Line (File, ""); Put_Line (File, " procedure Set_Data"); Put_Line (File, " (Object : " & Name & "'Class;"); Put_Line (File, " Subject : aliased in out Data_Type)"); Put_Line (File, " is"); Put_Line (File, " Result : constant Call_Result_Code := Set_Data (Object, Subject);"); Put_Line (File, " begin"); Put_Line (File, " pragma Assert (Result = Success);"); Put_Line (File, " end Set_Data;"); Put_Line (File, ""); Put_Line (File, " function Get_Data"); Put_Line (File, " (Object : " & Name & "'Class) return access Data_Type"); Put_Line (File, " is"); Put_Line (File, " Subject_Address : constant Void_Ptr :="); Put_Line (File, " Thin." & Name & "_Get_User_Data (Object.Proxy);"); Put_Line (File, ""); Put_Line (File, " use type Void_Ptr;"); Put_Line (File, " begin"); Put_Line (File, " if Subject_Address /= System.Null_Address then"); Put_Line (File, " return Conversion.To_Pointer (Subject_Address).all'Access;"); Put_Line (File, " else"); Put_Line (File, " return null;"); Put_Line (File, " end if;"); Put_Line (File, " end Get_Data;"); Put_Line (File, ""); Put_Line (File, " end " & Name & "_User_Data;"); end Generate_Body_User_Data_Subprogram; procedure Generate_Body_Bind_Subprogram (Name : String) is begin Put_Line (File, ""); Put_Line (File, " procedure Bind"); Put_Line (File, " (Object : in out " & Name & ";"); Put_Line (File, " Registry : Client.Registry'Class;"); Put_Line (File, " Id : Unsigned_32;"); Put_Line (File, " Version : Unsigned_32)"); Put_Line (File, " is"); Put_Line (File, " Proxy : constant Thin.Proxy_Ptr :="); Put_Line (File, " Thin.Proxy_Ptr (Registry.Bind (" & Name & "_Interface, Id, Version));"); Put_Line (File, " begin"); Put_Line (File, " if Proxy /= null then"); Put_Line (File, " Object.Proxy := Proxy.all'Access;"); Put_Line (File, " end if;"); Put_Line (File, " end Bind;"); end Generate_Body_Bind_Subprogram; procedure Generate_Prefix_Body_Events (Name : String) is begin Put_Line (File, ""); Put_Line (File, " package body " & Name & "_Events is"); Put_Line (File, ""); Put_Line (File, " package Conversion is new System.Address_To_Access_Conversions"); Put_Line (File, " (" & Name & "'Class);"); Put_Line (File, ""); end Generate_Prefix_Body_Events; procedure Generate_Suffix_Body_Events (Name : String) is function Align (Value : String) return String is (SF.Head (Value, Natural'Max (8, Name'Length), ' ')); begin Put_Line (File, " function Subscribe"); Put_Line (File, " (Object : aliased in out " & Name & "'Class) return Call_Result_Code"); Put_Line (File, " is"); Put_Line (File, " I : int;"); Put_Line (File, " begin"); Put_Line (File, " I := Thin." & Name & "_Add_Listener"); Put_Line (File, " (" & Align (Name) & " => Object.Proxy,"); Put_Line (File, " " & Align ("Listener") & " => Listener'Access,"); Put_Line (File, " " & Align ("Data") & " => Object'Address);"); Put_Line (File, " return (if I = 0 then Success else Error);"); Put_Line (File, " end Subscribe;"); Put_Line (File, ""); Put_Line (File, " procedure Subscribe"); Put_Line (File, " (Object : aliased in out " & Name & "'Class)"); Put_Line (File, " is"); Put_Line (File, " Result : constant Call_Result_Code := Subscribe (Object);"); Put_Line (File, " begin"); Put_Line (File, " pragma Assert (Result = Success);"); Put_Line (File, " end Subscribe;"); Put_Line (File, " end " & Name & "_Events;"); end Generate_Suffix_Body_Events; procedure Handle_Interface_Client_Prefix is begin Put_Line (File, ""); Put_Line (File, " function Bind"); Put_Line (File, " (Object : Registry;"); Put_Line (File, " Iface : Interface_Type;"); Put_Line (File, " Id : Unsigned_32;"); Put_Line (File, " Version : Unsigned_32) return Secret_Proxy"); Put_Line (File, " is"); Put_Line (File, " Proxy : constant Thin.Proxy_Ptr :="); Put_Line (File, " Thin.Registry_Bind"); Put_Line (File, " (Registry => Object.Proxy,"); Put_Line (File, " Name => Id,"); Put_Line (File, " Interface_V => Iface.My_Interface,"); Put_Line (File, " New_Id => Version);"); Put_Line (File, " begin"); Put_Line (File, " return Secret_Proxy (Proxy);"); Put_Line (File, " end Bind;"); end Handle_Interface_Client_Prefix; procedure Handle_Interface_Client_Suffix is begin Put_Line (File, ""); Put_Line (File, " procedure Connect (Object : in out Display) is"); Put_Line (File, " begin"); Put_Line (File, " Object.Proxy := Thin.Display_Connect;"); Put_Line (File, ""); Put_Line (File, " if Object.Proxy /= null"); Put_Line (File, " and then Wayland.API.Display_Get_File_Descriptor (Object.Proxy) = -1"); Put_Line (File, " then"); Put_Line (File, " raise Program_Error;"); Put_Line (File, " end if;"); Put_Line (File, " end Connect;"); Put_Line (File, ""); Put_Line (File, " procedure Disconnect (Object : in out Display) is"); Put_Line (File, " begin"); Put_Line (File, " if Object.Proxy /= null then"); Put_Line (File, " Thin.Display_Disconnect (Object.Proxy);"); Put_Line (File, " end if;"); Put_Line (File, " end Disconnect;"); Put_Line (File, ""); Put_Line (File, " function Check_For_Events"); Put_Line (File, " (Object : Display;"); Put_Line (File, " Timeout : Duration;"); Put_Line (File, " Descriptors : File_Descriptor_Array := (1 .. 0 => 0)) return Events_Status_Array"); Put_Line (File, " is"); Put_Line (File, " Descriptor : constant Wayland.File_Descriptor :="); Put_Line (File, " Wayland.API.Display_Get_File_Descriptor (Object.Proxy);"); Put_Line (File, ""); Put_Line (File, " Bits : constant Wayland.Posix.Event_Bits := (Input => True, others => False);"); Put_Line (File, ""); Put_Line (File, " function Get_Events (Descriptors : File_Descriptor_Array)"); Put_Line (File, " return Wayland.Posix.Requested_Event_Array is"); Put_Line (File, " begin"); Put_Line (File, " return Result : Wayland.Posix.Requested_Event_Array (Descriptors'Range) do"); Put_Line (File, " for Index in Result'Range loop"); Put_Line (File, " Result (Index) := (FD => Descriptors (Index), Events => Bits);"); Put_Line (File, " end loop;"); Put_Line (File, " end return;"); Put_Line (File, " end Get_Events;"); Put_Line (File, ""); Put_Line (File, " use type Wayland.Posix.Requested_Event_Array;"); Put_Line (File, ""); Put_Line (File, " Events : constant Wayland.Posix.Returned_Event_Array := Wayland.Posix.Poll"); Put_Line (File, " (Get_Events (Descriptor & Descriptors), Timeout);"); Put_Line (File, " begin"); Put_Line (File, " return Result : Events_Status_Array (Events'Range) do"); Put_Line (File, " for Index in Result'Range loop"); Put_Line (File, " if Events (Index).Is_Success then"); Put_Line (File, " Result (Index) := (if Events (Index).Events.Input then Has_Events else No_Events);"); Put_Line (File, " else"); Put_Line (File, " Result (Index) := Error;"); Put_Line (File, " end if;"); Put_Line (File, " end loop;"); Put_Line (File, " end return;"); Put_Line (File, " end Check_For_Events;"); Put_Line (File, ""); Put_Line (File, " procedure Get_Registry (Object : Display;"); Put_Line (File, " Registry : in out Client.Registry'Class) is"); Put_Line (File, " begin"); Put_Line (File, " Registry.Proxy := Thin.Display_Get_Registry (Object.Proxy);"); Put_Line (File, " end Get_Registry;"); Put_Line (File, ""); Put_Line (File, " function Flush (Object : Display) return Optional_Result is"); Put_Line (File, " Descriptor : constant Wayland.File_Descriptor :="); Put_Line (File, " Wayland.API.Display_Get_File_Descriptor (Object.Proxy);"); Put_Line (File, " begin"); Put_Line (File, " while True loop"); Put_Line (File, " declare"); Put_Line (File, " Result : constant Integer := Wayland.API.Display_Flush (Object.Proxy);"); Put_Line (File, " Error_Again : constant := 11;"); Put_Line (File, " begin"); Put_Line (File, " if Result /= -1 or else Wayland.Posix.Error_Number /= Error_Again then"); Put_Line (File, " if Result /= -1 then"); Put_Line (File, " return (Is_Success => True, Count => Result);"); Put_Line (File, " else"); Put_Line (File, " return (Is_Success => False);"); Put_Line (File, " end if;"); Put_Line (File, " end if;"); Put_Line (File, ""); Put_Line (File, " declare"); Put_Line (File, " Result : constant Wayland.Posix.Returned_Event_Array := Wayland.Posix.Poll"); Put_Line (File, " ((1 => (FD => Descriptor,"); Put_Line (File, " Events => (Output => True, others => False))),"); Put_Line (File, " Timeout => Duration'Last);"); Put_Line (File, " begin"); Put_Line (File, " if Result'Length = 0 or else not Result (Result'First).Is_Success then"); Put_Line (File, " return (Is_Success => False);"); Put_Line (File, " end if;"); Put_Line (File, " end;"); Put_Line (File, " end;"); Put_Line (File, " end loop;"); Put_Line (File, " raise Program_Error;"); Put_Line (File, " end Flush;"); Put_Line (File, ""); Put_Line (File, " procedure Flush (Object : Display) is"); Put_Line (File, " Result : constant Optional_Result := Object.Flush;"); Put_Line (File, " begin"); Put_Line (File, " if not Result.Is_Success then"); Put_Line (File, " raise Program_Error;"); Put_Line (File, " end if;"); Put_Line (File, " end Flush;"); Put_Line (File, ""); Put_Line (File, " function Dispatch (Object : Display) return Optional_Result is"); Put_Line (File, " Result : constant Integer := Wayland.API.Display_Dispatch (Object.Proxy);"); Put_Line (File, " begin"); Put_Line (File, " if Result /= -1 then"); Put_Line (File, " return (Is_Success => True, Count => Result);"); Put_Line (File, " else"); Put_Line (File, " return (Is_Success => False);"); Put_Line (File, " end if;"); Put_Line (File, " end Dispatch;"); Put_Line (File, ""); Put_Line (File, " procedure Dispatch (Object : Display) is"); Put_Line (File, " Result : constant Optional_Result := Object.Dispatch;"); Put_Line (File, " begin"); Put_Line (File, " if not Result.Is_Success then"); Put_Line (File, " raise Program_Error;"); Put_Line (File, " end if;"); Put_Line (File, " end Dispatch;"); Put_Line (File, ""); Put_Line (File, " function Dispatch_Pending (Object : Display) return Optional_Result is"); Put_Line (File, " Result : constant Integer := Wayland.API.Display_Dispatch_Pending (Object.Proxy);"); Put_Line (File, " begin"); Put_Line (File, " if Result /= -1 then"); Put_Line (File, " return (Is_Success => True, Count => Result);"); Put_Line (File, " else"); Put_Line (File, " return (Is_Success => False);"); Put_Line (File, " end if;"); Put_Line (File, " end Dispatch_Pending;"); Put_Line (File, ""); Put_Line (File, " function Prepare_Read (Object : Display) return Call_Result_Code is"); Put_Line (File, " Result : constant Integer := Wayland.API.Display_Prepare_Read (Object.Proxy);"); Put_Line (File, " begin"); Put_Line (File, " return (if Result = 0 then Success else Error);"); Put_Line (File, " end Prepare_Read;"); Put_Line (File, ""); Put_Line (File, " procedure Cancel_Read (Object : Display) is"); Put_Line (File, " begin"); Put_Line (File, " Wayland.API.Display_Cancel_Read (Object.Proxy);"); Put_Line (File, " end Cancel_Read;"); Put_Line (File, ""); Put_Line (File, " function Read_Events (Object : Display) return Call_Result_Code is"); Put_Line (File, " Result : constant Integer"); Put_Line (File, " := Wayland.API.Display_Read_Events (Object.Proxy);"); Put_Line (File, " begin"); Put_Line (File, " return (if Result = 0 then Success else Error);"); Put_Line (File, " end Read_Events;"); Put_Line (File, ""); Put_Line (File, " function Roundtrip (Object : Display) return Integer is"); Put_Line (File, " begin"); Put_Line (File, " return Wayland.API.Display_Roundtrip (Object.Proxy);"); Put_Line (File, " end Roundtrip;"); Put_Line (File, ""); Put_Line (File, " procedure Roundtrip (Object : Display) is"); Put_Line (File, " I : Integer;"); Put_Line (File, " begin"); Put_Line (File, " I := Object.Roundtrip;"); Put_Line (File, " pragma Assert (I /= -1);"); Put_Line (File, " end Roundtrip;"); Put_Line (File, ""); Put_Line (File, " procedure Create_Surface (Object : Compositor;"); Put_Line (File, " Surface : in out Client.Surface'Class) is"); Put_Line (File, " begin"); Put_Line (File, " Surface.Proxy := Thin.Compositor_Create_Surface (Object.Proxy);"); Put_Line (File, " end Create_Surface;"); Put_Line (File, ""); Put_Line (File, " procedure Create_Region (Object : Compositor;"); Put_Line (File, " Region : in out Client.Region'Class) is"); Put_Line (File, " begin"); Put_Line (File, " Region.Proxy := Thin.Compositor_Create_Region (Object.Proxy);"); Put_Line (File, " end Create_Region;"); Put_Line (File, ""); Put_Line (File, " procedure Get_Pointer (Object : Seat;"); Put_Line (File, " Pointer : in out Client.Pointer'Class) is"); Put_Line (File, " begin"); Put_Line (File, " Pointer.Proxy := Thin.Seat_Get_Pointer (Object.Proxy);"); Put_Line (File, " end Get_Pointer;"); Put_Line (File, ""); Put_Line (File, " procedure Get_Keyboard (Object : Seat;"); Put_Line (File, " Keyboard : in out Client.Keyboard'Class) is"); Put_Line (File, " begin"); Put_Line (File, " Keyboard.Proxy := Thin.Seat_Get_Keyboard (Object.Proxy);"); Put_Line (File, " end Get_Keyboard;"); Put_Line (File, ""); Put_Line (File, " procedure Get_Touch (Object : Seat;"); Put_Line (File, " Touch : in out Client.Touch'Class) is"); Put_Line (File, " begin"); Put_Line (File, " Touch.Proxy := Thin.Seat_Get_Touch (Object.Proxy);"); Put_Line (File, " end Get_Touch;"); Put_Line (File, ""); Put_Line (File, " procedure Create_Pool"); Put_Line (File, " (Object : Shm;"); Put_Line (File, " File_Descriptor : Wayland.File_Descriptor;"); Put_Line (File, " Size : Positive;"); Put_Line (File, " Pool : in out Client.Shm_Pool'Class) is"); Put_Line (File, " begin"); Put_Line (File, " Pool.Proxy := Thin.Shm_Create_Pool"); Put_Line (File, " (Object.Proxy,"); Put_Line (File, " File_Descriptor,"); Put_Line (File, " Size);"); Put_Line (File, " end Create_Pool;"); Put_Line (File, ""); Put_Line (File, " procedure Create_Buffer (Object : Shm_Pool;"); Put_Line (File, " Offset : Natural;"); Put_Line (File, " Width : Natural;"); Put_Line (File, " Height : Natural;"); Put_Line (File, " Stride : Natural;"); Put_Line (File, " Format : Shm_Format;"); Put_Line (File, " Buffer : in out Client.Buffer'Class) is"); Put_Line (File, " begin"); Put_Line (File, " Buffer.Proxy := Thin.Shm_Pool_Create_Buffer"); Put_Line (File, " (Object.Proxy, Offset, Width, Height, Stride, Format);"); Put_Line (File, " end Create_Buffer;"); Put_Line (File, ""); Put_Line (File, " procedure Resize (Object : Shm_Pool;"); Put_Line (File, " Size : Positive) is"); Put_Line (File, " begin"); Put_Line (File, " Thin.Shm_Pool_Resize (Object.Proxy, Size);"); Put_Line (File, " end Resize;"); Put_Line (File, ""); Put_Line (File, " procedure Do_Accept (Object : Data_Offer;"); Put_Line (File, " Serial : Unsigned_32;"); Put_Line (File, " Mime_Type : String)"); Put_Line (File, " is"); Put_Line (File, " MT : Interfaces.C.Strings.chars_ptr := Interfaces.C.Strings.New_String (Mime_Type);"); Put_Line (File, " begin"); Put_Line (File, " Thin.Data_Offer_Accept (Object.Proxy, Serial, MT);"); Put_Line (File, " Interfaces.C.Strings.Free (MT);"); Put_Line (File, " end Do_Accept;"); Put_Line (File, ""); Put_Line (File, " procedure Do_Not_Accept (Object : Data_Offer;"); Put_Line (File, " Serial : Unsigned_32) is"); Put_Line (File, " begin"); Put_Line (File, " Thin.Data_Offer_Accept (Object.Proxy, Serial, Interfaces.C.Strings.Null_Ptr);"); Put_Line (File, " end Do_Not_Accept;"); Put_Line (File, ""); Put_Line (File, " procedure Receive (Object : Data_Offer;"); Put_Line (File, " Mime_Type : String;"); Put_Line (File, " File_Descriptor : Wayland.File_Descriptor)"); Put_Line (File, " is"); Put_Line (File, " MT : Interfaces.C.Strings.chars_ptr := Interfaces.C.Strings.New_String (Mime_Type);"); Put_Line (File, " begin"); Put_Line (File, " Thin.Data_Offer_Receive (Object.Proxy, MT, File_Descriptor);"); Put_Line (File, " Interfaces.C.Strings.Free (MT);"); Put_Line (File, " end Receive;"); Put_Line (File, ""); Put_Line (File, " procedure Finish (Object : Data_Offer) is"); Put_Line (File, " begin"); Put_Line (File, " Thin.Data_Offer_Finish (Object.Proxy);"); Put_Line (File, " end Finish;"); Put_Line (File, ""); Put_Line (File, " procedure Set_Actions (Object : Data_Offer;"); Put_Line (File, " Dnd_Actions : Data_Device_Manager_Dnd_Action;"); Put_Line (File, " Preferred_Action : Data_Device_Manager_Dnd_Action) is"); Put_Line (File, " begin"); Put_Line (File, " Thin.Data_Offer_Set_Actions"); Put_Line (File, " (Object.Proxy, Dnd_Actions, Preferred_Action);"); Put_Line (File, " end Set_Actions;"); Put_Line (File, ""); Put_Line (File, " procedure Attach (Object : Surface;"); Put_Line (File, " Buffer : Client.Buffer'Class;"); Put_Line (File, " X, Y : Integer) is"); Put_Line (File, " begin"); Put_Line (File, " Thin.Surface_Attach (Object.Proxy, Buffer.Proxy, X, Y);"); Put_Line (File, " end Attach;"); Put_Line (File, ""); Put_Line (File, " procedure Damage (Object : Surface;"); Put_Line (File, " X, Y : Integer;"); Put_Line (File, " Width : Natural;"); Put_Line (File, " Height : Natural) is"); Put_Line (File, " begin"); Put_Line (File, " Thin.Surface_Damage (Object.Proxy, X, Y, Width, Height);"); Put_Line (File, " end Damage;"); Put_Line (File, ""); Put_Line (File, " procedure Frame (Object : Surface; Subject : in out Callback'Class) is"); Put_Line (File, " begin"); Put_Line (File, " Subject.Proxy := Thin.Surface_Frame (Object.Proxy);"); Put_Line (File, " end Frame;"); Put_Line (File, ""); Put_Line (File, " procedure Set_Opaque_Region (Object : Surface;"); Put_Line (File, " Region : Client.Region'Class) is"); Put_Line (File, " begin"); Put_Line (File, " Thin.Surface_Set_Opaque_Region (Object.Proxy, Region.Proxy);"); Put_Line (File, " end Set_Opaque_Region;"); Put_Line (File, ""); Put_Line (File, " procedure Set_Input_Region (Object : Surface;"); Put_Line (File, " Region : Client.Region'Class) is"); Put_Line (File, " begin"); Put_Line (File, " Thin.Surface_Set_Input_Region (Object.Proxy, Region.Proxy);"); Put_Line (File, ""); Put_Line (File, " end Set_Input_Region;"); Put_Line (File, ""); Put_Line (File, " procedure Commit (Object : Surface) is"); Put_Line (File, " begin"); Put_Line (File, " Thin.Surface_Commit (Object.Proxy);"); Put_Line (File, " end Commit;"); Put_Line (File, ""); Put_Line (File, " procedure Set_Buffer_Transform (Object : Surface;"); Put_Line (File, " Transform : Output_Transform) is"); Put_Line (File, " begin"); Put_Line (File, " Thin.Surface_Set_Buffer_Transform (Object.Proxy, Transform);"); Put_Line (File, " end Set_Buffer_Transform;"); Put_Line (File, ""); Put_Line (File, " procedure Set_Buffer_Scale (Object : Surface;"); Put_Line (File, " Scale : Positive) is"); Put_Line (File, " begin"); Put_Line (File, " Thin.Surface_Set_Buffer_Scale (Object.Proxy, Scale);"); Put_Line (File, " end Set_Buffer_Scale;"); Put_Line (File, ""); Put_Line (File, " procedure Damage_Buffer (Object : Surface;"); Put_Line (File, " X, Y : Integer;"); Put_Line (File, " Width : Natural;"); Put_Line (File, " Height : Natural) is"); Put_Line (File, " begin"); Put_Line (File, " Thin.Surface_Damage_Buffer"); Put_Line (File, " (Object.Proxy, X, Y, Width, Height);"); Put_Line (File, " end Damage_Buffer;"); Put_Line (File, ""); Put_Line (File, " function Sync (Object : Display) return Callback'Class is"); Put_Line (File, " begin"); Put_Line (File, " return Callback : Client.Callback do"); Put_Line (File, " Callback.Proxy := Thin.Display_Sync (Object.Proxy);"); Put_Line (File, " end return;"); Put_Line (File, " end Sync;"); Put_Line (File, ""); Put_Line (File, " procedure Set_Cursor (Object : Pointer;"); Put_Line (File, " Serial : Unsigned_32;"); Put_Line (File, " Surface : Client.Surface'Class;"); Put_Line (File, " Hotspot_X : Integer;"); Put_Line (File, " Hotspot_Y : Integer) is"); Put_Line (File, " begin"); Put_Line (File, " Thin.Pointer_Set_Cursor (Object.Proxy,"); Put_Line (File, " Serial,"); Put_Line (File, " Surface.Proxy,"); Put_Line (File, " Hotspot_X,"); Put_Line (File, " Hotspot_Y);"); Put_Line (File, " end Set_Cursor;"); Put_Line (File, ""); Put_Line (File, " procedure Add (Object : Region;"); Put_Line (File, " X, Y : Integer;"); Put_Line (File, " Width : Natural;"); Put_Line (File, " Height : Natural) is"); Put_Line (File, " begin"); Put_Line (File, " Thin.Region_Add (Object.Proxy, X, Y, Width, Height);"); Put_Line (File, " end Add;"); Put_Line (File, ""); Put_Line (File, " procedure Subtract (Object : Region;"); Put_Line (File, " X, Y : Integer;"); Put_Line (File, " Width : Natural;"); Put_Line (File, " Height : Natural) is"); Put_Line (File, " begin"); Put_Line (File, " Thin.Region_Subtract (Object.Proxy, X, Y, Width, Height);"); Put_Line (File, " end Subtract;"); Put_Line (File, ""); Put_Line (File, " procedure Get_Subsurface"); Put_Line (File, " (Object : Subcompositor;"); Put_Line (File, " Surface : Client.Surface'Class;"); Put_Line (File, " Parent : Client.Surface'Class;"); Put_Line (File, " Subsurface : in out Client.Subsurface'Class) is"); Put_Line (File, " begin"); Put_Line (File, " Subsurface.Proxy :="); Put_Line (File, " Thin.Subcompositor_Get_Subsurface"); Put_Line (File, " (Object.Proxy,"); Put_Line (File, " Surface.Proxy,"); Put_Line (File, " Parent.Proxy);"); Put_Line (File, " end Get_Subsurface;"); Put_Line (File, ""); Put_Line (File, " procedure Set_Position (Object : Subsurface;"); Put_Line (File, " X, Y : Integer) is"); Put_Line (File, " begin"); Put_Line (File, " Thin.Subsurface_Set_Position (Object.Proxy, X, Y);"); Put_Line (File, " end Set_Position;"); Put_Line (File, ""); Put_Line (File, " procedure Place_Above (Object : Subsurface;"); Put_Line (File, " Sibling : Surface'Class) is"); Put_Line (File, " begin"); Put_Line (File, " Thin.Subsurface_Place_Above (Object.Proxy, Sibling.Proxy);"); Put_Line (File, " end Place_Above;"); Put_Line (File, ""); Put_Line (File, " procedure Place_Below (Object : Subsurface;"); Put_Line (File, " Sibling : Surface'Class) is"); Put_Line (File, " begin"); Put_Line (File, " Thin.Subsurface_Place_Below (Object.Proxy, Sibling.Proxy);"); Put_Line (File, " end Place_Below;"); Put_Line (File, ""); Put_Line (File, " procedure Set_Sync (Object : Subsurface) is"); Put_Line (File, " begin"); Put_Line (File, " Thin.Subsurface_Set_Sync (Object.Proxy);"); Put_Line (File, " end Set_Sync;"); Put_Line (File, ""); Put_Line (File, " procedure Set_Desync (Object : Subsurface) is"); Put_Line (File, " begin"); Put_Line (File, " Thin.Subsurface_Set_Desync (Object.Proxy);"); Put_Line (File, " end Set_Desync;"); Put_Line (File, ""); Put_Line (File, " procedure Offer (Object : Data_Source;"); Put_Line (File, " Mime_Type : String)"); Put_Line (File, " is"); Put_Line (File, " MT : Interfaces.C.Strings.chars_ptr := Interfaces.C.Strings.New_String (Mime_Type);"); Put_Line (File, " begin"); Put_Line (File, " Thin.Data_Source_Offer (Object.Proxy, MT);"); Put_Line (File, " Interfaces.C.Strings.Free (MT);"); Put_Line (File, " end Offer;"); Put_Line (File, ""); Put_Line (File, " procedure Set_Actions (Object : Data_Source;"); Put_Line (File, " Dnd_Actions : Data_Device_Manager_Dnd_Action) is"); Put_Line (File, " begin"); Put_Line (File, " Thin.Data_Source_Set_Actions (Object.Proxy, Dnd_Actions);"); Put_Line (File, " end Set_Actions;"); Put_Line (File, ""); Put_Line (File, " procedure Start_Drag (Object : Data_Device;"); Put_Line (File, " Source : Data_Source'class;"); Put_Line (File, " Origin : Surface'class;"); Put_Line (File, " Icon : Surface'class;"); Put_Line (File, " Serial : Unsigned_32) is"); Put_Line (File, " begin"); Put_Line (File, " Thin.Data_Device_Start_Drag (Object.Proxy,"); Put_Line (File, " Source.Proxy,"); Put_Line (File, " Origin.Proxy,"); Put_Line (File, " Icon.Proxy,"); Put_Line (File, " Serial);"); Put_Line (File, " end Start_Drag;"); Put_Line (File, ""); Put_Line (File, " procedure Set_Selection (Object : Data_Device;"); Put_Line (File, " Source : Data_Source'Class;"); Put_Line (File, " Serial : Unsigned_32) is"); Put_Line (File, " begin"); Put_Line (File, " Thin.Data_Device_Set_Selection (Object.Proxy, Source.Proxy, Serial);"); Put_Line (File, " end Set_Selection;"); Put_Line (File, ""); Put_Line (File, " procedure Create_Data_Source (Object : Data_Device_Manager;"); Put_Line (File, " Source : in out Data_Source'Class) is"); Put_Line (File, " begin"); Put_Line (File, " Source.Proxy := Thin.Data_Device_Manager_Create_Data_Source"); Put_Line (File, " (Object.Proxy);"); Put_Line (File, " end Create_Data_Source;"); Put_Line (File, ""); Put_Line (File, " procedure Get_Data_Device (Object : Data_Device_Manager;"); Put_Line (File, " Seat : Client.Seat'Class;"); Put_Line (File, " Device : in out Data_Device'Class) is"); Put_Line (File, " begin"); Put_Line (File, " Device.Proxy := Thin.Data_Device_Manager_Get_Data_Device"); Put_Line (File, " (Object.Proxy, Seat.Proxy);"); Put_Line (File, " end Get_Data_Device;"); end Handle_Interface_Client_Suffix; procedure Handle_Interface_Client (Interface_Tag : aliased Wayland_XML.Interface_Tag) is Name : constant String := Xml_Parser_Utils.Adaify_Name (Wayland_XML.Name (Interface_Tag)); begin if Name in "Compositor" | "Seat" | "Shm" | "Output" | "Data_Device_Manager" then Generate_Body_Bind_Subprogram (Name); end if; end Handle_Interface_Client; procedure Handle_Interface_Events_Client (Interface_Tag : aliased Wayland_XML.Interface_Tag) is Name : constant String := Xml_Parser_Utils.Adaify_Name (Wayland_XML.Name (Interface_Tag)); begin if not Exists_Events (Interface_Tag) then return; end if; Generate_Prefix_Body_Events (Name); if Name = "Display" then Put_Line (File, " procedure Internal_Error"); Put_Line (File, " (Data : Void_Ptr;"); Put_Line (File, " Display : Thin.Display_Ptr;"); Put_Line (File, " Object_Id : Void_Ptr;"); Put_Line (File, " Code : Unsigned_32;"); Put_Line (File, " Message : chars_ptr)"); Put_Line (File, " with Convention => C;"); Put_Line (File, ""); Put_Line (File, " procedure Internal_Delete_Id"); Put_Line (File, " (Data : Void_Ptr;"); Put_Line (File, " Display : Thin.Display_Ptr;"); Put_Line (File, " Id : Unsigned_32)"); Put_Line (File, " with Convention => C;"); Put_Line (File, ""); Put_Line (File, " procedure Internal_Error"); Put_Line (File, " (Data : Void_Ptr;"); Put_Line (File, " Display : Thin.Display_Ptr;"); Put_Line (File, " Object_Id : Void_Ptr;"); Put_Line (File, " Code : Unsigned_32;"); Put_Line (File, " Message : chars_ptr)"); Put_Line (File, " is"); Put_Line (File, " pragma Assert (Conversion.To_Pointer (Data).Proxy = Display);"); Put_Line (File, ""); Put_Line (File, " M : constant String := Interfaces.C.Strings.Value (Message);"); Put_Line (File, " begin"); Put_Line (File, " Error (Conversion.To_Pointer (Data).all, Code, M);"); Put_Line (File, " end Internal_Error;"); Put_Line (File, ""); Put_Line (File, " procedure Internal_Delete_Id"); Put_Line (File, " (Data : Void_Ptr;"); Put_Line (File, " Display : Thin.Display_Ptr;"); Put_Line (File, " Id : Unsigned_32)"); Put_Line (File, " is"); Put_Line (File, " pragma Assert (Conversion.To_Pointer (Data).Proxy = Display);"); Put_Line (File, " begin"); Put_Line (File, " Delete_Id (Conversion.To_Pointer (Data).all, Id);"); Put_Line (File, " end Internal_Delete_Id;"); Put_Line (File, ""); Put_Line (File, " Listener : aliased Thin.Display_Listener_T :="); Put_Line (File, " (Error => Internal_Error'Unrestricted_Access,"); Put_Line (File, " Delete_Id => Internal_Delete_Id'Unrestricted_Access);"); Put_Line (File, ""); elsif Name = "Registry" then Put_Line (File, " procedure Internal_Object_Added"); Put_Line (File, " (Data : Void_Ptr;"); Put_Line (File, " Registry : Thin.Registry_Ptr;"); Put_Line (File, " Id : Unsigned_32;"); Put_Line (File, " Interface_V : chars_ptr;"); Put_Line (File, " Version : Unsigned_32)"); Put_Line (File, " with Convention => C;"); Put_Line (File, ""); Put_Line (File, " procedure Internal_Object_Removed"); Put_Line (File, " (Data : Void_Ptr;"); Put_Line (File, " Registry : Thin.Registry_Ptr;"); Put_Line (File, " Id : Unsigned_32)"); Put_Line (File, " with Convention => C;"); Put_Line (File, ""); Put_Line (File, " procedure Internal_Object_Added"); Put_Line (File, " (Data : Void_Ptr;"); Put_Line (File, " Registry : Thin.Registry_Ptr;"); Put_Line (File, " Id : Unsigned_32;"); Put_Line (File, " Interface_V : chars_ptr;"); Put_Line (File, " Version : Unsigned_32)"); Put_Line (File, " is"); Put_Line (File, " pragma Assert (Conversion.To_Pointer (Data).Proxy = Registry);"); Put_Line (File, " begin"); Put_Line (File, " Global_Object_Added"); Put_Line (File, " (Conversion.To_Pointer (Data).all, Id, Value (Interface_V), Version);"); Put_Line (File, " end Internal_Object_Added;"); Put_Line (File, ""); Put_Line (File, " procedure Internal_Object_Removed"); Put_Line (File, " (Data : Void_Ptr;"); Put_Line (File, " Registry : Thin.Registry_Ptr;"); Put_Line (File, " Id : Unsigned_32)"); Put_Line (File, " is"); Put_Line (File, " pragma Assert (Conversion.To_Pointer (Data).Proxy = Registry);"); Put_Line (File, " begin"); Put_Line (File, " Global_Object_Removed (Conversion.To_Pointer (Data).all, Id);"); Put_Line (File, " end Internal_Object_Removed;"); Put_Line (File, ""); Put_Line (File, " Listener : aliased Thin.Registry_Listener_T :="); Put_Line (File, " (Global => Internal_Object_Added'Unrestricted_Access,"); Put_Line (File, " Global_Remove => Internal_Object_Removed'Unrestricted_Access);"); Put_Line (File, " -- Note: It should be safe to use Unrestricted_Access here since"); Put_Line (File, " -- this generic can only be instantiated at library level"); Put_Line (File, ""); elsif Name = "Callback" then Put_Line (File, " procedure Internal_Done"); Put_Line (File, " (Data : Void_Ptr;"); Put_Line (File, " Callback : Thin.Callback_Ptr;"); Put_Line (File, " Callback_Data : Unsigned_32)"); Put_Line (File, " with Convention => C;"); Put_Line (File, ""); Put_Line (File, " procedure Internal_Done"); Put_Line (File, " (Data : Void_Ptr;"); Put_Line (File, " Callback : Thin.Callback_Ptr;"); Put_Line (File, " Callback_Data : Unsigned_32)"); Put_Line (File, " is"); Put_Line (File, " pragma Assert (Conversion.To_Pointer (Data).Proxy = Callback);"); Put_Line (File, " begin"); Put_Line (File, " Done (Conversion.To_Pointer (Data).all, Callback_Data);"); Put_Line (File, " end Internal_Done;"); Put_Line (File, ""); Put_Line (File, " Listener : aliased Thin.Callback_Listener_T :="); Put_Line (File, " (Done => Internal_Done'Unrestricted_Access);"); Put_Line (File, ""); elsif Name = "Shm" then Put_Line (File, " procedure Internal_Format"); Put_Line (File, " (Data : Void_Ptr;"); Put_Line (File, " Shm : Thin.Shm_Ptr;"); Put_Line (File, " Format : Shm_Format)"); Put_Line (File, " with Convention => C;"); Put_Line (File, ""); Put_Line (File, " procedure Internal_Format"); Put_Line (File, " (Data : Void_Ptr;"); Put_Line (File, " Shm : Thin.Shm_Ptr;"); Put_Line (File, " Format : Shm_Format)"); Put_Line (File, " is"); Put_Line (File, " pragma Assert (Conversion.To_Pointer (Data).Proxy = Shm);"); Put_Line (File, " begin"); Put_Line (File, " Shm_Events.Format"); Put_Line (File, " (Conversion.To_Pointer (Data).all, Format);"); Put_Line (File, " end Internal_Format;"); Put_Line (File, ""); Put_Line (File, " Listener : aliased Thin.Shm_Listener_T :="); Put_Line (File, " (Format => Internal_Format'Unrestricted_Access);"); Put_Line (File, ""); elsif Name = "Buffer" then Put_Line (File, " procedure Internal_Release"); Put_Line (File, " (Data : Void_Ptr;"); Put_Line (File, " Buffer : Thin.Buffer_Ptr)"); Put_Line (File, " with Convention => C;"); Put_Line (File, ""); Put_Line (File, " procedure Internal_Release"); Put_Line (File, " (Data : Void_Ptr;"); Put_Line (File, " Buffer : Thin.Buffer_Ptr)"); Put_Line (File, " is"); Put_Line (File, " pragma Assert (Conversion.To_Pointer (Data).Proxy = Buffer);"); Put_Line (File, " begin"); Put_Line (File, " Release (Conversion.To_Pointer (Data).all);"); Put_Line (File, " end Internal_Release;"); Put_Line (File, ""); Put_Line (File, " Listener : aliased Thin.Buffer_Listener_T :="); Put_Line (File, " (Release => Internal_Release'Unrestricted_Access);"); Put_Line (File, ""); elsif Name = "Data_Offer" then Put_Line (File, " procedure Internal_Offer"); Put_Line (File, " (Data : Void_Ptr;"); Put_Line (File, " Data_Offer : Thin.Data_Offer_Ptr;"); Put_Line (File, " Mime_Type : chars_ptr)"); Put_Line (File, " with Convention => C;"); Put_Line (File, ""); Put_Line (File, " procedure Internal_Source_Actions"); Put_Line (File, " (Data : Void_Ptr;"); Put_Line (File, " Data_Offer : Thin.Data_Offer_Ptr;"); Put_Line (File, " Source_Actions : Data_Device_Manager_Dnd_Action)"); Put_Line (File, " with Convention => C;"); Put_Line (File, ""); Put_Line (File, " procedure Internal_Action"); Put_Line (File, " (Data : Void_Ptr;"); Put_Line (File, " Data_Offer : Thin.Data_Offer_Ptr;"); Put_Line (File, " Dnd_Action : Data_Device_Manager_Dnd_Action)"); Put_Line (File, " with Convention => C;"); Put_Line (File, ""); Put_Line (File, " procedure Internal_Offer"); Put_Line (File, " (Data : Void_Ptr;"); Put_Line (File, " Data_Offer : Thin.Data_Offer_Ptr;"); Put_Line (File, " Mime_Type : chars_ptr)"); Put_Line (File, " is"); Put_Line (File, " O : Client.Data_Offer := (Proxy => Data_Offer);"); Put_Line (File, ""); Put_Line (File, " M : constant String := Interfaces.C.Strings.Value (Mime_Type);"); Put_Line (File, " begin"); Put_Line (File, " Offer (O, M);"); Put_Line (File, " end Internal_Offer;"); Put_Line (File, ""); Put_Line (File, " procedure Internal_Source_Actions"); Put_Line (File, " (Data : Void_Ptr;"); Put_Line (File, " Data_Offer : Thin.Data_Offer_Ptr;"); Put_Line (File, " Source_Actions : Data_Device_Manager_Dnd_Action)"); Put_Line (File, " is"); Put_Line (File, " pragma Assert (Conversion.To_Pointer (Data).Proxy = Data_Offer);"); Put_Line (File, " begin"); Put_Line (File, " Data_Offer_Events.Source_Actions"); Put_Line (File, " (Conversion.To_Pointer (Data).all, Source_Actions);"); Put_Line (File, " end Internal_Source_Actions;"); Put_Line (File, ""); Put_Line (File, " procedure Internal_Action"); Put_Line (File, " (Data : Void_Ptr;"); Put_Line (File, " Data_Offer : Thin.Data_Offer_Ptr;"); Put_Line (File, " Dnd_Action : Data_Device_Manager_Dnd_Action)"); Put_Line (File, " is"); Put_Line (File, " pragma Assert (Conversion.To_Pointer (Data).Proxy = Data_Offer);"); Put_Line (File, " begin"); Put_Line (File, " Action (Conversion.To_Pointer (Data).all, Dnd_Action);"); Put_Line (File, " end Internal_Action;"); Put_Line (File, ""); Put_Line (File, " Listener : aliased Thin.Data_Offer_Listener_T :="); Put_Line (File, " (Offer => Internal_Offer'Unrestricted_Access,"); Put_Line (File, " Source_Actions => Internal_Source_Actions'Unrestricted_Access,"); Put_Line (File, " Action => Internal_Action'Unrestricted_Access);"); Put_Line (File, ""); elsif Name = "Data_Source" then Put_Line (File, " procedure Internal_Target"); Put_Line (File, " (Data : Void_Ptr;"); Put_Line (File, " Data_Source : Thin.Data_Source_Ptr;"); Put_Line (File, " Mime_Type : chars_ptr)"); Put_Line (File, " with Convention => C;"); Put_Line (File, ""); Put_Line (File, " procedure Internal_Send"); Put_Line (File, " (Data : Void_Ptr;"); Put_Line (File, " Data_Source : Thin.Data_Source_Ptr;"); Put_Line (File, " Mime_Type : chars_ptr;"); Put_Line (File, " Fd : File_Descriptor)"); Put_Line (File, " with Convention => C;"); Put_Line (File, ""); Put_Line (File, " procedure Internal_Cancelled"); Put_Line (File, " (Data : Void_Ptr;"); Put_Line (File, " Data_Source : Thin.Data_Source_Ptr)"); Put_Line (File, " with Convention => C;"); Put_Line (File, ""); Put_Line (File, " procedure Internal_Performed"); Put_Line (File, " (Data : Void_Ptr;"); Put_Line (File, " Data_Source : Thin.Data_Source_Ptr)"); Put_Line (File, " with Convention => C;"); Put_Line (File, ""); Put_Line (File, " procedure Internal_Finished"); Put_Line (File, " (Data : Void_Ptr;"); Put_Line (File, " Data_Source : Thin.Data_Source_Ptr)"); Put_Line (File, " with Convention => C;"); Put_Line (File, ""); Put_Line (File, " procedure Internal_Action"); Put_Line (File, " (Data : Void_Ptr;"); Put_Line (File, " Data_Source : Thin.Data_Source_Ptr;"); Put_Line (File, " Dnd_Action : Data_Device_Manager_Dnd_Action)"); Put_Line (File, " with Convention => C;"); Put_Line (File, ""); Put_Line (File, " procedure Internal_Target"); Put_Line (File, " (Data : Void_Ptr;"); Put_Line (File, " Data_Source : Thin.Data_Source_Ptr;"); Put_Line (File, " Mime_Type : chars_ptr)"); Put_Line (File, " is"); Put_Line (File, " pragma Assert (Conversion.To_Pointer (Data).Proxy = Data_Source);"); Put_Line (File, ""); Put_Line (File, " M : constant String := Interfaces.C.Strings.Value (Mime_Type);"); Put_Line (File, " begin"); Put_Line (File, " Target (Conversion.To_Pointer (Data).all, M);"); Put_Line (File, " end Internal_Target;"); Put_Line (File, ""); Put_Line (File, " procedure Internal_Send"); Put_Line (File, " (Data : Void_Ptr;"); Put_Line (File, " Data_Source : Thin.Data_Source_Ptr;"); Put_Line (File, " Mime_Type : chars_ptr;"); Put_Line (File, " Fd : File_Descriptor)"); Put_Line (File, " is"); Put_Line (File, " pragma Assert (Conversion.To_Pointer (Data).Proxy = Data_Source);"); Put_Line (File, ""); Put_Line (File, " M : constant String := Interfaces.C.Strings.Value (Mime_Type);"); Put_Line (File, " begin"); Put_Line (File, " Send (Conversion.To_Pointer (Data).all, M, Fd);"); Put_Line (File, " end Internal_Send;"); Put_Line (File, ""); Put_Line (File, " procedure Internal_Cancelled"); Put_Line (File, " (Data : Void_Ptr;"); Put_Line (File, " Data_Source : Thin.Data_Source_Ptr)"); Put_Line (File, " is"); Put_Line (File, " pragma Assert (Conversion.To_Pointer (Data).Proxy = Data_Source);"); Put_Line (File, " begin"); Put_Line (File, " Cancelled (Conversion.To_Pointer (Data).all);"); Put_Line (File, " end Internal_Cancelled;"); Put_Line (File, ""); Put_Line (File, " procedure Internal_Performed"); Put_Line (File, " (Data : Void_Ptr;"); Put_Line (File, " Data_Source : Thin.Data_Source_Ptr)"); Put_Line (File, " is"); Put_Line (File, " pragma Assert (Conversion.To_Pointer (Data).Proxy = Data_Source);"); Put_Line (File, " begin"); Put_Line (File, " Performed (Conversion.To_Pointer (Data).all);"); Put_Line (File, " end Internal_Performed;"); Put_Line (File, ""); Put_Line (File, " procedure Internal_Finished"); Put_Line (File, " (Data : Void_Ptr;"); Put_Line (File, " Data_Source : Thin.Data_Source_Ptr)"); Put_Line (File, " is"); Put_Line (File, " pragma Assert (Conversion.To_Pointer (Data).Proxy = Data_Source);"); Put_Line (File, " begin"); Put_Line (File, " Finished (Conversion.To_Pointer (Data).all);"); Put_Line (File, " end Internal_Finished;"); Put_Line (File, ""); Put_Line (File, " procedure Internal_Action"); Put_Line (File, " (Data : Void_Ptr;"); Put_Line (File, " Data_Source : Thin.Data_Source_Ptr;"); Put_Line (File, " Dnd_Action : Data_Device_Manager_Dnd_Action)"); Put_Line (File, " is"); Put_Line (File, " pragma Assert (Conversion.To_Pointer (Data).Proxy = Data_Source);"); Put_Line (File, " begin"); Put_Line (File, " Action (Conversion.To_Pointer (Data).all, Dnd_Action);"); Put_Line (File, " end Internal_Action;"); Put_Line (File, ""); Put_Line (File, " Listener : aliased Thin.Data_Source_Listener_T :="); Put_Line (File, " (Target => Internal_Target'Unrestricted_Access,"); Put_Line (File, " Send => Internal_Send'Unrestricted_Access,"); Put_Line (File, " Cancelled => Internal_Cancelled'Unrestricted_Access,"); Put_Line (File, " Dnd_Drop_Performed => Internal_Performed'Unrestricted_Access,"); Put_Line (File, " Dnd_Finished => Internal_Finished'Unrestricted_Access,"); Put_Line (File, " Action => Internal_Action'Unrestricted_Access);"); Put_Line (File, ""); elsif Name = "Data_Device" then Put_Line (File, " procedure Internal_Data_Offer"); Put_Line (File, " (Data : Void_Ptr;"); Put_Line (File, " Data_Device : Thin.Data_Device_Ptr;"); Put_Line (File, " Id : Thin.Data_Offer_Ptr)"); Put_Line (File, " with Convention => C;"); Put_Line (File, ""); Put_Line (File, " procedure Internal_Enter"); Put_Line (File, " (Data : Void_Ptr;"); Put_Line (File, " Data_Device : Thin.Data_Device_Ptr;"); Put_Line (File, " Serial : Unsigned_32;"); Put_Line (File, " Surface : Thin.Surface_Ptr;"); Put_Line (File, " X, Y : Fixed;"); Put_Line (File, " Id : Thin.Data_Offer_Ptr)"); Put_Line (File, " with Convention => C;"); Put_Line (File, ""); Put_Line (File, " procedure Internal_Leave"); Put_Line (File, " (Data : Void_Ptr;"); Put_Line (File, " Data_Device : Thin.Data_Device_Ptr)"); Put_Line (File, " with Convention => C;"); Put_Line (File, ""); Put_Line (File, " procedure Internal_Motion"); Put_Line (File, " (Data : Void_Ptr;"); Put_Line (File, " Data_Device : Thin.Data_Device_Ptr;"); Put_Line (File, " Time : Unsigned_32;"); Put_Line (File, " X, Y : Fixed)"); Put_Line (File, " with Convention => C;"); Put_Line (File, ""); Put_Line (File, " procedure Internal_Drop"); Put_Line (File, " (Data : Void_Ptr;"); Put_Line (File, " Data_Device : Thin.Data_Device_Ptr)"); Put_Line (File, " with Convention => C;"); Put_Line (File, ""); Put_Line (File, " procedure Internal_Selection"); Put_Line (File, " (Data : Void_Ptr;"); Put_Line (File, " Data_Device : Thin.Data_Device_Ptr;"); Put_Line (File, " Id : Thin.Data_Offer_Ptr)"); Put_Line (File, " with Convention => C;"); Put_Line (File, ""); Put_Line (File, " procedure Internal_Data_Offer"); Put_Line (File, " (Data : Void_Ptr;"); Put_Line (File, " Data_Device : Thin.Data_Device_Ptr;"); Put_Line (File, " Id : Thin.Data_Offer_Ptr)"); Put_Line (File, " is"); Put_Line (File, " pragma Assert (Conversion.To_Pointer (Data).Proxy = Data_Device);"); Put_Line (File, ""); Put_Line (File, " Offer : Client.Data_Offer := (Proxy => Id);"); Put_Line (File, " begin"); Put_Line (File, " Data_Offer (Conversion.To_Pointer (Data).all, Offer);"); Put_Line (File, " end Internal_Data_Offer;"); Put_Line (File, ""); Put_Line (File, " procedure Internal_Enter"); Put_Line (File, " (Data : Void_Ptr;"); Put_Line (File, " Data_Device : Thin.Data_Device_Ptr;"); Put_Line (File, " Serial : Unsigned_32;"); Put_Line (File, " Surface : Thin.Surface_Ptr;"); Put_Line (File, " X, Y : Fixed;"); Put_Line (File, " Id : Thin.Data_Offer_Ptr)"); Put_Line (File, " is"); Put_Line (File, " pragma Assert (Conversion.To_Pointer (Data).Proxy = Data_Device);"); Put_Line (File, ""); Put_Line (File, " S : constant Client.Surface := (Proxy => Surface);"); Put_Line (File, " Offer : Client.Data_Offer := (Proxy => Id);"); Put_Line (File, " begin"); Put_Line (File, " Enter (Conversion.To_Pointer (Data).all, Serial, S, X, Y, Offer);"); Put_Line (File, " end Internal_Enter;"); Put_Line (File, ""); Put_Line (File, " procedure Internal_Leave"); Put_Line (File, " (Data : Void_Ptr;"); Put_Line (File, " Data_Device : Thin.Data_Device_Ptr)"); Put_Line (File, " is"); Put_Line (File, " pragma Assert (Conversion.To_Pointer (Data).Proxy = Data_Device);"); Put_Line (File, " begin"); Put_Line (File, " Leave (Conversion.To_Pointer (Data).all);"); Put_Line (File, " end Internal_Leave;"); Put_Line (File, ""); Put_Line (File, " procedure Internal_Motion"); Put_Line (File, " (Data : Void_Ptr;"); Put_Line (File, " Data_Device : Thin.Data_Device_Ptr;"); Put_Line (File, " Time : Unsigned_32;"); Put_Line (File, " X, Y : Fixed)"); Put_Line (File, " is"); Put_Line (File, " pragma Assert (Conversion.To_Pointer (Data).Proxy = Data_Device);"); Put_Line (File, " begin"); Put_Line (File, " Motion (Conversion.To_Pointer (Data).all, Time, X, Y);"); Put_Line (File, " end Internal_Motion;"); Put_Line (File, ""); Put_Line (File, " procedure Internal_Drop"); Put_Line (File, " (Data : Void_Ptr;"); Put_Line (File, " Data_Device : Thin.Data_Device_Ptr)"); Put_Line (File, " is"); Put_Line (File, " pragma Assert (Conversion.To_Pointer (Data).Proxy = Data_Device);"); Put_Line (File, " begin"); Put_Line (File, " Drop (Conversion.To_Pointer (Data).all);"); Put_Line (File, " end Internal_Drop;"); Put_Line (File, ""); Put_Line (File, " procedure Internal_Selection"); Put_Line (File, " (Data : Void_Ptr;"); Put_Line (File, " Data_Device : Thin.Data_Device_Ptr;"); Put_Line (File, " Id : Thin.Data_Offer_Ptr)"); Put_Line (File, " is"); Put_Line (File, " pragma Assert (Conversion.To_Pointer (Data).Proxy = Data_Device);"); Put_Line (File, ""); Put_Line (File, " Offer : Client.Data_Offer := (Proxy => Id);"); Put_Line (File, " begin"); Put_Line (File, " Selection (Conversion.To_Pointer (Data).all, Offer);"); Put_Line (File, " end Internal_Selection;"); Put_Line (File, ""); Put_Line (File, " Listener : aliased Thin.Data_Device_Listener_T"); Put_Line (File, " := (Data_Offer => Internal_Data_Offer'Unrestricted_Access,"); Put_Line (File, " Enter => Internal_Enter'Unrestricted_Access,"); Put_Line (File, " Leave => Internal_Leave'Unrestricted_Access,"); Put_Line (File, " Motion => Internal_Motion'Unrestricted_Access,"); Put_Line (File, " Drop => Internal_Drop'Unrestricted_Access,"); Put_Line (File, " Selection => Internal_Selection'Unrestricted_Access);"); Put_Line (File, ""); elsif Name = "Surface" then Put_Line (File, " procedure Internal_Enter"); Put_Line (File, " (Data : Void_Ptr;"); Put_Line (File, " Surface : Thin.Surface_Ptr;"); Put_Line (File, " Output : Thin.Output_Ptr)"); Put_Line (File, " with Convention => C;"); Put_Line (File, ""); Put_Line (File, " procedure Internal_Leave"); Put_Line (File, " (Data : Void_Ptr;"); Put_Line (File, " Surface : Thin.Surface_Ptr;"); Put_Line (File, " Output : Thin.Output_Ptr)"); Put_Line (File, " with Convention => C;"); Put_Line (File, ""); Put_Line (File, " procedure Internal_Enter"); Put_Line (File, " (Data : Void_Ptr;"); Put_Line (File, " Surface : Thin.Surface_Ptr;"); Put_Line (File, " Output : Thin.Output_Ptr)"); Put_Line (File, " is"); Put_Line (File, " pragma Assert (Conversion.To_Pointer (Data).Proxy = Surface);"); Put_Line (File, ""); Put_Line (File, " O : constant Client.Output := (Proxy => Output);"); Put_Line (File, " begin"); Put_Line (File, " Enter (Conversion.To_Pointer (Data).all, O);"); Put_Line (File, " end Internal_Enter;"); Put_Line (File, ""); Put_Line (File, " procedure Internal_Leave"); Put_Line (File, " (Data : Void_Ptr;"); Put_Line (File, " Surface : Thin.Surface_Ptr;"); Put_Line (File, " Output : Thin.Output_Ptr)"); Put_Line (File, " is"); Put_Line (File, " pragma Assert (Conversion.To_Pointer (Data).Proxy = Surface);"); Put_Line (File, ""); Put_Line (File, " O : constant Client.Output := (Proxy => Output);"); Put_Line (File, " begin"); Put_Line (File, " Leave (Conversion.To_Pointer (Data).all, O);"); Put_Line (File, " end Internal_Leave;"); Put_Line (File, ""); Put_Line (File, " Listener : aliased Thin.Surface_Listener_T"); Put_Line (File, " := (Enter => Internal_Enter'Unrestricted_Access,"); Put_Line (File, " Leave => Internal_Leave'Unrestricted_Access);"); Put_Line (File, ""); elsif Name = "Seat" then Put_Line (File, " procedure Internal_Seat_Capabilities"); Put_Line (File, " (Data : Void_Ptr;"); Put_Line (File, " Seat : Thin.Seat_Ptr;"); Put_Line (File, " Capabilities : Seat_Capability)"); Put_Line (File, " with Convention => C;"); Put_Line (File, ""); Put_Line (File, " procedure Internal_Seat_Name"); Put_Line (File, " (Data : Void_Ptr;"); Put_Line (File, " Seat : Thin.Seat_Ptr;"); Put_Line (File, " Name : Interfaces.C.Strings.chars_ptr)"); Put_Line (File, " with Convention => C;"); Put_Line (File, ""); Put_Line (File, " procedure Internal_Seat_Capabilities"); Put_Line (File, " (Data : Void_Ptr;"); Put_Line (File, " Seat : Thin.Seat_Ptr;"); Put_Line (File, " Capabilities : Seat_Capability)"); Put_Line (File, " is"); Put_Line (File, " pragma Assert (Conversion.To_Pointer (Data).Proxy = Seat);"); Put_Line (File, " begin"); Put_Line (File, " Seat_Capabilities (Conversion.To_Pointer (Data).all, Capabilities);"); Put_Line (File, " end Internal_Seat_Capabilities;"); Put_Line (File, ""); Put_Line (File, " procedure Internal_Seat_Name"); Put_Line (File, " (Data : Void_Ptr;"); Put_Line (File, " Seat : Thin.Seat_Ptr;"); Put_Line (File, " Name : Interfaces.C.Strings.chars_ptr)"); Put_Line (File, " is"); Put_Line (File, " N : constant String := Interfaces.C.Strings.Value (Name);"); Put_Line (File, ""); Put_Line (File, " pragma Assert (Conversion.To_Pointer (Data).Proxy = Seat);"); Put_Line (File, " begin"); Put_Line (File, " Seat_Name (Conversion.To_Pointer (Data).all, N);"); Put_Line (File, " end Internal_Seat_Name;"); Put_Line (File, ""); Put_Line (File, " Listener : aliased Thin.Seat_Listener_T :="); Put_Line (File, " (Capabilities => Internal_Seat_Capabilities'Unrestricted_Access,"); Put_Line (File, " Name => Internal_Seat_Name'Unrestricted_Access);"); Put_Line (File, ""); elsif Name = "Pointer" then Put_Line (File, " procedure Internal_Pointer_Enter"); Put_Line (File, " (Data : Void_Ptr;"); Put_Line (File, " Pointer : Thin.Pointer_Ptr;"); Put_Line (File, " Serial : Unsigned_32;"); Put_Line (File, " Surface : Thin.Surface_Ptr;"); Put_Line (File, " Surface_X : Fixed;"); Put_Line (File, " Surface_Y : Fixed)"); Put_Line (File, " with Convention => C;"); Put_Line (File, ""); Put_Line (File, " procedure Internal_Pointer_Leave"); Put_Line (File, " (Data : Void_Ptr;"); Put_Line (File, " Pointer : Thin.Pointer_Ptr;"); Put_Line (File, " Serial : Unsigned_32;"); Put_Line (File, " Surface : Thin.Surface_Ptr)"); Put_Line (File, " with Convention => C;"); Put_Line (File, ""); Put_Line (File, " procedure Internal_Pointer_Motion"); Put_Line (File, " (Data : Void_Ptr;"); Put_Line (File, " Pointer : Thin.Pointer_Ptr;"); Put_Line (File, " Time : Unsigned_32;"); Put_Line (File, " Surface_X : Fixed;"); Put_Line (File, " Surface_Y : Fixed)"); Put_Line (File, " with Convention => C;"); Put_Line (File, ""); Put_Line (File, " procedure Internal_Pointer_Button"); Put_Line (File, " (Data : Void_Ptr;"); Put_Line (File, " Pointer : Thin.Pointer_Ptr;"); Put_Line (File, " Serial : Unsigned_32;"); Put_Line (File, " Time : Unsigned_32;"); Put_Line (File, " Button : Unsigned_32;"); Put_Line (File, " State : Pointer_Button_State)"); Put_Line (File, " with Convention => C;"); Put_Line (File, ""); Put_Line (File, " procedure Internal_Pointer_Axis"); Put_Line (File, " (Data : Void_Ptr;"); Put_Line (File, " Pointer : Thin.Pointer_Ptr;"); Put_Line (File, " Time : Unsigned_32;"); Put_Line (File, " Axis : Pointer_Axis;"); Put_Line (File, " Value : Fixed)"); Put_Line (File, " with Convention => C;"); Put_Line (File, ""); Put_Line (File, " procedure Internal_Pointer_Frame"); Put_Line (File, " (Data : Void_Ptr;"); Put_Line (File, " Pointer : Thin.Pointer_Ptr)"); Put_Line (File, " with Convention => C;"); Put_Line (File, ""); Put_Line (File, " procedure Internal_Pointer_Axis_Source"); Put_Line (File, " (Data : Void_Ptr;"); Put_Line (File, " Pointer : Thin.Pointer_Ptr;"); Put_Line (File, " Axis_Source : Pointer_Axis_Source)"); Put_Line (File, " with Convention => C;"); Put_Line (File, ""); Put_Line (File, " procedure Internal_Pointer_Axis_Stop"); Put_Line (File, " (Data : Void_Ptr;"); Put_Line (File, " Pointer : Thin.Pointer_Ptr;"); Put_Line (File, " Time : Unsigned_32;"); Put_Line (File, " Axis : Pointer_Axis)"); Put_Line (File, " with Convention => C;"); Put_Line (File, ""); Put_Line (File, " procedure Internal_Pointer_Axis_Discrete"); Put_Line (File, " (Data : Void_Ptr;"); Put_Line (File, " Pointer : Thin.Pointer_Ptr;"); Put_Line (File, " Axis : Pointer_Axis;"); Put_Line (File, " Discrete : Integer)"); Put_Line (File, " with Convention => C;"); Put_Line (File, ""); Put_Line (File, " procedure Internal_Pointer_Enter"); Put_Line (File, " (Data : Void_Ptr;"); Put_Line (File, " Pointer : Thin.Pointer_Ptr;"); Put_Line (File, " Serial : Unsigned_32;"); Put_Line (File, " Surface : Thin.Surface_Ptr;"); Put_Line (File, " Surface_X : Fixed;"); Put_Line (File, " Surface_Y : Fixed)"); Put_Line (File, " is"); Put_Line (File, " pragma Assert (Conversion.To_Pointer (Data).Proxy = Pointer);"); Put_Line (File, ""); Put_Line (File, " S : constant Client.Surface := (Proxy => Surface);"); Put_Line (File, " begin"); Put_Line (File, " Pointer_Enter (Conversion.To_Pointer (Data).all, Serial, S, Surface_X, Surface_Y);"); Put_Line (File, " end Internal_Pointer_Enter;"); Put_Line (File, ""); Put_Line (File, " procedure Internal_Pointer_Leave"); Put_Line (File, " (Data : Void_Ptr;"); Put_Line (File, " Pointer : Thin.Pointer_Ptr;"); Put_Line (File, " Serial : Unsigned_32;"); Put_Line (File, " Surface : Thin.Surface_Ptr)"); Put_Line (File, " is"); Put_Line (File, " pragma Assert (Conversion.To_Pointer (Data).Proxy = Pointer);"); Put_Line (File, ""); Put_Line (File, " S : constant Client.Surface := (Proxy => Surface);"); Put_Line (File, " begin"); Put_Line (File, " Pointer_Leave (Conversion.To_Pointer (Data).all, Serial, S);"); Put_Line (File, " end Internal_Pointer_Leave;"); Put_Line (File, ""); Put_Line (File, " procedure Internal_Pointer_Motion"); Put_Line (File, " (Data : Void_Ptr;"); Put_Line (File, " Pointer : Thin.Pointer_Ptr;"); Put_Line (File, " Time : Unsigned_32;"); Put_Line (File, " Surface_X : Fixed;"); Put_Line (File, " Surface_Y : Fixed)"); Put_Line (File, " is"); Put_Line (File, " pragma Assert (Conversion.To_Pointer (Data).Proxy = Pointer);"); Put_Line (File, " begin"); Put_Line (File, " Pointer_Motion (Conversion.To_Pointer (Data).all, Time, Surface_X, Surface_Y);"); Put_Line (File, " end Internal_Pointer_Motion;"); Put_Line (File, ""); Put_Line (File, " procedure Internal_Pointer_Button"); Put_Line (File, " (Data : Void_Ptr;"); Put_Line (File, " Pointer : Thin.Pointer_Ptr;"); Put_Line (File, " Serial : Unsigned_32;"); Put_Line (File, " Time : Unsigned_32;"); Put_Line (File, " Button : Unsigned_32;"); Put_Line (File, " State : Pointer_Button_State)"); Put_Line (File, " is"); Put_Line (File, " pragma Assert (Conversion.To_Pointer (Data).Proxy = Pointer);"); Put_Line (File, " begin"); Put_Line (File, " Pointer_Button (Conversion.To_Pointer (Data).all, Serial, Time, Button, State);"); Put_Line (File, " end Internal_Pointer_Button;"); Put_Line (File, ""); Put_Line (File, " procedure Internal_Pointer_Axis"); Put_Line (File, " (Data : Void_Ptr;"); Put_Line (File, " Pointer : Thin.Pointer_Ptr;"); Put_Line (File, " Time : Unsigned_32;"); Put_Line (File, " Axis : Pointer_Axis;"); Put_Line (File, " Value : Fixed)"); Put_Line (File, " is"); Put_Line (File, " pragma Assert (Conversion.To_Pointer (Data).Proxy = Pointer);"); Put_Line (File, " begin"); Put_Line (File, " Pointer_Scroll (Conversion.To_Pointer (Data).all, Time, Axis, Value);"); Put_Line (File, " end Internal_Pointer_Axis;"); Put_Line (File, ""); Put_Line (File, " procedure Internal_Pointer_Frame (Data : Void_Ptr;"); Put_Line (File, " Pointer : Thin.Pointer_Ptr)"); Put_Line (File, " is"); Put_Line (File, " pragma Assert (Conversion.To_Pointer (Data).Proxy = Pointer);"); Put_Line (File, " begin"); Put_Line (File, " Pointer_Frame (Conversion.To_Pointer (Data).all);"); Put_Line (File, " end Internal_Pointer_Frame;"); Put_Line (File, ""); Put_Line (File, " procedure Internal_Pointer_Axis_Source"); Put_Line (File, " (Data : Void_Ptr;"); Put_Line (File, " Pointer : Thin.Pointer_Ptr;"); Put_Line (File, " Axis_Source : Pointer_Axis_Source)"); Put_Line (File, " is"); Put_Line (File, " pragma Assert (Conversion.To_Pointer (Data).Proxy = Pointer);"); Put_Line (File, " begin"); Put_Line (File, " Pointer_Scroll_Source (Conversion.To_Pointer (Data).all, Axis_Source);"); Put_Line (File, " end Internal_Pointer_Axis_Source;"); Put_Line (File, ""); Put_Line (File, " procedure Internal_Pointer_Axis_Stop"); Put_Line (File, " (Data : Void_Ptr;"); Put_Line (File, " Pointer : Thin.Pointer_Ptr;"); Put_Line (File, " Time : Unsigned_32;"); Put_Line (File, " Axis : Pointer_Axis)"); Put_Line (File, " is"); Put_Line (File, " pragma Assert (Conversion.To_Pointer (Data).Proxy = Pointer);"); Put_Line (File, " begin"); Put_Line (File, " Pointer_Scroll_Stop (Conversion.To_Pointer (Data).all, Time, Axis);"); Put_Line (File, " end Internal_Pointer_Axis_Stop;"); Put_Line (File, ""); Put_Line (File, " procedure Internal_Pointer_Axis_Discrete"); Put_Line (File, " (Data : Void_Ptr;"); Put_Line (File, " Pointer : Thin.Pointer_Ptr;"); Put_Line (File, " Axis : Pointer_Axis;"); Put_Line (File, " Discrete : Integer)"); Put_Line (File, " is"); Put_Line (File, " pragma Assert (Conversion.To_Pointer (Data).Proxy = Pointer);"); Put_Line (File, " begin"); Put_Line (File, " Pointer_Scroll_Discrete (Conversion.To_Pointer (Data).all, Axis, Discrete);"); Put_Line (File, " end Internal_Pointer_Axis_Discrete;"); Put_Line (File, ""); Put_Line (File, " Listener : aliased Thin.Pointer_Listener_T :="); Put_Line (File, " (Enter => Internal_Pointer_Enter'Unrestricted_Access,"); Put_Line (File, " Leave => Internal_Pointer_Leave'Unrestricted_Access,"); Put_Line (File, " Motion => Internal_Pointer_Motion'Unrestricted_Access,"); Put_Line (File, " Button => Internal_Pointer_Button'Unrestricted_Access,"); Put_Line (File, " Axis => Internal_Pointer_Axis'Unrestricted_Access,"); Put_Line (File, " Frame => Internal_Pointer_Frame'Unrestricted_Access,"); Put_Line (File, " Axis_Source => Internal_Pointer_Axis_Source'Unrestricted_Access,"); Put_Line (File, " Axis_Stop => Internal_Pointer_Axis_Stop'Unrestricted_Access,"); Put_Line (File, " Axis_Discrete => Internal_Pointer_Axis_Discrete'Unrestricted_Access);"); Put_Line (File, ""); elsif Name = "Keyboard" then Put_Line (File, " procedure Internal_Keymap"); Put_Line (File, " (Data : Void_Ptr;"); Put_Line (File, " Keyboard : Thin.Keyboard_Ptr;"); Put_Line (File, " Format : Keyboard_Keymap_Format;"); Put_Line (File, " Fd : File_Descriptor;"); Put_Line (File, " Size : Unsigned_32)"); Put_Line (File, " with Convention => C;"); Put_Line (File, ""); Put_Line (File, " procedure Internal_Enter"); Put_Line (File, " (Data : Void_Ptr;"); Put_Line (File, " Keyboard : Thin.Keyboard_Ptr;"); Put_Line (File, " Serial : Unsigned_32;"); Put_Line (File, " Surface : Thin.Surface_Ptr;"); Put_Line (File, " Keys : Wayland_Array)"); Put_Line (File, " with Convention => C;"); Put_Line (File, ""); Put_Line (File, " procedure Internal_Leave"); Put_Line (File, " (Data : Void_Ptr;"); Put_Line (File, " Keyboard : Thin.Keyboard_Ptr;"); Put_Line (File, " Serial : Unsigned_32;"); Put_Line (File, " Surface : Thin.Surface_Ptr)"); Put_Line (File, " with Convention => C;"); Put_Line (File, ""); Put_Line (File, " procedure Internal_Key"); Put_Line (File, " (Data : Void_Ptr;"); Put_Line (File, " Keyboard : Thin.Keyboard_Ptr;"); Put_Line (File, " Serial : Unsigned_32;"); Put_Line (File, " Time : Unsigned_32;"); Put_Line (File, " Key : Unsigned_32;"); Put_Line (File, " State : Keyboard_Key_State)"); Put_Line (File, " with Convention => C;"); Put_Line (File, ""); Put_Line (File, " procedure Internal_Modifiers"); Put_Line (File, " (Data : Void_Ptr;"); Put_Line (File, " Keyboard : Thin.Keyboard_Ptr;"); Put_Line (File, " Serial : Unsigned_32;"); Put_Line (File, " Mods_Depressed : Unsigned_32;"); Put_Line (File, " Mods_Latched : Unsigned_32;"); Put_Line (File, " Mods_Locked : Unsigned_32;"); Put_Line (File, " Group : Unsigned_32)"); Put_Line (File, " with Convention => C;"); Put_Line (File, ""); Put_Line (File, " procedure Internal_Repeat_Info"); Put_Line (File, " (Data : Void_Ptr;"); Put_Line (File, " Keyboard : Thin.Keyboard_Ptr;"); Put_Line (File, " Rate : Integer;"); Put_Line (File, " Delay_V : Integer)"); Put_Line (File, " with Convention => C;"); Put_Line (File, ""); Put_Line (File, " procedure Internal_Keymap"); Put_Line (File, " (Data : Void_Ptr;"); Put_Line (File, " Keyboard : Thin.Keyboard_Ptr;"); Put_Line (File, " Format : Keyboard_Keymap_Format;"); Put_Line (File, " Fd : File_Descriptor;"); Put_Line (File, " Size : Unsigned_32)"); Put_Line (File, " is"); Put_Line (File, " pragma Assert (Conversion.To_Pointer (Data).Proxy = Keyboard);"); Put_Line (File, " begin"); Put_Line (File, " Keymap (Conversion.To_Pointer (Data).all, Format, Fd, Size);"); Put_Line (File, " end Internal_Keymap;"); Put_Line (File, ""); Put_Line (File, " procedure Internal_Enter"); Put_Line (File, " (Data : Void_Ptr;"); Put_Line (File, " Keyboard : Thin.Keyboard_Ptr;"); Put_Line (File, " Serial : Unsigned_32;"); Put_Line (File, " Surface : Thin.Surface_Ptr;"); Put_Line (File, " Keys : Wayland_Array)"); Put_Line (File, " is"); Put_Line (File, " pragma Assert (Conversion.To_Pointer (Data).Proxy = Keyboard);"); Put_Line (File, ""); Put_Line (File, " S : constant Client.Surface := (Proxy => Surface);"); Put_Line (File, ""); Put_Line (File, " Key_Size : constant := Unsigned_32'Size / System.Storage_Unit;"); Put_Line (File, ""); Put_Line (File, " Pressed_Keys : Unsigned_32_Array (1 .. Natural (Keys.Size) / Key_Size)"); Put_Line (File, " with Address => Keys.Data;"); Put_Line (File, " begin"); Put_Line (File, " Enter (Conversion.To_Pointer (Data).all, Serial, S, Pressed_Keys);"); Put_Line (File, " end Internal_Enter;"); Put_Line (File, ""); Put_Line (File, " procedure Internal_Leave"); Put_Line (File, " (Data : Void_Ptr;"); Put_Line (File, " Keyboard : Thin.Keyboard_Ptr;"); Put_Line (File, " Serial : Unsigned_32;"); Put_Line (File, " Surface : Thin.Surface_Ptr)"); Put_Line (File, " is"); Put_Line (File, " pragma Assert (Conversion.To_Pointer (Data).Proxy = Keyboard);"); Put_Line (File, ""); Put_Line (File, " S : constant Client.Surface := (Proxy => Surface);"); Put_Line (File, " begin"); Put_Line (File, " Leave (Conversion.To_Pointer (Data).all, Serial, S);"); Put_Line (File, " end Internal_Leave;"); Put_Line (File, ""); Put_Line (File, " procedure Internal_Key"); Put_Line (File, " (Data : Void_Ptr;"); Put_Line (File, " Keyboard : Thin.Keyboard_Ptr;"); Put_Line (File, " Serial : Unsigned_32;"); Put_Line (File, " Time : Unsigned_32;"); Put_Line (File, " Key : Unsigned_32;"); Put_Line (File, " State : Keyboard_Key_State)"); Put_Line (File, " is"); Put_Line (File, " pragma Assert (Conversion.To_Pointer (Data).Proxy = Keyboard);"); Put_Line (File, " begin"); Put_Line (File, " Keyboard_Events.Key (Conversion.To_Pointer (Data).all, Serial, Time, Key, State);"); Put_Line (File, " end Internal_Key;"); Put_Line (File, ""); Put_Line (File, " procedure Internal_Modifiers"); Put_Line (File, " (Data : Void_Ptr;"); Put_Line (File, " Keyboard : Thin.Keyboard_Ptr;"); Put_Line (File, " Serial : Unsigned_32;"); Put_Line (File, " Mods_Depressed : Unsigned_32;"); Put_Line (File, " Mods_Latched : Unsigned_32;"); Put_Line (File, " Mods_Locked : Unsigned_32;"); Put_Line (File, " Group : Unsigned_32)"); Put_Line (File, " is"); Put_Line (File, " pragma Assert (Conversion.To_Pointer (Data).Proxy = Keyboard);"); Put_Line (File, " begin"); Put_Line (File, " Modifiers"); Put_Line (File, " (Conversion.To_Pointer (Data).all,"); Put_Line (File, " Serial,"); Put_Line (File, " Mods_Depressed,"); Put_Line (File, " Mods_Latched,"); Put_Line (File, " Mods_Locked,"); Put_Line (File, " Group);"); Put_Line (File, " end Internal_Modifiers;"); Put_Line (File, ""); Put_Line (File, " procedure Internal_Repeat_Info"); Put_Line (File, " (Data : Void_Ptr;"); Put_Line (File, " Keyboard : Thin.Keyboard_Ptr;"); Put_Line (File, " Rate : Integer;"); Put_Line (File, " Delay_V : Integer)"); Put_Line (File, " is"); Put_Line (File, " pragma Assert (Conversion.To_Pointer (Data).Proxy = Keyboard);"); Put_Line (File, " begin"); Put_Line (File, " Repeat_Info (Conversion.To_Pointer (Data).all, Rate, Delay_V);"); Put_Line (File, " end Internal_Repeat_Info;"); Put_Line (File, ""); Put_Line (File, " Listener : aliased Thin.Keyboard_Listener_T :="); Put_Line (File, " (Keymap => Internal_Keymap'Unrestricted_Access,"); Put_Line (File, " Enter => Internal_Enter'Unrestricted_Access,"); Put_Line (File, " Leave => Internal_Leave'Unrestricted_Access,"); Put_Line (File, " Key => Internal_Key'Unrestricted_Access,"); Put_Line (File, " Modifiers => Internal_Modifiers'Unrestricted_Access,"); Put_Line (File, " Repeat_Info => Internal_Repeat_Info'Unrestricted_Access);"); Put_Line (File, ""); elsif Name = "Touch" then Put_Line (File, " procedure Internal_Down"); Put_Line (File, " (Data : Void_Ptr;"); Put_Line (File, " Touch : Thin.Touch_Ptr;"); Put_Line (File, " Serial : Unsigned_32;"); Put_Line (File, " Time : Unsigned_32;"); Put_Line (File, " Surface : Thin.Surface_Ptr;"); Put_Line (File, " Id : Integer;"); Put_Line (File, " X, Y : Fixed)"); Put_Line (File, " with Convention => C;"); Put_Line (File, ""); Put_Line (File, " procedure Internal_Up"); Put_Line (File, " (Data : Void_Ptr;"); Put_Line (File, " Touch : Thin.Touch_Ptr;"); Put_Line (File, " Serial : Unsigned_32;"); Put_Line (File, " Time : Unsigned_32;"); Put_Line (File, " Id : Integer)"); Put_Line (File, " with Convention => C;"); Put_Line (File, ""); Put_Line (File, " procedure Internal_Motion"); Put_Line (File, " (Data : Void_Ptr;"); Put_Line (File, " Touch : Thin.Touch_Ptr;"); Put_Line (File, " Time : Unsigned_32;"); Put_Line (File, " Id : Integer;"); Put_Line (File, " X, Y : Fixed)"); Put_Line (File, " with Convention => C;"); Put_Line (File, ""); Put_Line (File, " procedure Internal_Frame"); Put_Line (File, " (Data : Void_Ptr;"); Put_Line (File, " Touch : Thin.Touch_Ptr)"); Put_Line (File, " with Convention => C;"); Put_Line (File, ""); Put_Line (File, " procedure Internal_Cancel"); Put_Line (File, " (Data : Void_Ptr;"); Put_Line (File, " Touch : Thin.Touch_Ptr)"); Put_Line (File, " with Convention => C;"); Put_Line (File, ""); Put_Line (File, " procedure Internal_Shape"); Put_Line (File, " (Data : Void_Ptr;"); Put_Line (File, " Touch : Thin.Touch_Ptr;"); Put_Line (File, " Id : Integer;"); Put_Line (File, " Major : Fixed;"); Put_Line (File, " Minor : Fixed)"); Put_Line (File, " with Convention => C;"); Put_Line (File, ""); Put_Line (File, " procedure Internal_Orientation"); Put_Line (File, " (Data : Void_Ptr;"); Put_Line (File, " Touch : Thin.Touch_Ptr;"); Put_Line (File, " Id : Integer;"); Put_Line (File, " Orientation : Fixed)"); Put_Line (File, " with Convention => C;"); Put_Line (File, ""); Put_Line (File, " procedure Internal_Down"); Put_Line (File, " (Data : Void_Ptr;"); Put_Line (File, " Touch : Thin.Touch_Ptr;"); Put_Line (File, " Serial : Unsigned_32;"); Put_Line (File, " Time : Unsigned_32;"); Put_Line (File, " Surface : Thin.Surface_Ptr;"); Put_Line (File, " Id : Integer;"); Put_Line (File, " X, Y : Fixed)"); Put_Line (File, " is"); Put_Line (File, " pragma Assert (Conversion.To_Pointer (Data).Proxy = Touch);"); Put_Line (File, ""); Put_Line (File, " S : constant Client.Surface := (Proxy => Surface);"); Put_Line (File, " begin"); Put_Line (File, " Down (Conversion.To_Pointer (Data).all, Serial, Time, S, Id, X, Y);"); Put_Line (File, " end Internal_Down;"); Put_Line (File, ""); Put_Line (File, " procedure Internal_Up"); Put_Line (File, " (Data : Void_Ptr;"); Put_Line (File, " Touch : Thin.Touch_Ptr;"); Put_Line (File, " Serial : Unsigned_32;"); Put_Line (File, " Time : Unsigned_32;"); Put_Line (File, " Id : Integer)"); Put_Line (File, " is"); Put_Line (File, " pragma Assert (Conversion.To_Pointer (Data).Proxy = Touch);"); Put_Line (File, " begin"); Put_Line (File, " Up (Conversion.To_Pointer (Data).all, Serial, Time, Id);"); Put_Line (File, " end Internal_Up;"); Put_Line (File, ""); Put_Line (File, " procedure Internal_Motion"); Put_Line (File, " (Data : Void_Ptr;"); Put_Line (File, " Touch : Thin.Touch_Ptr;"); Put_Line (File, " Time : Unsigned_32;"); Put_Line (File, " Id : Integer;"); Put_Line (File, " X, Y : Fixed)"); Put_Line (File, " is"); Put_Line (File, " pragma Assert (Conversion.To_Pointer (Data).Proxy = Touch);"); Put_Line (File, " begin"); Put_Line (File, " Motion (Conversion.To_Pointer (Data).all, Time, Id, X, Y);"); Put_Line (File, " end Internal_Motion;"); Put_Line (File, ""); Put_Line (File, " procedure Internal_Frame"); Put_Line (File, " (Data : Void_Ptr;"); Put_Line (File, " Touch : Thin.Touch_Ptr)"); Put_Line (File, " is"); Put_Line (File, " pragma Assert (Conversion.To_Pointer (Data).Proxy = Touch);"); Put_Line (File, " begin"); Put_Line (File, " Frame (Conversion.To_Pointer (Data).all);"); Put_Line (File, " end Internal_Frame;"); Put_Line (File, ""); Put_Line (File, " procedure Internal_Cancel"); Put_Line (File, " (Data : Void_Ptr;"); Put_Line (File, " Touch : Thin.Touch_Ptr)"); Put_Line (File, " is"); Put_Line (File, " pragma Assert (Conversion.To_Pointer (Data).Proxy = Touch);"); Put_Line (File, " begin"); Put_Line (File, " Cancel (Conversion.To_Pointer (Data).all);"); Put_Line (File, " end Internal_Cancel;"); Put_Line (File, ""); Put_Line (File, " procedure Internal_Shape"); Put_Line (File, " (Data : Void_Ptr;"); Put_Line (File, " Touch : Thin.Touch_Ptr;"); Put_Line (File, " Id : Integer;"); Put_Line (File, " Major : Fixed;"); Put_Line (File, " Minor : Fixed)"); Put_Line (File, " is"); Put_Line (File, " pragma Assert (Conversion.To_Pointer (Data).Proxy = Touch);"); Put_Line (File, " begin"); Put_Line (File, " Shape (Conversion.To_Pointer (Data).all, Id, Major, Minor);"); Put_Line (File, " end Internal_Shape;"); Put_Line (File, ""); Put_Line (File, " procedure Internal_Orientation"); Put_Line (File, " (Data : Void_Ptr;"); Put_Line (File, " Touch : Thin.Touch_Ptr;"); Put_Line (File, " Id : Integer;"); Put_Line (File, " Orientation : Fixed)"); Put_Line (File, " is"); Put_Line (File, " pragma Assert (Conversion.To_Pointer (Data).Proxy = Touch);"); Put_Line (File, " begin"); Put_Line (File, " Touch_Events.Orientation (Conversion.To_Pointer (Data).all, Id, Orientation);"); Put_Line (File, " end Internal_Orientation;"); Put_Line (File, ""); Put_Line (File, " Listener : aliased Thin.Touch_Listener_T :="); Put_Line (File, " (Down => Internal_Down'Unrestricted_Access,"); Put_Line (File, " Up => Internal_Up'Unrestricted_Access,"); Put_Line (File, " Motion => Internal_Motion'Unrestricted_Access,"); Put_Line (File, " Frame => Internal_Frame'Unrestricted_Access,"); Put_Line (File, " Cancel => Internal_Cancel'Unrestricted_Access,"); Put_Line (File, " Shape => Internal_Shape'Unrestricted_Access,"); Put_Line (File, " Orientation => Internal_Orientation'Unrestricted_Access);"); Put_Line (File, ""); elsif Name = "Output" then Put_Line (File, " procedure Internal_Geometry"); Put_Line (File, " (Data : Void_Ptr;"); Put_Line (File, " Output : Thin.Output_Ptr;"); Put_Line (File, " X, Y : Integer;"); Put_Line (File, " Physical_Width : Integer;"); Put_Line (File, " Physical_Height : Integer;"); Put_Line (File, " Subpixel : Output_Subpixel;"); Put_Line (File, " Make : chars_ptr;"); Put_Line (File, " Model : chars_ptr;"); Put_Line (File, " Transform : Output_Transform)"); Put_Line (File, " with Convention => C;"); Put_Line (File, ""); Put_Line (File, " procedure Internal_Mode"); Put_Line (File, " (Data : Void_Ptr;"); Put_Line (File, " Output : Thin.Output_Ptr;"); Put_Line (File, " Flags : Output_Mode;"); Put_Line (File, " Width : Integer;"); Put_Line (File, " Height : Integer;"); Put_Line (File, " Refresh : Integer)"); Put_Line (File, " with Convention => C;"); Put_Line (File, ""); Put_Line (File, " procedure Internal_Done"); Put_Line (File, " (Data : Void_Ptr;"); Put_Line (File, " Output : Thin.Output_Ptr)"); Put_Line (File, " with Convention => C;"); Put_Line (File, ""); Put_Line (File, " procedure Internal_Scale"); Put_Line (File, " (Data : Void_Ptr;"); Put_Line (File, " Output : Thin.Output_Ptr;"); Put_Line (File, " Factor : Integer)"); Put_Line (File, " with Convention => C;"); Put_Line (File, ""); Put_Line (File, " procedure Internal_Geometry"); Put_Line (File, " (Data : Void_Ptr;"); Put_Line (File, " Output : Thin.Output_Ptr;"); Put_Line (File, " X, Y : Integer;"); Put_Line (File, " Physical_Width : Integer;"); Put_Line (File, " Physical_Height : Integer;"); Put_Line (File, " Subpixel : Output_Subpixel;"); Put_Line (File, " Make : chars_ptr;"); Put_Line (File, " Model : chars_ptr;"); Put_Line (File, " Transform : Output_Transform)"); Put_Line (File, " is"); Put_Line (File, " pragma Assert (Conversion.To_Pointer (Data).Proxy = Output);"); Put_Line (File, ""); Put_Line (File, " Ma : constant String := Interfaces.C.Strings.Value (Make);"); Put_Line (File, " Mo : constant String := Interfaces.C.Strings.Value (Model);"); Put_Line (File, " begin"); Put_Line (File, " Geometry"); Put_Line (File, " (Conversion.To_Pointer (Data).all,"); Put_Line (File, " X,"); Put_Line (File, " Y,"); Put_Line (File, " Physical_Width,"); Put_Line (File, " Physical_Height,"); Put_Line (File, " Subpixel,"); Put_Line (File, " Ma,"); Put_Line (File, " Mo,"); Put_Line (File, " Transform);"); Put_Line (File, " end Internal_Geometry;"); Put_Line (File, ""); Put_Line (File, " procedure Internal_Mode"); Put_Line (File, " (Data : Void_Ptr;"); Put_Line (File, " Output : Thin.Output_Ptr;"); Put_Line (File, " Flags : Output_Mode;"); Put_Line (File, " Width : Integer;"); Put_Line (File, " Height : Integer;"); Put_Line (File, " Refresh : Integer)"); Put_Line (File, " is"); Put_Line (File, " pragma Assert (Conversion.To_Pointer (Data).Proxy = Output);"); Put_Line (File, " begin"); Put_Line (File, " Mode"); Put_Line (File, " (Conversion.To_Pointer (Data).all,"); Put_Line (File, " Flags,"); Put_Line (File, " Width,"); Put_Line (File, " Height,"); Put_Line (File, " Refresh);"); Put_Line (File, " end Internal_Mode;"); Put_Line (File, ""); Put_Line (File, " procedure Internal_Done"); Put_Line (File, " (Data : Void_Ptr;"); Put_Line (File, " Output : Thin.Output_Ptr)"); Put_Line (File, " is"); Put_Line (File, " pragma Assert (Conversion.To_Pointer (Data).Proxy = Output);"); Put_Line (File, " begin"); Put_Line (File, " Done (Conversion.To_Pointer (Data).all);"); Put_Line (File, " end Internal_Done;"); Put_Line (File, ""); Put_Line (File, " procedure Internal_Scale"); Put_Line (File, " (Data : Void_Ptr;"); Put_Line (File, " Output : Thin.Output_Ptr;"); Put_Line (File, " Factor : Integer)"); Put_Line (File, " is"); Put_Line (File, " pragma Assert (Conversion.To_Pointer (Data).Proxy = Output);"); Put_Line (File, " begin"); Put_Line (File, " Scale (Conversion.To_Pointer (Data).all, Factor);"); Put_Line (File, " end Internal_Scale;"); Put_Line (File, ""); Put_Line (File, " Listener : aliased Thin.Output_Listener_T"); Put_Line (File, " := (Geometry => Internal_Geometry'Unrestricted_Access,"); Put_Line (File, " Mode => Internal_Mode'Unrestricted_Access,"); Put_Line (File, " Done => Internal_Done'Unrestricted_Access,"); Put_Line (File, " Scale => Internal_Scale'Unrestricted_Access);"); Put_Line (File, ""); end if; Generate_Suffix_Body_Events (Name); end Handle_Interface_Events_Client; procedure Handle_Interface_Xdg_Shell (Interface_Tag : aliased Wayland_XML.Interface_Tag) is Name : constant String := Xml_Parser_Utils.Adaify_Name (Wayland_XML.Name (Interface_Tag)); begin if Name in "Xdg_Wm_Base" then Generate_Body_Bind_Subprogram (Name); end if; if Name in "Xdg_Wm_Base" then Put_Line (File, ""); Put_Line (File, " procedure Pong (Object : Xdg_Wm_Base; Serial : Unsigned_32) is"); Put_Line (File, " begin"); Put_Line (File, " Thin.Xdg_Wm_Base_Pong (Object.Proxy, Serial);"); Put_Line (File, " end Pong;"); Put_Line (File, ""); Put_Line (File, " procedure Create_Positioner"); Put_Line (File, " (Object : Xdg_Wm_Base;"); Put_Line (File, " Positioner : in out Xdg_Shell.Xdg_Positioner'Class) is"); Put_Line (File, " begin"); Put_Line (File, " Positioner.Proxy := Thin.Xdg_Wm_Base_Create_Positioner (Object.Proxy);"); Put_Line (File, " end Create_Positioner;"); Put_Line (File, ""); Put_Line (File, " procedure Get_Surface"); Put_Line (File, " (Object : Xdg_Wm_Base;"); Put_Line (File, " Window : Protocols.Client.Surface'Class;"); Put_Line (File, " Surface : in out Xdg_Shell.Xdg_Surface'Class) is"); Put_Line (File, " begin"); Put_Line (File, " Surface.Proxy := Thin.Xdg_Wm_Base_Get_Xdg_Surface"); Put_Line (File, " (Object.Proxy, Thin_Client.Surface_Ptr (Window.Get_Proxy));"); Put_Line (File, " end Get_Surface;"); elsif Name in "Xdg_Positioner" then Put_Line (File, ""); Put_Line (File, " procedure Set_Size"); Put_Line (File, " (Object : Xdg_Positioner;"); Put_Line (File, " Width : Natural;"); Put_Line (File, " Height : Natural) is"); Put_Line (File, " begin"); Put_Line (File, " Thin.Xdg_Positioner_Set_Size (Object.Proxy, Width, Height);"); Put_Line (File, " end Set_Size;"); Put_Line (File, ""); Put_Line (File, " procedure Set_Anchor_Rect"); Put_Line (File, " (Object : Xdg_Positioner;"); Put_Line (File, " X, Y : Integer;"); Put_Line (File, " Width : Natural;"); Put_Line (File, " Height : Natural) is"); Put_Line (File, " begin"); Put_Line (File, " Thin.Xdg_Positioner_Set_Anchor_Rect (Object.Proxy, X, Y, Width, Height);"); Put_Line (File, " end Set_Anchor_Rect;"); Put_Line (File, ""); Put_Line (File, " procedure Set_Anchor"); Put_Line (File, " (Object : Xdg_Positioner;"); Put_Line (File, " Anchor : Xdg_Positioner_Anchor) is"); Put_Line (File, " begin"); Put_Line (File, " Thin.Xdg_Positioner_Set_Anchor (Object.Proxy, Anchor);"); Put_Line (File, " end Set_Anchor;"); Put_Line (File, ""); Put_Line (File, " procedure Set_Gravity"); Put_Line (File, " (Object : Xdg_Positioner;"); Put_Line (File, " Gravity : Xdg_Positioner_Gravity) is"); Put_Line (File, " begin"); Put_Line (File, " Thin.Xdg_Positioner_Set_Gravity (Object.Proxy, Gravity);"); Put_Line (File, " end Set_Gravity;"); Put_Line (File, ""); Put_Line (File, " procedure Set_Constraint_Adjustment"); Put_Line (File, " (Object : Xdg_Positioner;"); Put_Line (File, " Adjustment : Unsigned_32) is"); Put_Line (File, " begin"); Put_Line (File, " Thin.Xdg_Positioner_Set_Constraint_Adjustment (Object.Proxy, Adjustment);"); Put_Line (File, " end Set_Constraint_Adjustment;"); Put_Line (File, ""); Put_Line (File, " procedure Set_Offset"); Put_Line (File, " (Object : Xdg_Positioner;"); Put_Line (File, " X, Y : Integer) is"); Put_Line (File, " begin"); Put_Line (File, " Thin.Xdg_Positioner_Set_Offset (Object.Proxy, X, Y);"); Put_Line (File, " end Set_Offset;"); Put_Line (File, ""); Put_Line (File, " procedure Set_Reactive (Object : Xdg_Positioner) is"); Put_Line (File, " begin"); Put_Line (File, " Thin.Xdg_Positioner_Set_Reactive (Object.Proxy);"); Put_Line (File, " end Set_Reactive;"); Put_Line (File, ""); Put_Line (File, " procedure Set_Parent_Size"); Put_Line (File, " (Object : Xdg_Positioner;"); Put_Line (File, " Width : Natural;"); Put_Line (File, " Height : Natural) is"); Put_Line (File, " begin"); Put_Line (File, " Thin.Xdg_Positioner_Set_Parent_Size (Object.Proxy, Width, Height);"); Put_Line (File, " end Set_Parent_Size;"); Put_Line (File, ""); Put_Line (File, " procedure Set_Parent_Configure"); Put_Line (File, " (Object : Xdg_Positioner;"); Put_Line (File, " Serial : Unsigned_32) is"); Put_Line (File, " begin"); Put_Line (File, " Thin.Xdg_Positioner_Set_Parent_Configure (Object.Proxy, Serial);"); Put_Line (File, " end Set_Parent_Configure;"); elsif Name in "Xdg_Surface" then Put_Line (File, ""); Put_Line (File, " procedure Get_Toplevel"); Put_Line (File, " (Object : Xdg_Surface;"); Put_Line (File, " Toplevel : in out Xdg_Shell.Xdg_Toplevel'Class) is"); Put_Line (File, " begin"); Put_Line (File, " Toplevel.Proxy := Thin.Xdg_Surface_Get_Toplevel (Object.Proxy);"); Put_Line (File, " end Get_Toplevel;"); Put_Line (File, ""); Put_Line (File, " procedure Get_Popup"); Put_Line (File, " (Object : Xdg_Surface;"); Put_Line (File, " Parent : Xdg_Surface'Class;"); Put_Line (File, " Positioner : Xdg_Shell.Xdg_Positioner'Class;"); Put_Line (File, " Popup : in out Xdg_Shell.Xdg_Popup'Class) is"); Put_Line (File, " begin"); Put_Line (File, " Popup.Proxy := Thin.Xdg_Surface_Get_Popup (Object.Proxy, Parent.Proxy, Positioner.Proxy);"); Put_Line (File, " end Get_Popup;"); Put_Line (File, ""); Put_Line (File, " procedure Set_Window_Geometry"); Put_Line (File, " (Object : Xdg_Surface;"); Put_Line (File, " X, Y : Integer;"); Put_Line (File, " Width : Natural;"); Put_Line (File, " Height : Natural) is"); Put_Line (File, " begin"); Put_Line (File, " Thin.Xdg_Surface_Set_Window_Geometry (Object.Proxy, X, Y, Width, Height);"); Put_Line (File, " end Set_Window_Geometry;"); Put_Line (File, ""); Put_Line (File, " procedure Ack_Configure"); Put_Line (File, " (Object : Xdg_Surface;"); Put_Line (File, " Serial : Unsigned_32) is"); Put_Line (File, " begin"); Put_Line (File, " Thin.Xdg_Surface_Ack_Configure (Object.Proxy, Serial);"); Put_Line (File, " end Ack_Configure;"); elsif Name in "Xdg_Toplevel" then Put_Line (File, ""); Put_Line (File, " procedure Set_Parent"); Put_Line (File, " (Object : Xdg_Toplevel;"); Put_Line (File, " Parent : Xdg_Toplevel'Class) is"); Put_Line (File, " begin"); Put_Line (File, " Thin.Xdg_Toplevel_Set_Parent (Object.Proxy, Parent.Proxy);"); Put_Line (File, " end Set_Parent;"); Put_Line (File, ""); Put_Line (File, " procedure Set_Title (Object : Xdg_Toplevel; Value : String) is"); Put_Line (File, " Value_Ptr : Interfaces.C.Strings.chars_ptr := Interfaces.C.Strings.New_String (Value);"); Put_Line (File, " begin"); Put_Line (File, " Thin.Xdg_Toplevel_Set_Title (Object.Proxy, Value_Ptr);"); Put_Line (File, " Interfaces.C.Strings.Free (Value_Ptr);"); Put_Line (File, " end Set_Title;"); Put_Line (File, ""); Put_Line (File, " procedure Set_App_Id (Object : Xdg_Toplevel; Value : String) is"); Put_Line (File, " Value_Ptr : Interfaces.C.Strings.chars_ptr := Interfaces.C.Strings.New_String (Value);"); Put_Line (File, " begin"); Put_Line (File, " Thin.Xdg_Toplevel_Set_App_Id (Object.Proxy, Value_Ptr);"); Put_Line (File, " Interfaces.C.Strings.Free (Value_Ptr);"); Put_Line (File, " end Set_App_Id;"); Put_Line (File, ""); Put_Line (File, " procedure Show_Window_Menu"); Put_Line (File, " (Object : Xdg_Toplevel;"); Put_Line (File, " Seat : Protocols.Client.Seat'Class;"); Put_Line (File, " Serial : Unsigned_32;"); Put_Line (File, " X, Y : Integer) is"); Put_Line (File, " begin"); Put_Line (File, " Thin.Xdg_Toplevel_Show_Window_Menu"); Put_Line (File, " (Object.Proxy, Thin_Client.Seat_Ptr (Seat.Get_Proxy), Serial, X, Y);"); Put_Line (File, " end Show_Window_Menu;"); Put_Line (File, ""); Put_Line (File, " procedure Move"); Put_Line (File, " (Object : Xdg_Toplevel;"); Put_Line (File, " Seat : Protocols.Client.Seat'Class;"); Put_Line (File, " Serial : Unsigned_32) is"); Put_Line (File, " begin"); Put_Line (File, " Thin.Xdg_Toplevel_Move"); Put_Line (File, " (Object.Proxy, Thin_Client.Seat_Ptr (Seat.Get_Proxy), Serial);"); Put_Line (File, " end Move;"); Put_Line (File, ""); Put_Line (File, " procedure Resize"); Put_Line (File, " (Object : Xdg_Toplevel;"); Put_Line (File, " Seat : Protocols.Client.Seat'Class;"); Put_Line (File, " Serial : Unsigned_32;"); Put_Line (File, " Edges : Xdg_Toplevel_Resize_Edge) is"); Put_Line (File, " begin"); Put_Line (File, " Thin.Xdg_Toplevel_Resize"); Put_Line (File, " (Object.Proxy, Thin_Client.Seat_Ptr (Seat.Get_Proxy), Serial, Edges);"); Put_Line (File, " end Resize;"); Put_Line (File, ""); Put_Line (File, " procedure Set_Min_Size"); Put_Line (File, " (Object : Xdg_Toplevel;"); Put_Line (File, " Width : Natural;"); Put_Line (File, " Height : Natural) is"); Put_Line (File, " begin"); Put_Line (File, " Thin.Xdg_Toplevel_Set_Min_Size (Object.Proxy, Width, Height);"); Put_Line (File, " end Set_Min_Size;"); Put_Line (File, ""); Put_Line (File, " procedure Set_Max_Size"); Put_Line (File, " (Object : Xdg_Toplevel;"); Put_Line (File, " Width : Natural;"); Put_Line (File, " Height : Natural) is"); Put_Line (File, " begin"); Put_Line (File, " Thin.Xdg_Toplevel_Set_Max_Size (Object.Proxy, Width, Height);"); Put_Line (File, " end Set_Max_Size;"); Put_Line (File, ""); Put_Line (File, " procedure Minimize (Object : Xdg_Toplevel) is"); Put_Line (File, " begin"); Put_Line (File, " Thin.Xdg_Toplevel_Set_Minimized (Object.Proxy);"); Put_Line (File, " end Minimize;"); Put_Line (File, ""); Put_Line (File, " procedure Set_Maximized (Object : Xdg_Toplevel; Enable : Boolean) is"); Put_Line (File, " begin"); Put_Line (File, " if Enable then"); Put_Line (File, " Thin.Xdg_Toplevel_Set_Maximized (Object.Proxy);"); Put_Line (File, " else"); Put_Line (File, " Thin.Xdg_Toplevel_Unset_Maximized (Object.Proxy);"); Put_Line (File, " end if;"); Put_Line (File, " end Set_Maximized;"); Put_Line (File, ""); Put_Line (File, " procedure Set_Fullscreen"); Put_Line (File, " (Object : Xdg_Toplevel;"); Put_Line (File, " Enable : Boolean) is"); Put_Line (File, " begin"); Put_Line (File, " if Enable then"); Put_Line (File, " Thin.Xdg_Toplevel_Set_Fullscreen (Object.Proxy, null);"); Put_Line (File, " else"); Put_Line (File, " Thin.Xdg_Toplevel_Unset_Fullscreen (Object.Proxy);"); Put_Line (File, " end if;"); Put_Line (File, " end Set_Fullscreen;"); Put_Line (File, ""); Put_Line (File, " procedure Set_Fullscreen"); Put_Line (File, " (Object : Xdg_Toplevel;"); Put_Line (File, " Enable : Boolean;"); Put_Line (File, " Output : Protocols.Client.Output'Class) is"); Put_Line (File, " begin"); Put_Line (File, " if Enable then"); Put_Line (File, " Thin.Xdg_Toplevel_Set_Fullscreen (Object.Proxy, Thin_Client.Output_Ptr (Output.Get_Proxy));"); Put_Line (File, " else"); Put_Line (File, " Thin.Xdg_Toplevel_Unset_Fullscreen (Object.Proxy);"); Put_Line (File, " end if;"); Put_Line (File, " end Set_Fullscreen;"); elsif Name in "Xdg_Popup" then Put_Line (File, ""); Put_Line (File, " procedure Grab"); Put_Line (File, " (Object : Xdg_Popup;"); Put_Line (File, " Seat : Protocols.Client.Seat'Class;"); Put_Line (File, " Serial : Unsigned_32) is"); Put_Line (File, " begin"); Put_Line (File, " Thin.Xdg_Popup_Grab (Object.Proxy, Thin_Client.Seat_Ptr (Seat.Get_Proxy), Serial);"); Put_Line (File, " end Grab;"); Put_Line (File, ""); Put_Line (File, " procedure Reposition"); Put_Line (File, " (Object : Xdg_Popup;"); Put_Line (File, " Positioner : Xdg_Shell.Xdg_Positioner'Class;"); Put_Line (File, " Token : Unsigned_32) is"); Put_Line (File, " begin"); Put_Line (File, " Thin.Xdg_Popup_Reposition (Object.Proxy, Positioner.Proxy, Token);"); Put_Line (File, " end Reposition;"); end if; end Handle_Interface_Xdg_Shell; procedure Handle_Interface_Events_Xdg_Shell (Interface_Tag : aliased Wayland_XML.Interface_Tag) is Name : constant String := Xml_Parser_Utils.Adaify_Name (Wayland_XML.Name (Interface_Tag)); begin if not Exists_Events (Interface_Tag) then return; end if; Generate_Prefix_Body_Events (Name); if Name = "Xdg_Wm_Base" then Put_Line (File, " procedure Internal_Ping"); Put_Line (File, " (Data : Void_Ptr;"); Put_Line (File, " Xdg_Wm_Base : Thin.Xdg_Wm_Base_Ptr;"); Put_Line (File, " Serial : Unsigned_32)"); Put_Line (File, " with Convention => C;"); Put_Line (File, ""); Put_Line (File, " procedure Internal_Ping"); Put_Line (File, " (Data : Void_Ptr;"); Put_Line (File, " Xdg_Wm_Base : Thin.Xdg_Wm_Base_Ptr;"); Put_Line (File, " Serial : Unsigned_32)"); Put_Line (File, " is"); Put_Line (File, " pragma Assert (Conversion.To_Pointer (Data).Proxy = " & Name & ");"); Put_Line (File, " begin"); Put_Line (File, " Ping (Conversion.To_Pointer (Data).all, Serial);"); Put_Line (File, " end Internal_Ping;"); Put_Line (File, ""); Put_Line (File, " Listener : aliased Thin." & Name & "_Listener_T :="); Put_Line (File, " (Ping => Internal_Ping'Unrestricted_Access);"); Put_Line (File, ""); elsif Name = "Xdg_Surface" then Put_Line (File, " procedure Internal_Configure"); Put_Line (File, " (Data : Void_Ptr;"); Put_Line (File, " Xdg_Surface : Thin.Xdg_Surface_Ptr;"); Put_Line (File, " Serial : Unsigned_32)"); Put_Line (File, " with Convention => C;"); Put_Line (File, ""); Put_Line (File, " procedure Internal_Configure"); Put_Line (File, " (Data : Void_Ptr;"); Put_Line (File, " Xdg_Surface : Thin.Xdg_Surface_Ptr;"); Put_Line (File, " Serial : Unsigned_32)"); Put_Line (File, " is"); Put_Line (File, " pragma Assert (Conversion.To_Pointer (Data).Proxy = " & Name & ");"); Put_Line (File, " begin"); Put_Line (File, " Configure (Conversion.To_Pointer (Data).all, Serial);"); Put_Line (File, " end Internal_Configure;"); Put_Line (File, ""); Put_Line (File, " Listener : aliased Thin." & Name & "_Listener_T :="); Put_Line (File, " (Configure => Internal_Configure'Unrestricted_Access);"); Put_Line (File, ""); elsif Name = "Xdg_Toplevel" then Put_Line (File, " procedure Internal_Configure"); Put_Line (File, " (Data : Void_Ptr;"); Put_Line (File, " Xdg_Toplevel : Thin.Xdg_Toplevel_Ptr;"); Put_Line (File, " Width : Integer;"); Put_Line (File, " Height : Integer;"); Put_Line (File, " States : Wayland_Array)"); Put_Line (File, " with Convention => C;"); Put_Line (File, ""); Put_Line (File, " procedure Internal_Close"); Put_Line (File, " (Data : Void_Ptr;"); Put_Line (File, " Xdg_Toplevel : Thin.Xdg_Toplevel_Ptr)"); Put_Line (File, " with Convention => C;"); Put_Line (File, ""); Put_Line (File, " procedure Internal_Configure"); Put_Line (File, " (Data : Void_Ptr;"); Put_Line (File, " Xdg_Toplevel : Thin.Xdg_Toplevel_Ptr;"); Put_Line (File, " Width : Integer;"); Put_Line (File, " Height : Integer;"); Put_Line (File, " States : Wayland_Array)"); Put_Line (File, " is"); Put_Line (File, " pragma Assert (Conversion.To_Pointer (Data).Proxy = " & Name & ");"); Put_Line (File, ""); Put_Line (File, " State_Size : constant := Unsigned_32'Size / System.Storage_Unit;"); Put_Line (File, ""); Put_Line (File, " Current_States : State_Array (1 .. Natural (States.Size) / State_Size)"); Put_Line (File, " with Address => States.Data;"); Put_Line (File, " begin"); Put_Line (File, " Configure (Conversion.To_Pointer (Data).all, Width, Height, Current_States);"); Put_Line (File, " end Internal_Configure;"); Put_Line (File, ""); Put_Line (File, " procedure Internal_Close"); Put_Line (File, " (Data : Void_Ptr;"); Put_Line (File, " Xdg_Toplevel : Thin.Xdg_Toplevel_Ptr)"); Put_Line (File, " is"); Put_Line (File, " pragma Assert (Conversion.To_Pointer (Data).Proxy = " & Name & ");"); Put_Line (File, " begin"); Put_Line (File, " Close (Conversion.To_Pointer (Data).all);"); Put_Line (File, " end Internal_Close;"); Put_Line (File, ""); Put_Line (File, " Listener : aliased Thin." & Name & "_Listener_T :="); Put_Line (File, " (Configure => Internal_Configure'Unrestricted_Access,"); Put_Line (File, " Close => Internal_Close'Unrestricted_Access);"); Put_Line (File, ""); elsif Name = "Xdg_Popup" then Put_Line (File, " procedure Internal_Configure"); Put_Line (File, " (Data : Void_Ptr;"); Put_Line (File, " Xdg_Popup : Thin.Xdg_Popup_Ptr;"); Put_Line (File, " X, Y : Integer;"); Put_Line (File, " Width : Integer;"); Put_Line (File, " Height : Integer)"); Put_Line (File, " with Convention => C;"); Put_Line (File, ""); Put_Line (File, " procedure Internal_Popup_Done"); Put_Line (File, " (Data : Void_Ptr;"); Put_Line (File, " Xdg_Popup : Thin.Xdg_Popup_Ptr)"); Put_Line (File, " with Convention => C;"); Put_Line (File, ""); Put_Line (File, " procedure Internal_Repositioned"); Put_Line (File, " (Data : Void_Ptr;"); Put_Line (File, " Xdg_Popup : Thin.Xdg_Popup_Ptr;"); Put_Line (File, " Token : Unsigned_32)"); Put_Line (File, " with Convention => C;"); Put_Line (File, ""); Put_Line (File, " procedure Internal_Configure"); Put_Line (File, " (Data : Void_Ptr;"); Put_Line (File, " Xdg_Popup : Thin.Xdg_Popup_Ptr;"); Put_Line (File, " X, Y : Integer;"); Put_Line (File, " Width : Integer;"); Put_Line (File, " Height : Integer)"); Put_Line (File, " is"); Put_Line (File, " pragma Assert (Conversion.To_Pointer (Data).Proxy = " & Name & ");"); Put_Line (File, " begin"); Put_Line (File, " Configure (Conversion.To_Pointer (Data).all, X, Y, Width, Height);"); Put_Line (File, " end Internal_Configure;"); Put_Line (File, ""); Put_Line (File, " procedure Internal_Popup_Done"); Put_Line (File, " (Data : Void_Ptr;"); Put_Line (File, " Xdg_Popup : Thin.Xdg_Popup_Ptr)"); Put_Line (File, " is"); Put_Line (File, " pragma Assert (Conversion.To_Pointer (Data).Proxy = " & Name & ");"); Put_Line (File, " begin"); Put_Line (File, " Popup_Done (Conversion.To_Pointer (Data).all);"); Put_Line (File, " end Internal_Popup_Done;"); Put_Line (File, ""); Put_Line (File, " procedure Internal_Repositioned"); Put_Line (File, " (Data : Void_Ptr;"); Put_Line (File, " Xdg_Popup : Thin.Xdg_Popup_Ptr;"); Put_Line (File, " Token : Unsigned_32)"); Put_Line (File, " is"); Put_Line (File, " pragma Assert (Conversion.To_Pointer (Data).Proxy = " & Name & ");"); Put_Line (File, " begin"); Put_Line (File, " Repositioned (Conversion.To_Pointer (Data).all, Token);"); Put_Line (File, " end Internal_Repositioned;"); Put_Line (File, ""); Put_Line (File, " Listener : aliased Thin." & Name & "_Listener_T :="); Put_Line (File, " (Configure => Internal_Configure'Unrestricted_Access,"); Put_Line (File, " Popup_Done => Internal_Popup_Done'Unrestricted_Access,"); Put_Line (File, " Repositioned => Internal_Repositioned'Unrestricted_Access);"); Put_Line (File, ""); end if; Generate_Suffix_Body_Events (Name); end Handle_Interface_Events_Xdg_Shell; procedure Handle_Interface_Presentation_Time (Interface_Tag : aliased Wayland_XML.Interface_Tag) is Name : constant String := Xml_Parser_Utils.Adaify_Name (Wayland_XML.Name (Interface_Tag)); begin if Name in "Presentation" then Generate_Body_Bind_Subprogram (Name); end if; if Name = "Presentation" then Put_Line (File, ""); Put_Line (File, " procedure Feedback"); Put_Line (File, " (Object : Presentation;"); Put_Line (File, " Surface : Protocols.Client.Surface'Class;"); Put_Line (File, " Feedback : in out Presentation_Feedback'Class) is"); Put_Line (File, " begin"); Put_Line (File, " Feedback.Proxy := Thin.Presentation_Feedback (Object.Proxy, Thin_Client.Surface_Ptr (Surface.Get_Proxy));"); Put_Line (File, " end Feedback;"); end if; end Handle_Interface_Presentation_Time; procedure Handle_Interface_Events_Presentation_Time (Interface_Tag : aliased Wayland_XML.Interface_Tag) is Name : constant String := Xml_Parser_Utils.Adaify_Name (Wayland_XML.Name (Interface_Tag)); begin if not Exists_Events (Interface_Tag) then return; end if; Generate_Prefix_Body_Events (Name); if Name = "Presentation" then Put_Line (File, " procedure Internal_Clock_Id"); Put_Line (File, " (Data : Void_Ptr;"); Put_Line (File, " Presentation : Thin.Presentation_Ptr;"); Put_Line (File, " Clk_Id : Unsigned_32)"); Put_Line (File, " with Convention => C;"); Put_Line (File, ""); Put_Line (File, " procedure Internal_Clock_Id"); Put_Line (File, " (Data : Void_Ptr;"); Put_Line (File, " Presentation : Thin.Presentation_Ptr;"); Put_Line (File, " Clk_Id : Unsigned_32)"); Put_Line (File, " is"); Put_Line (File, " pragma Assert (Conversion.To_Pointer (Data).Proxy = " & Name & ");"); Put_Line (File, " begin"); Put_Line (File, " Clock (Conversion.To_Pointer (Data).all, Clk_Id);"); Put_Line (File, " end Internal_Clock_Id;"); Put_Line (File, ""); Put_Line (File, " Listener : aliased Thin." & Name & "_Listener_T :="); Put_Line (File, " (Clock_Id => Internal_Clock_Id'Unrestricted_Access);"); Put_Line (File, ""); elsif Name = "Presentation_Feedback" then Put_Line (File, " procedure Internal_Sync_Output"); Put_Line (File, " (Data : Void_Ptr;"); Put_Line (File, " Presentation_Feedback : Thin.Presentation_Feedback_Ptr;"); Put_Line (File, " Output : Protocols.Thin_Client.Output_Ptr)"); Put_Line (File, " with Convention => C;"); Put_Line (File, ""); Put_Line (File, " procedure Internal_Presented"); Put_Line (File, " (Data : Void_Ptr;"); Put_Line (File, " Presentation_Feedback : Thin.Presentation_Feedback_Ptr;"); Put_Line (File, " Tv_Sec_Hi : Unsigned_32;"); Put_Line (File, " Tv_Sec_Lo : Unsigned_32;"); Put_Line (File, " Tv_Nsec : Unsigned_32;"); Put_Line (File, " Refresh : Unsigned_32;"); Put_Line (File, " Seq_Hi : Unsigned_32;"); Put_Line (File, " Seq_Lo : Unsigned_32;"); Put_Line (File, " Flags : Enums.Presentation_Time.Presentation_Feedback_Kind)"); Put_Line (File, " with Convention => C;"); Put_Line (File, ""); Put_Line (File, " procedure Internal_Discarded"); Put_Line (File, " (Data : Void_Ptr;"); Put_Line (File, " Presentation_Feedback : Thin.Presentation_Feedback_Ptr)"); Put_Line (File, " with Convention => C;"); Put_Line (File, ""); Put_Line (File, " procedure Internal_Sync_Output"); Put_Line (File, " (Data : Void_Ptr;"); Put_Line (File, " Presentation_Feedback : Thin.Presentation_Feedback_Ptr;"); Put_Line (File, " Output : Protocols.Thin_Client.Output_Ptr)"); Put_Line (File, " is"); Put_Line (File, " pragma Assert (Conversion.To_Pointer (Data).Proxy = " & Name & ");"); Put_Line (File, ""); Put_Line (File, " O : constant Protocols.Client.Output :="); Put_Line (File, " Protocols.Client.Constructors.Set_Proxy (Proxy => Secret_Proxy (Output));"); Put_Line (File, " begin"); Put_Line (File, " Synchronized_Output (Conversion.To_Pointer (Data).all, O);"); Put_Line (File, " end Internal_Sync_Output;"); Put_Line (File, ""); Put_Line (File, " procedure Internal_Presented"); Put_Line (File, " (Data : Void_Ptr;"); Put_Line (File, " Presentation_Feedback : Thin.Presentation_Feedback_Ptr;"); Put_Line (File, " Tv_Sec_Hi : Unsigned_32;"); Put_Line (File, " Tv_Sec_Lo : Unsigned_32;"); Put_Line (File, " Tv_Nsec : Unsigned_32;"); Put_Line (File, " Refresh : Unsigned_32;"); Put_Line (File, " Seq_Hi : Unsigned_32;"); Put_Line (File, " Seq_Lo : Unsigned_32;"); Put_Line (File, " Flags : Enums.Presentation_Time.Presentation_Feedback_Kind)"); Put_Line (File, " is"); Put_Line (File, " pragma Assert (Conversion.To_Pointer (Data).Proxy = " & Name & ");"); Put_Line (File, ""); Put_Line (File, " type Unsigned_64_Group is record"); Put_Line (File, " Low, High : Unsigned_32;"); Put_Line (File, " end record;"); Put_Line (File, ""); Put_Line (File, " for Unsigned_64_Group use record"); Put_Line (File, " Low at 0 range 0 .. 31;"); Put_Line (File, " High at 0 range 32 .. 63;"); Put_Line (File, " end record;"); Put_Line (File, ""); Put_Line (File, " function Convert is new Ada.Unchecked_Conversion"); Put_Line (File, " (Source => Unsigned_64_Group, Target => Unsigned_64);"); Put_Line (File, ""); Put_Line (File, " Seconds : constant Unsigned_64 := Convert ((Low => Tv_Sec_Lo, High => Tv_Sec_Hi));"); Put_Line (File, " Counter : constant Unsigned_64 := Convert ((Low => Seq_Lo, High => Seq_Hi));"); Put_Line (File, ""); Put_Line (File, " Timestamp : constant Duration := Duration (Seconds) + Duration (Tv_Nsec) / 1e9;"); Put_Line (File, " begin"); Put_Line (File, " Presented (Conversion.To_Pointer (Data).all, Timestamp, Duration (Refresh) / 1e9, Counter, Flags);"); Put_Line (File, " end Internal_Presented;"); Put_Line (File, ""); Put_Line (File, " procedure Internal_Discarded"); Put_Line (File, " (Data : Void_Ptr;"); Put_Line (File, " Presentation_Feedback : Thin.Presentation_Feedback_Ptr)"); Put_Line (File, " is"); Put_Line (File, " pragma Assert (Conversion.To_Pointer (Data).Proxy = " & Name & ");"); Put_Line (File, " begin"); Put_Line (File, " Discarded (Conversion.To_Pointer (Data).all);"); Put_Line (File, " end Internal_Discarded;"); Put_Line (File, ""); Put_Line (File, " Listener : aliased Thin." & Name & "_Listener_T :="); Put_Line (File, " (Sync_Output => Internal_Sync_Output'Unrestricted_Access,"); Put_Line (File, " Presented => Internal_Presented'Unrestricted_Access,"); Put_Line (File, " Discarded => Internal_Discarded'Unrestricted_Access);"); Put_Line (File, ""); end if; Generate_Suffix_Body_Events (Name); end Handle_Interface_Events_Presentation_Time; procedure Handle_Interface_Viewporter (Interface_Tag : aliased Wayland_XML.Interface_Tag) is Name : constant String := Xml_Parser_Utils.Adaify_Name (Wayland_XML.Name (Interface_Tag)); begin if Name in "Viewporter" then Generate_Body_Bind_Subprogram (Name); end if; if Name = "Viewporter" then Put_Line (File, ""); Put_Line (File, " procedure Get_Viewport"); Put_Line (File, " (Object : Viewporter;"); Put_Line (File, " Surface : Client.Surface'Class;"); Put_Line (File, " Viewport : in out Protocols.Viewporter.Viewport'Class) is"); Put_Line (File, " begin"); Put_Line (File, " Viewport.Proxy := Thin.Viewporter_Get_Viewport (Object.Proxy, Thin_Client.Surface_Ptr (Surface.Get_Proxy));"); Put_Line (File, " end Get_Viewport;"); elsif Name = "Viewport" then Put_Line (File, ""); Put_Line (File, " procedure Set_Source"); Put_Line (File, " (Object : Viewport;"); Put_Line (File, " X, Y, Width, Height : Fixed) is"); Put_Line (File, " begin"); Put_Line (File, " Thin.Viewport_Set_Source (Object.Proxy, X, Y, Width, Height);"); Put_Line (File, " end Set_Source;"); Put_Line (File, ""); Put_Line (File, " procedure Set_Destination"); Put_Line (File, " (Object : Viewport;"); Put_Line (File, " Width, Height : Integer) is"); Put_Line (File, " begin"); Put_Line (File, " Thin.Viewport_Set_Destination (Object.Proxy, Width, Height);"); Put_Line (File, " end Set_Destination;"); end if; end Handle_Interface_Viewporter; procedure Handle_Interface_Idle_Inhibit (Interface_Tag : aliased Wayland_XML.Interface_Tag) is Name : constant String := Xml_Parser_Utils.Adaify_Name (Wayland_XML.Name (Interface_Tag)); begin if Name in "Idle_Inhibit_Manager_V1" then Generate_Body_Bind_Subprogram (Name); end if; if Name = "Idle_Inhibit_Manager_V1" then Put_Line (File, ""); Put_Line (File, " procedure Create_Inhibitor"); Put_Line (File, " (Object : Idle_Inhibit_Manager_V1;"); Put_Line (File, " Surface : Client.Surface'Class;"); Put_Line (File, " Inhibitor : in out Idle_Inhibitor_V1'Class) is"); Put_Line (File, " begin"); Put_Line (File, " Inhibitor.Proxy := Thin.Idle_Inhibit_Manager_V1_Create_Inhibitor"); Put_Line (File, " (Object.Proxy, Thin_Client.Surface_Ptr (Surface.Get_Proxy));"); Put_Line (File, " end Create_Inhibitor;"); elsif Name = "Idle_Inhibitor_V1" then null; end if; end Handle_Interface_Idle_Inhibit; procedure Handle_Interface_Xdg_Decoration (Interface_Tag : aliased Wayland_XML.Interface_Tag) is Name : constant String := Xml_Parser_Utils.Adaify_Name (Wayland_XML.Name (Interface_Tag)); begin if Name in "Decoration_Manager_V1" then Generate_Body_Bind_Subprogram (Name); end if; if Name = "Decoration_Manager_V1" then Put_Line (File, ""); Put_Line (File, " procedure Get_Toplevel_Decoration"); Put_Line (File, " (Object : Decoration_Manager_V1;"); Put_Line (File, " Toplevel : Xdg_Shell.Xdg_Toplevel'Class;"); Put_Line (File, " Decoration : in out Toplevel_Decoration_V1'Class) is"); Put_Line (File, " begin"); Put_Line (File, " Decoration.Proxy := Thin.Decoration_Manager_V1_Get_Toplevel_Decoration"); Put_Line (File, " (Object.Proxy, Thin_Xdg_Shell.Xdg_Toplevel_Ptr (Toplevel.Get_Proxy));"); Put_Line (File, " end Get_Toplevel_Decoration;"); elsif Name = "Toplevel_Decoration_V1" then Put_Line (File, ""); Put_Line (File, " procedure Set_Mode"); Put_Line (File, " (Object : Toplevel_Decoration_V1;"); Put_Line (File, " Mode : Toplevel_Decoration_V1_Mode) is"); Put_Line (File, " begin"); Put_Line (File, " Thin.Toplevel_Decoration_V1_Set_Mode (Object.Proxy, Mode);"); Put_Line (File, " end Set_Mode;"); Put_Line (File, ""); Put_Line (File, " procedure Unset_Mode (Object : Toplevel_Decoration_V1) is"); Put_Line (File, " begin"); Put_Line (File, " Thin.Toplevel_Decoration_V1_Unset_Mode (Object.Proxy);"); Put_Line (File, " end Unset_Mode;"); end if; end Handle_Interface_Xdg_Decoration; procedure Handle_Interface_Events_Xdg_Decoration (Interface_Tag : aliased Wayland_XML.Interface_Tag) is Name : constant String := Xml_Parser_Utils.Adaify_Name (Wayland_XML.Name (Interface_Tag)); begin if not Exists_Events (Interface_Tag) then return; end if; Generate_Prefix_Body_Events (Name); if Name = "Toplevel_Decoration_V1" then Put_Line (File, " procedure Internal_Configure"); Put_Line (File, " (Data : Void_Ptr;"); Put_Line (File, " Toplevel_Decoration_V1 : Thin.Toplevel_Decoration_V1_Ptr;"); Put_Line (File, " Mode : Toplevel_Decoration_V1_Mode)"); Put_Line (File, " with Convention => C;"); Put_Line (File, ""); Put_Line (File, " procedure Internal_Configure"); Put_Line (File, " (Data : Void_Ptr;"); Put_Line (File, " Toplevel_Decoration_V1 : Thin.Toplevel_Decoration_V1_Ptr;"); Put_Line (File, " Mode : Toplevel_Decoration_V1_Mode)"); Put_Line (File, " is"); Put_Line (File, " pragma Assert (Conversion.To_Pointer (Data).Proxy = " & Name & ");"); Put_Line (File, " begin"); Put_Line (File, " Configure (Conversion.To_Pointer (Data).all, Mode);"); Put_Line (File, " end Internal_Configure;"); Put_Line (File, ""); Put_Line (File, " Listener : aliased Thin." & Name & "_Listener_T :="); Put_Line (File, " (Configure => Internal_Configure'Unrestricted_Access);"); Put_Line (File, ""); end if; Generate_Suffix_Body_Events (Name); end Handle_Interface_Events_Xdg_Decoration; procedure Handle_Interface_Relative_Pointer (Interface_Tag : aliased Wayland_XML.Interface_Tag) is Name : constant String := Xml_Parser_Utils.Adaify_Name (Wayland_XML.Name (Interface_Tag)); begin if Name in "Relative_Pointer_Manager_V1" then Generate_Body_Bind_Subprogram (Name); end if; if Name = "Relative_Pointer_Manager_V1" then Put_Line (File, ""); Put_Line (File, " procedure Get_Relative_Pointer"); Put_Line (File, " (Object : Relative_Pointer_Manager_V1;"); Put_Line (File, " Pointer : Client.Pointer'Class;"); Put_Line (File, " Relative : in out Relative_Pointer_V1'Class) is"); Put_Line (File, " begin"); Put_Line (File, " Relative.Proxy := Thin.Relative_Pointer_Manager_V1_Get_Relative_Pointer (Object.Proxy, Thin_Client.Pointer_Ptr (Pointer.Get_Proxy));"); Put_Line (File, " end Get_Relative_Pointer;"); elsif Name = "Toplevel_Decoration_V1" then null; end if; end Handle_Interface_Relative_Pointer; procedure Handle_Interface_Events_Relative_Pointer (Interface_Tag : aliased Wayland_XML.Interface_Tag) is Name : constant String := Xml_Parser_Utils.Adaify_Name (Wayland_XML.Name (Interface_Tag)); begin if not Exists_Events (Interface_Tag) then return; end if; Generate_Prefix_Body_Events (Name); if Name = "Relative_Pointer_V1" then Put_Line (File, " procedure Internal_Relative_Motion"); Put_Line (File, " (Data : Void_Ptr;"); Put_Line (File, " Relative_Pointer_V1 : Thin.Relative_Pointer_V1_Ptr;"); Put_Line (File, " Utime_Hi : Unsigned_32;"); Put_Line (File, " Utime_Lo : Unsigned_32;"); Put_Line (File, " Dx : Fixed;"); Put_Line (File, " Dy : Fixed;"); Put_Line (File, " Dx_Unaccel : Fixed;"); Put_Line (File, " Dy_Unaccel : Fixed)"); Put_Line (File, " with Convention => C;"); Put_Line (File, ""); Put_Line (File, " procedure Internal_Relative_Motion"); Put_Line (File, " (Data : Void_Ptr;"); Put_Line (File, " Relative_Pointer_V1 : Thin.Relative_Pointer_V1_Ptr;"); Put_Line (File, " Utime_Hi : Unsigned_32;"); Put_Line (File, " Utime_Lo : Unsigned_32;"); Put_Line (File, " Dx : Fixed;"); Put_Line (File, " Dy : Fixed;"); Put_Line (File, " Dx_Unaccel : Fixed;"); Put_Line (File, " Dy_Unaccel : Fixed)"); Put_Line (File, " is"); Put_Line (File, " pragma Assert (Conversion.To_Pointer (Data).Proxy = " & Name & ");"); Put_Line (File, ""); Put_Line (File, " type Unsigned_64_Group is record"); Put_Line (File, " Low, High : Unsigned_32;"); Put_Line (File, " end record;"); Put_Line (File, ""); Put_Line (File, " for Unsigned_64_Group use record"); Put_Line (File, " Low at 0 range 0 .. 31;"); Put_Line (File, " High at 0 range 32 .. 63;"); Put_Line (File, " end record;"); Put_Line (File, ""); Put_Line (File, " function Convert is new Ada.Unchecked_Conversion"); Put_Line (File, " (Source => Unsigned_64_Group, Target => Unsigned_64);"); Put_Line (File, ""); Put_Line (File, " Microseconds : constant Unsigned_64 := Convert ((Low => Utime_Lo, High => Utime_Hi));"); Put_Line (File, ""); Put_Line (File, " Timestamp : constant Duration := Duration (Microseconds / 1e6) + Duration (Microseconds mod 1e6) / 1e6;"); Put_Line (File, " begin"); Put_Line (File, " Relative_Motion (Conversion.To_Pointer (Data).all, Timestamp, Dx, Dy, Dx_Unaccel, Dy_Unaccel);"); Put_Line (File, " end Internal_Relative_Motion;"); Put_Line (File, ""); Put_Line (File, " Listener : aliased Thin." & Name & "_Listener_T :="); Put_Line (File, " (Relative_Motion => Internal_Relative_Motion'Unrestricted_Access);"); Put_Line (File, ""); end if; Generate_Suffix_Body_Events (Name); end Handle_Interface_Events_Relative_Pointer; procedure Handle_Interface_Pointer_Constraints (Interface_Tag : aliased Wayland_XML.Interface_Tag) is Name : constant String := Xml_Parser_Utils.Adaify_Name (Wayland_XML.Name (Interface_Tag)); begin if Name in "Pointer_Constraints_V1" then Generate_Body_Bind_Subprogram (Name); end if; if Name = "Pointer_Constraints_V1" then Put_Line (File, ""); Put_Line (File, " procedure Lock_Pointer"); Put_Line (File, " (Object : Pointer_Constraints_V1;"); Put_Line (File, " Surface : Client.Surface'Class;"); Put_Line (File, " Pointer : Client.Pointer'Class;"); Put_Line (File, " Region : Client.Region'Class;"); Put_Line (File, " Lifetime : Pointer_Constraints_V1_Lifetime;"); Put_Line (File, " Locked : in out Locked_Pointer_V1'Class) is"); Put_Line (File, " begin"); Put_Line (File, " Locked.Proxy := Thin.Pointer_Constraints_V1_Lock_Pointer"); Put_Line (File, " (Object.Proxy,"); Put_Line (File, " Thin_Client.Surface_Ptr (Surface.Get_Proxy),"); Put_Line (File, " Thin_Client.Pointer_Ptr (Pointer.Get_Proxy),"); Put_Line (File, " Thin_Client.Region_Ptr (Region.Get_Proxy),"); Put_Line (File, " Lifetime);"); Put_Line (File, " end Lock_Pointer;"); Put_Line (File, ""); Put_Line (File, " procedure Confine_Pointer"); Put_Line (File, " (Object : Pointer_Constraints_V1;"); Put_Line (File, " Surface : Client.Surface'Class;"); Put_Line (File, " Pointer : Client.Pointer'Class;"); Put_Line (File, " Region : Client.Region'Class;"); Put_Line (File, " Lifetime : Pointer_Constraints_V1_Lifetime;"); Put_Line (File, " Confined : in out Confined_Pointer_V1'Class) is"); Put_Line (File, " begin"); Put_Line (File, " Confined.Proxy := Thin.Pointer_Constraints_V1_Confine_Pointer"); Put_Line (File, " (Object.Proxy,"); Put_Line (File, " Thin_Client.Surface_Ptr (Surface.Get_Proxy),"); Put_Line (File, " Thin_Client.Pointer_Ptr (Pointer.Get_Proxy),"); Put_Line (File, " Thin_Client.Region_Ptr (Region.Get_Proxy),"); Put_Line (File, " Lifetime);"); Put_Line (File, " end Confine_Pointer;"); elsif Name = "Locked_Pointer_V1" then Put_Line (File, ""); Put_Line (File, " procedure Set_Cursor_Position_Hint"); Put_Line (File, " (Object : Locked_Pointer_V1;"); Put_Line (File, " X, Y : Fixed) is"); Put_Line (File, " begin"); Put_Line (File, " Thin.Locked_Pointer_V1_Set_Cursor_Position_Hint (Object.Proxy, X, Y);"); Put_Line (File, " end Set_Cursor_Position_Hint;"); Put_Line (File, ""); Put_Line (File, " procedure Set_Region"); Put_Line (File, " (Object : Locked_Pointer_V1;"); Put_Line (File, " Region : Client.Region'Class) is"); Put_Line (File, " begin"); Put_Line (File, " Thin.Locked_Pointer_V1_Set_Region (Object.Proxy, Thin_Client.Region_Ptr (Region.Get_Proxy));"); Put_Line (File, " end Set_Region;"); elsif Name = "Confined_Pointer_V1" then Put_Line (File, ""); Put_Line (File, " procedure Set_Region"); Put_Line (File, " (Object : Confined_Pointer_V1;"); Put_Line (File, " Region : Client.Region'Class) is"); Put_Line (File, " begin"); Put_Line (File, " Thin.Confined_Pointer_V1_Set_Region (Object.Proxy, Thin_Client.Region_Ptr (Region.Get_Proxy));"); Put_Line (File, " end Set_Region;"); end if; end Handle_Interface_Pointer_Constraints; procedure Handle_Interface_Events_Pointer_Constraints (Interface_Tag : aliased Wayland_XML.Interface_Tag) is Name : constant String := Xml_Parser_Utils.Adaify_Name (Wayland_XML.Name (Interface_Tag)); begin if not Exists_Events (Interface_Tag) then return; end if; Generate_Prefix_Body_Events (Name); if Name = "Locked_Pointer_V1" then Put_Line (File, " procedure Internal_Locked"); Put_Line (File, " (Data : Void_Ptr;"); Put_Line (File, " Locked_Pointer_V1 : Thin.Locked_Pointer_V1_Ptr)"); Put_Line (File, " with Convention => C;"); Put_Line (File, ""); Put_Line (File, " procedure Internal_Unlocked"); Put_Line (File, " (Data : Void_Ptr;"); Put_Line (File, " Locked_Pointer_V1 : Thin.Locked_Pointer_V1_Ptr)"); Put_Line (File, " with Convention => C;"); Put_Line (File, ""); Put_Line (File, " procedure Internal_Locked"); Put_Line (File, " (Data : Void_Ptr;"); Put_Line (File, " Locked_Pointer_V1 : Thin.Locked_Pointer_V1_Ptr)"); Put_Line (File, " is"); Put_Line (File, " pragma Assert (Conversion.To_Pointer (Data).Proxy = " & Name & ");"); Put_Line (File, " begin"); Put_Line (File, " Locked (Conversion.To_Pointer (Data).all);"); Put_Line (File, " end Internal_Locked;"); Put_Line (File, ""); Put_Line (File, " procedure Internal_Unlocked"); Put_Line (File, " (Data : Void_Ptr;"); Put_Line (File, " Locked_Pointer_V1 : Thin.Locked_Pointer_V1_Ptr)"); Put_Line (File, " is"); Put_Line (File, " pragma Assert (Conversion.To_Pointer (Data).Proxy = " & Name & ");"); Put_Line (File, " begin"); Put_Line (File, " Unlocked (Conversion.To_Pointer (Data).all);"); Put_Line (File, " end Internal_Unlocked;"); Put_Line (File, ""); Put_Line (File, " Listener : aliased Thin." & Name & "_Listener_T :="); Put_Line (File, " (Locked => Internal_Locked'Unrestricted_Access,"); Put_Line (File, " Unlocked => Internal_Unlocked'Unrestricted_Access);"); Put_Line (File, ""); elsif Name = "Confined_Pointer_V1" then Put_Line (File, " procedure Internal_Confined"); Put_Line (File, " (Data : Void_Ptr;"); Put_Line (File, " Confined_Pointer_V1 : Thin.Confined_Pointer_V1_Ptr)"); Put_Line (File, " with Convention => C;"); Put_Line (File, ""); Put_Line (File, " procedure Internal_Unconfined"); Put_Line (File, " (Data : Void_Ptr;"); Put_Line (File, " Confined_Pointer_V1 : Thin.Confined_Pointer_V1_Ptr)"); Put_Line (File, " with Convention => C;"); Put_Line (File, ""); Put_Line (File, " procedure Internal_Confined"); Put_Line (File, " (Data : Void_Ptr;"); Put_Line (File, " Confined_Pointer_V1 : Thin.Confined_Pointer_V1_Ptr)"); Put_Line (File, " is"); Put_Line (File, " pragma Assert (Conversion.To_Pointer (Data).Proxy = " & Name & ");"); Put_Line (File, " begin"); Put_Line (File, " Confined (Conversion.To_Pointer (Data).all);"); Put_Line (File, " end Internal_Confined;"); Put_Line (File, ""); Put_Line (File, " procedure Internal_Unconfined"); Put_Line (File, " (Data : Void_Ptr;"); Put_Line (File, " Confined_Pointer_V1 : Thin.Confined_Pointer_V1_Ptr)"); Put_Line (File, " is"); Put_Line (File, " pragma Assert (Conversion.To_Pointer (Data).Proxy = " & Name & ");"); Put_Line (File, " begin"); Put_Line (File, " Unconfined (Conversion.To_Pointer (Data).all);"); Put_Line (File, " end Internal_Unconfined;"); Put_Line (File, ""); Put_Line (File, " Listener : aliased Thin." & Name & "_Listener_T :="); Put_Line (File, " (Confined => Internal_Confined'Unrestricted_Access,"); Put_Line (File, " Unconfined => Internal_Unconfined'Unrestricted_Access);"); Put_Line (File, ""); end if; Generate_Suffix_Body_Events (Name); end Handle_Interface_Events_Pointer_Constraints; procedure Handle_Interface_Pointer_Gestures (Interface_Tag : aliased Wayland_XML.Interface_Tag) is Name : constant String := Xml_Parser_Utils.Adaify_Name (Wayland_XML.Name (Interface_Tag)); begin if Name in "Pointer_Gestures_V1" then Generate_Body_Bind_Subprogram (Name); end if; if Name in "Pointer_Gestures_V1" then Put_Line (File, ""); Put_Line (File, " procedure Get_Swipe_Gesture"); Put_Line (File, " (Object : Pointer_Gestures_V1;"); Put_Line (File, " Pointer : Client.Pointer'Class;"); Put_Line (File, " Gesture : in out Pointer_Gesture_Swipe_V1'Class) is"); Put_Line (File, " begin"); Put_Line (File, " Gesture.Proxy := Thin.Pointer_Gestures_V1_Get_Swipe_Gesture"); Put_Line (File, " (Object.Proxy, Thin_Client.Pointer_Ptr (Pointer.Get_Proxy));"); Put_Line (File, " end Get_Swipe_Gesture;"); Put_Line (File, ""); Put_Line (File, " procedure Get_Pinch_Gesture"); Put_Line (File, " (Object : Pointer_Gestures_V1;"); Put_Line (File, " Pointer : Client.Pointer'Class;"); Put_Line (File, " Gesture : in out Pointer_Gesture_Pinch_V1'Class) is"); Put_Line (File, " begin"); Put_Line (File, " Gesture.Proxy := Thin.Pointer_Gestures_V1_Get_Pinch_Gesture"); Put_Line (File, " (Object.Proxy, Thin_Client.Pointer_Ptr (Pointer.Get_Proxy));"); Put_Line (File, " end Get_Pinch_Gesture;"); end if; end Handle_Interface_Pointer_Gestures; procedure Handle_Interface_Events_Pointer_Gestures (Interface_Tag : aliased Wayland_XML.Interface_Tag) is Name : constant String := Xml_Parser_Utils.Adaify_Name (Wayland_XML.Name (Interface_Tag)); begin if not Exists_Events (Interface_Tag) then return; end if; Generate_Prefix_Body_Events (Name); if Name = "Pointer_Gesture_Swipe_V1" then Put_Line (File, " procedure Internal_Begin"); Put_Line (File, " (Data : Void_Ptr;"); Put_Line (File, " Pointer_Gesture_Swipe_V1 : Thin.Pointer_Gesture_Swipe_V1_Ptr;"); Put_Line (File, " Serial : Unsigned_32;"); Put_Line (File, " Time : Unsigned_32;"); Put_Line (File, " Surface : Thin_Client.Surface_Ptr;"); Put_Line (File, " Fingers : Unsigned_32)"); Put_Line (File, " with Convention => C;"); Put_Line (File, ""); Put_Line (File, " procedure Internal_Update"); Put_Line (File, " (Data : Void_Ptr;"); Put_Line (File, " Pointer_Gesture_Swipe_V1 : Thin.Pointer_Gesture_Swipe_V1_Ptr;"); Put_Line (File, " Time : Unsigned_32;"); Put_Line (File, " Dx : Fixed;"); Put_Line (File, " Dy : Fixed)"); Put_Line (File, " with Convention => C;"); Put_Line (File, ""); Put_Line (File, " procedure Internal_End"); Put_Line (File, " (Data : Void_Ptr;"); Put_Line (File, " Pointer_Gesture_Swipe_V1 : Thin.Pointer_Gesture_Swipe_V1_Ptr;"); Put_Line (File, " Serial : Unsigned_32;"); Put_Line (File, " Time : Unsigned_32;"); Put_Line (File, " Cancelled : Integer)"); Put_Line (File, " with Convention => C;"); Put_Line (File, ""); Put_Line (File, " procedure Internal_Begin"); Put_Line (File, " (Data : Void_Ptr;"); Put_Line (File, " Pointer_Gesture_Swipe_V1 : Thin.Pointer_Gesture_Swipe_V1_Ptr;"); Put_Line (File, " Serial : Unsigned_32;"); Put_Line (File, " Time : Unsigned_32;"); Put_Line (File, " Surface : Thin_Client.Surface_Ptr;"); Put_Line (File, " Fingers : Unsigned_32)"); Put_Line (File, " is"); Put_Line (File, " pragma Assert (Conversion.To_Pointer (Data).Proxy = " & Name & ");"); Put_Line (File, ""); Put_Line (File, " Timestamp : constant Duration := Duration (Time) / 1e3;"); Put_Line (File, ""); Put_Line (File, " S : constant Protocols.Client.Surface :="); Put_Line (File, " Protocols.Client.Constructors.Set_Proxy (Proxy => Secret_Proxy (Surface));"); Put_Line (File, " begin"); Put_Line (File, " Gesture_Begin (Conversion.To_Pointer (Data).all, Serial, Timestamp, S, Fingers);"); Put_Line (File, " end Internal_Begin;"); Put_Line (File, ""); Put_Line (File, " procedure Internal_Update"); Put_Line (File, " (Data : Void_Ptr;"); Put_Line (File, " Pointer_Gesture_Swipe_V1 : Thin.Pointer_Gesture_Swipe_V1_Ptr;"); Put_Line (File, " Time : Unsigned_32;"); Put_Line (File, " Dx : Fixed;"); Put_Line (File, " Dy : Fixed)"); Put_Line (File, " is"); Put_Line (File, " pragma Assert (Conversion.To_Pointer (Data).Proxy = " & Name & ");"); Put_Line (File, ""); Put_Line (File, " Timestamp : constant Duration := Duration (Time) / 1e3;"); Put_Line (File, " begin"); Put_Line (File, " Gesture_Update (Conversion.To_Pointer (Data).all, Timestamp, Dx, Dy);"); Put_Line (File, " end Internal_Update;"); Put_Line (File, ""); Put_Line (File, " procedure Internal_End"); Put_Line (File, " (Data : Void_Ptr;"); Put_Line (File, " Pointer_Gesture_Swipe_V1 : Thin.Pointer_Gesture_Swipe_V1_Ptr;"); Put_Line (File, " Serial : Unsigned_32;"); Put_Line (File, " Time : Unsigned_32;"); Put_Line (File, " Cancelled : Integer)"); Put_Line (File, " is"); Put_Line (File, " pragma Assert (Conversion.To_Pointer (Data).Proxy = " & Name & ");"); Put_Line (File, ""); Put_Line (File, " Timestamp : constant Duration := Duration (Time) / 1e3;"); Put_Line (File, " begin"); Put_Line (File, " Gesture_End (Conversion.To_Pointer (Data).all, Serial, Timestamp, Cancelled = 1);"); Put_Line (File, " end Internal_End;"); Put_Line (File, ""); Put_Line (File, " Listener : aliased Thin." & Name & "_Listener_T :="); Put_Line (File, " (Begin_F => Internal_Begin'Unrestricted_Access,"); Put_Line (File, " Update => Internal_Update'Unrestricted_Access,"); Put_Line (File, " End_F => Internal_End'Unrestricted_Access);"); Put_Line (File, ""); elsif Name = "Pointer_Gesture_Pinch_V1" then Put_Line (File, " procedure Internal_Begin"); Put_Line (File, " (Data : Void_Ptr;"); Put_Line (File, " Pointer_Gesture_Pinch_V1 : Thin.Pointer_Gesture_Pinch_V1_Ptr;"); Put_Line (File, " Serial : Unsigned_32;"); Put_Line (File, " Time : Unsigned_32;"); Put_Line (File, " Surface : Thin_Client.Surface_Ptr;"); Put_Line (File, " Fingers : Unsigned_32)"); Put_Line (File, " with Convention => C;"); Put_Line (File, ""); Put_Line (File, " procedure Internal_Update"); Put_Line (File, " (Data : Void_Ptr;"); Put_Line (File, " Pointer_Gesture_Pinch_V1 : Thin.Pointer_Gesture_Pinch_V1_Ptr;"); Put_Line (File, " Time : Unsigned_32;"); Put_Line (File, " Dx : Fixed;"); Put_Line (File, " Dy : Fixed;"); Put_Line (File, " Scale : Fixed;"); Put_Line (File, " Rotation : Fixed)"); Put_Line (File, " with Convention => C;"); Put_Line (File, ""); Put_Line (File, " procedure Internal_End"); Put_Line (File, " (Data : Void_Ptr;"); Put_Line (File, " Pointer_Gesture_Pinch_V1 : Thin.Pointer_Gesture_Pinch_V1_Ptr;"); Put_Line (File, " Serial : Unsigned_32;"); Put_Line (File, " Time : Unsigned_32;"); Put_Line (File, " Cancelled : Integer)"); Put_Line (File, " with Convention => C;"); Put_Line (File, ""); Put_Line (File, " procedure Internal_Begin"); Put_Line (File, " (Data : Void_Ptr;"); Put_Line (File, " Pointer_Gesture_Pinch_V1 : Thin.Pointer_Gesture_Pinch_V1_Ptr;"); Put_Line (File, " Serial : Unsigned_32;"); Put_Line (File, " Time : Unsigned_32;"); Put_Line (File, " Surface : Thin_Client.Surface_Ptr;"); Put_Line (File, " Fingers : Unsigned_32)"); Put_Line (File, " is"); Put_Line (File, " pragma Assert (Conversion.To_Pointer (Data).Proxy = " & Name & ");"); Put_Line (File, ""); Put_Line (File, " Timestamp : constant Duration := Duration (Time) / 1e3;"); Put_Line (File, ""); Put_Line (File, " S : constant Protocols.Client.Surface :="); Put_Line (File, " Protocols.Client.Constructors.Set_Proxy (Proxy => Secret_Proxy (Surface));"); Put_Line (File, " begin"); Put_Line (File, " Gesture_Begin (Conversion.To_Pointer (Data).all, Serial, Timestamp, S, Fingers);"); Put_Line (File, " end Internal_Begin;"); Put_Line (File, ""); Put_Line (File, " procedure Internal_Update"); Put_Line (File, " (Data : Void_Ptr;"); Put_Line (File, " Pointer_Gesture_Pinch_V1 : Thin.Pointer_Gesture_Pinch_V1_Ptr;"); Put_Line (File, " Time : Unsigned_32;"); Put_Line (File, " Dx : Fixed;"); Put_Line (File, " Dy : Fixed;"); Put_Line (File, " Scale : Fixed;"); Put_Line (File, " Rotation : Fixed)"); Put_Line (File, " is"); Put_Line (File, " pragma Assert (Conversion.To_Pointer (Data).Proxy = " & Name & ");"); Put_Line (File, ""); Put_Line (File, " Timestamp : constant Duration := Duration (Time) / 1e3;"); Put_Line (File, " begin"); Put_Line (File, " Gesture_Update (Conversion.To_Pointer (Data).all, Timestamp, Dx, Dy, Scale, Rotation);"); Put_Line (File, " end Internal_Update;"); Put_Line (File, ""); Put_Line (File, " procedure Internal_End"); Put_Line (File, " (Data : Void_Ptr;"); Put_Line (File, " Pointer_Gesture_Pinch_V1 : Thin.Pointer_Gesture_Pinch_V1_Ptr;"); Put_Line (File, " Serial : Unsigned_32;"); Put_Line (File, " Time : Unsigned_32;"); Put_Line (File, " Cancelled : Integer)"); Put_Line (File, " is"); Put_Line (File, " pragma Assert (Conversion.To_Pointer (Data).Proxy = " & Name & ");"); Put_Line (File, ""); Put_Line (File, " Timestamp : constant Duration := Duration (Time) / 1e3;"); Put_Line (File, " begin"); Put_Line (File, " Gesture_End (Conversion.To_Pointer (Data).all, Serial, Timestamp, Cancelled = 1);"); Put_Line (File, " end Internal_End;"); Put_Line (File, ""); Put_Line (File, " Listener : aliased Thin." & Name & "_Listener_T :="); Put_Line (File, " (Begin_F => Internal_Begin'Unrestricted_Access,"); Put_Line (File, " Update => Internal_Update'Unrestricted_Access,"); Put_Line (File, " End_F => Internal_End'Unrestricted_Access);"); Put_Line (File, ""); end if; Generate_Suffix_Body_Events (Name); end Handle_Interface_Events_Pointer_Gestures; procedure Handle_Interface_Common_Subprograms (Interface_Tag : aliased Wayland_XML.Interface_Tag) is Name : constant String := Xml_Parser_Utils.Adaify_Name (Wayland_XML.Name (Interface_Tag)); begin if Protocol_Name /= "client" or Name /= "Display" then Generate_Body_Destroy_Subprogram (Interface_Tag); end if; Generate_Body_Utility_Functions (Name); if Protocol_Name /= "client" or Name /= "Display" then Generate_Body_User_Data_Subprogram (Name); end if; end Handle_Interface_Common_Subprograms; procedure Handle_Interface_Common_Events (Interface_Tag : aliased Wayland_XML.Interface_Tag) is Name : constant String := Xml_Parser_Utils.Adaify_Name (Wayland_XML.Name (Interface_Tag)); begin if not Exists_Events (Interface_Tag) then return; end if; Generate_Prefix_Body_Events (Name); Put_Line (File, " -- FIXME Add internal procedures here"); Put_Line (File, ""); Put_Line (File, " Listener : aliased Thin." & Name & "_Listener_T :="); Put_Line (File, " (FIXME => Internal_FIXME'Unrestricted_Access);"); Put_Line (File, ""); Generate_Suffix_Body_Events (Name); end Handle_Interface_Common_Events; begin Put_Line (File, " subtype int is Interfaces.C.int;"); Put_Line (File, " subtype chars_ptr is Interfaces.C.Strings.chars_ptr;"); Put_Line (File, ""); Put_Line (File, " use type int;"); Put_Line (File, " use all type chars_ptr;"); Put_Line (File, ""); Put_Line (File, " use type Thin.Proxy_Ptr;"); Iterate_Over_Interfaces (Handle_Interface_Common_Subprograms'Access); if Protocol_Name = "client" then Handle_Interface_Client_Prefix; Iterate_Over_Interfaces (Handle_Interface_Events_Client'Access); Iterate_Over_Interfaces (Handle_Interface_Client'Access); Handle_Interface_Client_Suffix; elsif Protocol_Name = "xdg_shell" then Iterate_Over_Interfaces (Handle_Interface_Events_Xdg_Shell'Access); Iterate_Over_Interfaces (Handle_Interface_Xdg_Shell'Access); elsif Protocol_Name = "presentation_time" then Iterate_Over_Interfaces (Handle_Interface_Events_Presentation_Time'Access); Iterate_Over_Interfaces (Handle_Interface_Presentation_Time'Access); elsif Protocol_Name = "viewporter" then Iterate_Over_Interfaces (Handle_Interface_Viewporter'Access); elsif Protocol_Name = "idle_inhibit_unstable_v1" then Iterate_Over_Interfaces (Handle_Interface_Idle_Inhibit'Access); elsif Protocol_Name = "xdg_decoration_unstable_v1" then Iterate_Over_Interfaces (Handle_Interface_Events_Xdg_Decoration'Access); Iterate_Over_Interfaces (Handle_Interface_Xdg_Decoration'Access); elsif Protocol_Name = "relative_pointer_unstable_v1" then Iterate_Over_Interfaces (Handle_Interface_Events_Relative_Pointer'Access); Iterate_Over_Interfaces (Handle_Interface_Relative_Pointer'Access); elsif Protocol_Name = "pointer_constraints_unstable_v1" then Iterate_Over_Interfaces (Handle_Interface_Events_Pointer_Constraints'Access); Iterate_Over_Interfaces (Handle_Interface_Pointer_Constraints'Access); elsif Protocol_Name = "pointer_gestures_unstable_v1" then Iterate_Over_Interfaces (Handle_Interface_Events_Pointer_Gestures'Access); Iterate_Over_Interfaces (Handle_Interface_Pointer_Gestures'Access); else Iterate_Over_Interfaces (Handle_Interface_Common_Events'Access); end if; Put_Line (File, ""); end Generate_Manually_Edited_Code; begin Create_File; end Create_Wayland_Body_File; begin Read_Wayland_XML_File (File_Name => Ada.Command_Line.Argument (1), Out_Folder => Ada.Command_Line.Argument (2), Enable_Comments => False); end Wayland_Ada_Scanner;
55.882942
190
0.498091
3d76521c71c4c53873749d6198f170c2ba91335a
3,803
adb
Ada
firmware/coreboot/3rdparty/libhwbase/common/direct/hw-pci-dev.adb
fabiojna02/OpenCellular
45b6a202d6b2e2485c89955b9a6da920c4d56ddb
[ "CC-BY-4.0", "BSD-3-Clause" ]
1
2019-11-04T07:11:25.000Z
2019-11-04T07:11:25.000Z
firmware/coreboot/3rdparty/libhwbase/common/direct/hw-pci-dev.adb
aimin-wang/OpenCellular
5308146bf7edf43cc81c0e4d15305b711117070a
[ "CC-BY-4.0", "BSD-3-Clause" ]
13
2018-10-12T21:29:09.000Z
2018-10-25T20:06:51.000Z
firmware/coreboot/3rdparty/libhwbase/common/direct/hw-pci-dev.adb
aimin-wang/OpenCellular
5308146bf7edf43cc81c0e4d15305b711117070a
[ "CC-BY-4.0", "BSD-3-Clause" ]
null
null
null
-- -- Copyright (C) 2017 Nico Huber <[email protected]> -- -- This program is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation; either version 2 of the License, or -- (at your option) any later version. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU General Public License for more details. -- with HW.Config; with HW.PCI.MMConf; with HW.MMIO_Range; pragma Elaborate_All (HW.MMIO_Range); package body HW.PCI.Dev with Refined_State => (Address_State => MM.Address_State, PCI_State => MM.PCI_State) is package MM is new HW.PCI.MMConf (Dev); procedure Read8 (Value : out Word8; Offset : Index) renames MM.Read8; procedure Read16 (Value : out Word16; Offset : Index) renames MM.Read16; procedure Read32 (Value : out Word32; Offset : Index) renames MM.Read32; procedure Write8 (Offset : Index; Value : Word8) renames MM.Write8; procedure Write16 (Offset : Index; Value : Word16) renames MM.Write16; procedure Write32 (Offset : Index; Value : Word32) renames MM.Write32; procedure Map (Addr : out Word64; Res : in Resource; Length : in Natural := 0; Offset : in Natural := 0; WC : in Boolean := False) is use type HW.Word8; use type HW.Word32; Header_Type : Word8; Reg32 : Word32; begin Addr := 0; Read8 (Header_Type, PCI.Header_Type); if (Header_Type and Header_Type_Mask) = Header_Type_Normal then Read32 (Reg32, Base_Address (Res)); if (Reg32 and Base_Address_Space_Mask) = Base_Address_Space_Mem then case Reg32 and Base_Address_Mem_Type_Mask is when Base_Address_Mem_Type_64 => if Res < Res5 then Addr := Word64 (Reg32 and Base_Address_Mem_Mask); Read32 (Reg32, Base_Address (Resource'Succ (Res))); Addr := Addr or Shift_Left (Word64 (Reg32), 32); end if; when others => Addr := Word64 (Reg32 and Base_Address_Mem_Mask); end case; end if; end if; if Addr /= 0 then if Length = 0 or else Addr <= Word64'Last - Word64 (Length) - Word64 (Offset) + 1 then Addr := Addr + Word64 (Offset); else Addr := 0; end if; end if; end Map; procedure Resource_Size (Length : out Natural; Res : Resource) is use Type HW.Word16; use Type HW.Word32; Cmd : Word16; Base, Backup : Word32; begin Length := 0; Read16 (Cmd, PCI.Command); Write16 (PCI.Command, Cmd and not PCI.Command_Memory); Read32 (Backup, Base_Address (Res)); if (Backup and Base_Address_Space_Mask) = Base_Address_Space_Mem then Write32 (Base_Address (Res), 16#ffff_ffff#); Read32 (Base, Base_Address (Res)); Base := not (Base and Base_Address_Mem_Mask) + 1; if Base <= Word32 (Natural'Last) then Length := Natural (Base); end if; Write32 (Base_Address (Res), Backup); end if; Write16 (PCI.Command, Cmd); end Resource_Size; procedure Initialize (Success : out Boolean; MMConf_Base : Word64 := 0) is begin if MMConf_Base /= 0 then MM.Set_Base_Address (MMConf_Base); else MM.Set_Base_Address (Config.Default_MMConf_Base); end if; Success := MMConf_Base /= 0 or Config.Default_MMConf_Base_Set; end Initialize; end HW.PCI.Dev;
32.228814
77
0.614515
29c9840dfa4a15db374eaa4970596de4212800a5
973
adb
Ada
contrib/gnu/gdb/dist/gdb/testsuite/gdb.ada/mi_string_access/bar.adb
TheSledgeHammer/2.11BSD
fe61f0b9aaa273783cd027c7b5ec77e95ead2153
[ "BSD-3-Clause" ]
3
2021-05-04T17:09:06.000Z
2021-10-04T07:19:26.000Z
contrib/gnu/gdb/dist/gdb/testsuite/gdb.ada/mi_string_access/bar.adb
TheSledgeHammer/2.11BSD
fe61f0b9aaa273783cd027c7b5ec77e95ead2153
[ "BSD-3-Clause" ]
null
null
null
contrib/gnu/gdb/dist/gdb/testsuite/gdb.ada/mi_string_access/bar.adb
TheSledgeHammer/2.11BSD
fe61f0b9aaa273783cd027c7b5ec77e95ead2153
[ "BSD-3-Clause" ]
null
null
null
-- Copyright 2018-2020 Free Software Foundation, Inc. -- -- This program is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation; either version 3 of the License, or -- (at your option) any later version. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT 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 -- along with this program. If not, see <http://www.gnu.org/licenses/>. with Pck; use Pck; procedure Bar is type String_Access is access String; type Array_Of_String is array (1 .. 2) of String_Access; Aos : Array_Of_String := (new String'("ab"), new String'("cd")); begin Do_Nothing (Aos'Address); -- STOP end Bar;
38.92
73
0.723535
597b91a50d09bf2ecb37da7bde9362932f1f41ae
4,264
adb
Ada
Des_Ada/src/p_deshandler.adb
VMika/Des_Ada
fcadb38aa9118e668329c3443d3b6e4c83456acc
[ "MIT" ]
null
null
null
Des_Ada/src/p_deshandler.adb
VMika/Des_Ada
fcadb38aa9118e668329c3443d3b6e4c83456acc
[ "MIT" ]
null
null
null
Des_Ada/src/p_deshandler.adb
VMika/Des_Ada
fcadb38aa9118e668329c3443d3b6e4c83456acc
[ "MIT" ]
null
null
null
with P_StructuralTypes; use P_StructuralTypes; with Ada.Text_IO; use Ada.Text_IO; with Ada.Sequential_IO; with Ada.Characters.Handling; use Ada.Characters.Handling; with Ada.Strings.Unbounded.Text_IO; with Ada.Streams; use Ada.Streams; with Ada.Integer_Text_IO; use Ada.Integer_Text_IO; with Ada.Calendar; use Ada.Calendar; package body P_deshandler is procedure Process (Self : in out DesHandler) is InputLink : aliased InputHandler; IPLink : aliased IPHandler; KeyGenLink : aliased KeyHandler; FeistelLink : aliased FeistelHandler; ReverseIPLink : aliased ReverseIPHandler; OutputLink : aliased OutputHandler; Start : Time; Finish : Time; Final_Time : Duration; begin Self.Process_Request; Start := Clock; InputLink := Make (InputLink,Self.Input_Name); IPLink := Make (IPLink); KeyGenLink := Make (KeyGenLink); FeistelLink := Make (FeistelLink); FeistelLink.Set_Mode(Self.Mode); ReverseIPLink := Make (ReverseIPLink); OutputLink := Make (OutputLink); OutputLink.Set_Output_Name(Self.Output_Name); Self.InputLink := InputLink; Self.IPLink := IPLink; Self.KeyGenLink := KeyGenLink; Self.FeistelLink := FeistelLink; Self.ReverseIPLink := ReverseIPLink; Self.OutputLink := OutputLink; Self.Handle; Finish := Clock; Final_Time := Finish - Start; Put_Line (Final_Time'Image); end; procedure Handle (Self : in out DesHandler) is begin Put("Container created") ; New_Line; Self.Create_Binary_Data_Container; Put("Handlers order set") ; New_Line; Self.Set_Handlers_Order; Put("Handlers containers set") ; New_Line; Self.Set_Handlers_Container; Self.InputLink.Handle; end; procedure Create_Binary_Data_Container (Self : in out DesHandler) is begin declare Ptr_BinaryContainer : constant BinaryContainer_Access := new T_BinaryContainer(1..Self.InputLink.Get_Input_Size); begin Self.Ptr_Container := Ptr_BinaryContainer; end; end; procedure Process_Request (Self : in out DesHandler) is Tmp_Mode : Character := ' '; Tmp_Key : Unbounded_String; begin while (Tmp_Mode /= 'D' and Tmp_Mode /= 'E') loop Put ("Choose mode of algorithm (E for encryption, D for deciphering) : "); Tmp_Mode := To_String(Ada.Strings.Unbounded.Text_IO.Get_Line)(1); end loop; Self.Mode := Tmp_Mode; Put ("Choose the input file : "); Self.Input_Name := Ada.Strings.Unbounded.Text_IO.Get_Line; New_Line; Put ("Choose the output file (a new file will be created) : "); Self.Output_Name := Ada.Strings.Unbounded.Text_IO.Get_Line; while Length(Tmp_Key) /= 8 loop Put ("Choose a key (must be exactly 8 characters long) : "); Tmp_Key := Ada.Strings.Unbounded.Text_IO.Get_Line; New_Line; end loop; Self.Ptr_Key.all := To_String(Tmp_Key); end; procedure Set_Handlers_Order (Self : in out DesHandler) is begin Self.InputLink.Set_NextHandler(Self.IPLink'Unchecked_Access); Self.IPLink.Set_NextHandler(Self.KeyGenLink'Unchecked_Access); Self.KeyGenLink.Set_NextHandler(Self.FeistelLink'Unchecked_Access); Self.FeistelLink.Set_NextHandler(Self.ReverseIPLink'Unchecked_Access); Self.ReverseIPLink.Set_NextHandler(Self.OutputLink'Unchecked_Access); end; procedure Set_Handlers_Container (Self : in out DesHandler) is begin Self.InputLink.Set_BinaryContainer(Self.Ptr_Container); Self.IPLink.Set_BinaryContainer(Self.Ptr_Container); Self.FeistelLink.Set_BinaryContainer(Self.Ptr_Container); Self.ReverseIPLink.Set_BinaryContainer(Self.Ptr_Container); Self.OutputLink.Set_BinaryContainer(Self.Ptr_Container); Self.KeyGenLink.Set_KeyAccess(Self.Ptr_Key); Self.KeyGenLink.Set_SubKeyArrayAccess(Self.Ptr_SubKey_Array); Self.FeistelLink.Set_SubKeyArrayAccess(Self.Ptr_SubKey_Array); end; end P_deshandler;
32.30303
83
0.666745
22fe15e237f131c533a453b8c5d8ac0acf502523
2,786
ads
Ada
tools/scitools/conf/understand/ada/ada12/a-sfhcin.ads
brucegua/moocos
575c161cfa35e220f10d042e2e5ca18773691695
[ "Apache-2.0" ]
1
2020-01-20T21:26:46.000Z
2020-01-20T21:26:46.000Z
tools/scitools/conf/understand/ada/ada12/a-sfhcin.ads
brucegua/moocos
575c161cfa35e220f10d042e2e5ca18773691695
[ "Apache-2.0" ]
null
null
null
tools/scitools/conf/understand/ada/ada12/a-sfhcin.ads
brucegua/moocos
575c161cfa35e220f10d042e2e5ca18773691695
[ "Apache-2.0" ]
null
null
null
------------------------------------------------------------------------------ -- -- -- GNAT LIBRARY COMPONENTS -- -- -- -- ADA.STRINGS.FIXED.HASH_CASE_INSENSITIVE -- -- -- -- S p e c -- -- -- -- Copyright (C) 2011, Free Software Foundation, Inc. -- -- -- -- This specification is derived from the Ada Reference Manual for use with -- -- GNAT. The copyright notice above, and the license provisions that follow -- -- apply solely to the contents of the part following the private keyword. -- -- -- -- GNAT 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 3, or (at your option) any later ver- -- -- sion. GNAT 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. -- -- -- -- -- -- -- -- -- -- -- -- You should have received a copy of the GNU General Public License and -- -- a copy of the GCC Runtime Library Exception along with this program; -- -- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- -- <http://www.gnu.org/licenses/>. -- -- -- -- This unit was originally developed by Matthew J Heaney. -- ------------------------------------------------------------------------------ with Ada.Containers; with Ada.Strings.Hash_Case_Insensitive; function Ada.Strings.Fixed.Hash_Case_Insensitive (Key : String) return Containers.Hash_Type renames Ada.Strings.Hash_Case_Insensitive; pragma Pure (Ada.Strings.Fixed.Hash_Case_Insensitive);
66.333333
78
0.373654
59b6ef8313a1e6d4403502db176e4b1d6e277734
6,064
ads
Ada
tools/scitools/conf/understand/ada/ada12/s-mastop.ads
brucegua/moocos
575c161cfa35e220f10d042e2e5ca18773691695
[ "Apache-2.0" ]
1
2020-01-20T21:26:46.000Z
2020-01-20T21:26:46.000Z
tools/scitools/conf/understand/ada/ada12/s-mastop.ads
brucegua/moocos
575c161cfa35e220f10d042e2e5ca18773691695
[ "Apache-2.0" ]
null
null
null
tools/scitools/conf/understand/ada/ada12/s-mastop.ads
brucegua/moocos
575c161cfa35e220f10d042e2e5ca18773691695
[ "Apache-2.0" ]
null
null
null
------------------------------------------------------------------------------ -- -- -- GNAT COMPILER COMPONENTS -- -- -- -- SYSTEM.MACHINE_STATE_OPERATIONS -- -- -- -- S p e c -- -- -- -- Copyright (C) 1999-2009, Free Software Foundation, Inc. -- -- -- -- GNAT 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 3, or (at your option) any later ver- -- -- sion. GNAT 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. -- -- -- -- -- -- -- -- -- -- -- -- You should have received a copy of the GNU General Public License and -- -- a copy of the GCC Runtime Library Exception along with this program; -- -- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- -- <http://www.gnu.org/licenses/>. -- -- -- -- GNAT was originally developed by the GNAT team at New York University. -- -- Extensive contributions were provided by Ada Core Technologies Inc. -- -- -- ------------------------------------------------------------------------------ pragma Compiler_Unit; pragma Polling (Off); -- We must turn polling off for this unit, because otherwise we get -- elaboration circularities with System.Exception_Tables. with System.Storage_Elements; package System.Machine_State_Operations is subtype Code_Loc is System.Address; -- Code location used in building exception tables and for call -- addresses when propagating an exception (also traceback table) -- Values of this type are created by using Label'Address or -- extracted from machine states using Get_Code_Loc. type Machine_State is new System.Address; -- The table based exception handling approach (see a-except.adb) isolates -- the target dependent aspects using an abstract data type interface -- to the type Machine_State, which is represented as a System.Address -- value (presumably implemented as a pointer to an appropriate record -- structure). function Machine_State_Length return System.Storage_Elements.Storage_Offset; -- Function to determine the length of the Storage_Array needed to hold -- a machine state. The machine state will always be maximally aligned. -- The value returned is a constant that will be used to allocate space -- for a machine state value. function Allocate_Machine_State return Machine_State; -- Allocate the required space for a Machine_State procedure Free_Machine_State (M : in out Machine_State); -- Free the dynamic memory taken by Machine_State -- The initial value of type Machine_State is created by the low level -- routine that actually raises an exception using the special builtin -- _builtin_machine_state. This value will typically encode the value -- of the program counter, and relevant registers. The following -- operations are defined on Machine_State values: function Get_Code_Loc (M : Machine_State) return Code_Loc; -- This function extracts the program counter value from a machine -- state, which the caller uses for searching the exception tables, -- and also for recording entries in the traceback table. The call -- returns a value of Null_Loc if the machine state represents the -- outer level, or some other frame for which no information can be -- provided. procedure Pop_Frame (M : Machine_State); -- This procedure pops the machine state M so that it represents the -- call point, as though the current subprogram had returned. It -- changes only the value referenced by M, and does not affect -- the current stack environment. function Fetch_Code (Loc : Code_Loc) return Code_Loc; -- Some architectures (notably VMS) use a descriptor to describe -- a subprogram address. This function computes the actual starting -- address of the code from Loc. -- -- ??? This function will go away when 'Code_Address is fixed on VMS. -- -- Do not add pragma Inline to this function: there is a curious -- interaction between rtsfind and front-end inlining. The exception -- declaration in s-auxdec calls rtsfind, which forces several other system -- packages to be compiled. Some of those have a pragma Inline, and we -- compile the corresponding bodies so that inlining can take place. One -- of these packages is s-mastop, which depends on s-auxdec, which is still -- being compiled: we have not seen all the declarations in it yet, so we -- get confused semantic errors. procedure Set_Machine_State (M : Machine_State); -- This routine sets M from the current machine state. It is called -- when an exception is initially signalled to initialize the state. end System.Machine_State_Operations;
56.148148
79
0.57091
c75f437db3885be822842ecbd216ee270f50dddb
4,124
ads
Ada
source/league/ucd/matreshka-internals-unicode-ucd-core_0033.ads
svn2github/matreshka
9d222b3ad9da508855fb1f5adbe5e8a4fad4c530
[ "BSD-3-Clause" ]
24
2016-11-29T06:59:41.000Z
2021-08-30T11:55:16.000Z
source/league/ucd/matreshka-internals-unicode-ucd-core_0033.ads
svn2github/matreshka
9d222b3ad9da508855fb1f5adbe5e8a4fad4c530
[ "BSD-3-Clause" ]
2
2019-01-16T05:15:20.000Z
2019-02-03T10:03:32.000Z
source/league/ucd/matreshka-internals-unicode-ucd-core_0033.ads
svn2github/matreshka
9d222b3ad9da508855fb1f5adbe5e8a4fad4c530
[ "BSD-3-Clause" ]
4
2017-07-18T07:11:05.000Z
2020-06-21T03:02:25.000Z
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Localization, Internationalization, Globalization for Ada -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2012-2015, Vadim Godunko <[email protected]> -- -- All rights reserved. -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions -- -- are met: -- -- -- -- * Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- -- -- * Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in the -- -- documentation and/or other materials provided with the distribution. -- -- -- -- * Neither the name of the Vadim Godunko, IE nor the names of its -- -- contributors may be used to endorse or promote products derived from -- -- this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -- -- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -- -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -- -- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -- -- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ -- $Revision$ $Date$ ------------------------------------------------------------------------------ pragma Restrictions (No_Elaboration_Code); -- GNAT: enforce generation of preinitialized data section instead of -- generation of elaboration code. package Matreshka.Internals.Unicode.Ucd.Core_0033 is pragma Preelaborate; Group_0033 : aliased constant Core_Second_Stage := (16#00# .. 16#57# => -- 3300 .. 3357 (Other_Symbol, Wide, Other, Katakana, Other, Ideographic, (Grapheme_Base | Changes_When_NFKC_Casefolded => True, others => False)), others => (Other_Symbol, Wide, Other, Other, Other, Ideographic, (Grapheme_Base | Changes_When_NFKC_Casefolded => True, others => False))); end Matreshka.Internals.Unicode.Ucd.Core_0033;
60.647059
78
0.440834
2fc4fabfddfbcb9da8fc73511049799ad45bb565
4,150
ads
Ada
llvm-gcc-4.2-2.9/gcc/ada/a-ztfiio.ads
vidkidz/crossbridge
ba0bf94aee0ce6cf7eb5be882382e52bc57ba396
[ "MIT" ]
1
2016-04-09T02:58:13.000Z
2016-04-09T02:58:13.000Z
llvm-gcc-4.2-2.9/gcc/ada/a-ztfiio.ads
vidkidz/crossbridge
ba0bf94aee0ce6cf7eb5be882382e52bc57ba396
[ "MIT" ]
null
null
null
llvm-gcc-4.2-2.9/gcc/ada/a-ztfiio.ads
vidkidz/crossbridge
ba0bf94aee0ce6cf7eb5be882382e52bc57ba396
[ "MIT" ]
null
null
null
------------------------------------------------------------------------------ -- -- -- GNAT RUN-TIME COMPONENTS -- -- -- -- A D A . W I D E _ W I D E _ T E X T _ I O . F I X E D _ I O -- -- -- -- S p e c -- -- -- -- Copyright (C) 1992-2005, Free Software Foundation, Inc. -- -- -- -- This specification is derived from the Ada Reference Manual for use with -- -- GNAT. The copyright notice above, and the license provisions that follow -- -- apply solely to the contents of the part following the private keyword. -- -- -- -- GNAT 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. GNAT 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 GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, -- -- Boston, MA 02110-1301, 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. -- -- -- -- GNAT was originally developed by the GNAT team at New York University. -- -- Extensive contributions were provided by Ada Core Technologies Inc. -- -- -- ------------------------------------------------------------------------------ -- In Ada 95, the package Ada.Wide_Wide_Text_IO.Fixed_IO is a subpackage of -- Wide_Wide_Text_IO. In GNAT we make it a child package to avoid loading -- the necessary code if Fixed_IO is not instantiated. See the routine -- Rtsfind.Text_IO_Kludge for a description of how we patch up the -- difference in semantics so that it is invisible to the Ada programmer. private generic type Num is delta <>; package Ada.Wide_Wide_Text_IO.Fixed_IO is Default_Fore : Field := Num'Fore; Default_Aft : Field := Num'Aft; Default_Exp : Field := 0; procedure Get (File : File_Type; Item : out Num; Width : Field := 0); procedure Get (Item : out Num; Width : Field := 0); procedure Put (File : File_Type; Item : Num; Fore : Field := Default_Fore; Aft : Field := Default_Aft; Exp : Field := Default_Exp); procedure Put (Item : Num; Fore : Field := Default_Fore; Aft : Field := Default_Aft; Exp : Field := Default_Exp); procedure Get (From : Wide_Wide_String; Item : out Num; Last : out Positive); procedure Put (To : out Wide_Wide_String; Item : Num; Aft : Field := Default_Aft; Exp : Field := Default_Exp); end Ada.Wide_Wide_Text_IO.Fixed_IO;
47.701149
78
0.494699
1a54e050dd291fa753b300d84ba54ca393ede293
442
adb
Ada
courses/fundamentals_of_ada/labs/solar_system/adv_240_tasking_embedded/answers/solar_system-button.adb
AdaCore/training_material
6651eb2c53f8c39649b8e0b3c757bc8ff963025a
[ "CC-BY-4.0" ]
15
2020-10-07T08:56:45.000Z
2022-02-08T23:13:22.000Z
courses/fundamentals_of_ada/labs/solar_system/adv_240_tasking_embedded/answers/solar_system-button.adb
AdaCore/training_material
6651eb2c53f8c39649b8e0b3c757bc8ff963025a
[ "CC-BY-4.0" ]
20
2020-11-05T14:35:20.000Z
2022-01-13T15:59:33.000Z
courses/fundamentals_of_ada/labs/solar_system/adv_240_tasking_embedded/answers/solar_system-button.adb
AdaCore/training_material
6651eb2c53f8c39649b8e0b3c757bc8ff963025a
[ "CC-BY-4.0" ]
6
2020-10-08T15:57:06.000Z
2021-08-31T12:03:08.000Z
with My_Button; use My_Button; package body Solar_System.Button is task body Button_Monitor is Body_Data : Body_Type; begin loop My_Button.Button.Wait_Press; for PO_Body of Bodies loop Body_Data := PO_Body.Get_Data; Body_Data.Speed := -Body_Data.Speed; PO_Body.Set_Data (Body_Data); end loop; end loop; end Button_Monitor; end Solar_System.Button;
22.1
48
0.638009
412410e60280b466b1a1ee7bb94123f482a1209e
5,890
adb
Ada
Validation/pyFrame3DD-master/gcc-master/gcc/ada/libgnat/s-carun8.adb
djamal2727/Main-Bearing-Analytical-Model
2f00c2219c71be0175c6f4f8f1d4cca231d97096
[ "Apache-2.0" ]
null
null
null
Validation/pyFrame3DD-master/gcc-master/gcc/ada/libgnat/s-carun8.adb
djamal2727/Main-Bearing-Analytical-Model
2f00c2219c71be0175c6f4f8f1d4cca231d97096
[ "Apache-2.0" ]
null
null
null
Validation/pyFrame3DD-master/gcc-master/gcc/ada/libgnat/s-carun8.adb
djamal2727/Main-Bearing-Analytical-Model
2f00c2219c71be0175c6f4f8f1d4cca231d97096
[ "Apache-2.0" ]
null
null
null
------------------------------------------------------------------------------ -- -- -- GNAT RUN-TIME LIBRARY COMPONENTS -- -- -- -- S Y S T E M . C O M P A R E _ A R R A Y _ U N S I G N E D _ 8 -- -- -- -- B o d y -- -- -- -- Copyright (C) 2002-2020, Free Software Foundation, Inc. -- -- -- -- GNAT 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 3, or (at your option) any later ver- -- -- sion. GNAT 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. -- -- -- -- As a special exception under Section 7 of GPL version 3, you are granted -- -- additional permissions described in the GCC Runtime Library Exception, -- -- version 3.1, as published by the Free Software Foundation. -- -- -- -- You should have received a copy of the GNU General Public License and -- -- a copy of the GCC Runtime Library Exception along with this program; -- -- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- -- <http://www.gnu.org/licenses/>. -- -- -- -- GNAT was originally developed by the GNAT team at New York University. -- -- Extensive contributions were provided by Ada Core Technologies Inc. -- -- -- ------------------------------------------------------------------------------ pragma Compiler_Unit_Warning; with System.Address_Operations; use System.Address_Operations; with Ada.Unchecked_Conversion; package body System.Compare_Array_Unsigned_8 is type Word is mod 2 ** 32; -- Used to process operands by words type Big_Words is array (Natural) of Word; type Big_Words_Ptr is access Big_Words; for Big_Words_Ptr'Storage_Size use 0; -- Array type used to access by words type Byte is mod 2 ** 8; -- Used to process operands by bytes type Big_Bytes is array (Natural) of Byte; type Big_Bytes_Ptr is access Big_Bytes; for Big_Bytes_Ptr'Storage_Size use 0; -- Array type used to access by bytes function To_Big_Words is new Ada.Unchecked_Conversion (System.Address, Big_Words_Ptr); function To_Big_Bytes is new Ada.Unchecked_Conversion (System.Address, Big_Bytes_Ptr); ---------------------- -- Compare_Array_U8 -- ---------------------- function Compare_Array_U8 (Left : System.Address; Right : System.Address; Left_Len : Natural; Right_Len : Natural) return Integer is Compare_Len : constant Natural := Natural'Min (Left_Len, Right_Len); begin -- If operands are non-aligned, or length is too short, go by bytes if (ModA (OrA (Left, Right), 4) /= 0) or else Compare_Len < 4 then return Compare_Array_U8_Unaligned (Left, Right, Left_Len, Right_Len); end if; -- Here we can go by words declare LeftP : constant Big_Words_Ptr := To_Big_Words (Left); RightP : constant Big_Words_Ptr := To_Big_Words (Right); Words_To_Compare : constant Natural := Compare_Len / 4; Bytes_Compared_As_Words : constant Natural := Words_To_Compare * 4; begin for J in 0 .. Words_To_Compare - 1 loop if LeftP (J) /= RightP (J) then return Compare_Array_U8_Unaligned (AddA (Left, Address (4 * J)), AddA (Right, Address (4 * J)), 4, 4); end if; end loop; return Compare_Array_U8_Unaligned (AddA (Left, Address (Bytes_Compared_As_Words)), AddA (Right, Address (Bytes_Compared_As_Words)), Left_Len - Bytes_Compared_As_Words, Right_Len - Bytes_Compared_As_Words); end; end Compare_Array_U8; -------------------------------- -- Compare_Array_U8_Unaligned -- -------------------------------- function Compare_Array_U8_Unaligned (Left : System.Address; Right : System.Address; Left_Len : Natural; Right_Len : Natural) return Integer is Compare_Len : constant Natural := Natural'Min (Left_Len, Right_Len); LeftP : constant Big_Bytes_Ptr := To_Big_Bytes (Left); RightP : constant Big_Bytes_Ptr := To_Big_Bytes (Right); begin for J in 0 .. Compare_Len - 1 loop if LeftP (J) /= RightP (J) then if LeftP (J) > RightP (J) then return +1; else return -1; end if; end if; end loop; if Left_Len = Right_Len then return 0; elsif Left_Len > Right_Len then return +1; else return -1; end if; end Compare_Array_U8_Unaligned; end System.Compare_Array_Unsigned_8;
40.62069
78
0.495925
29d3dc5359ca946587f6bf2cbf3076551538fc90
96
ads
Ada
tests/thread/thread_func.ads
Fabien-Chouteau/ASFML
52a013554bcfb6150e0d6391871356c1443a6b93
[ "Zlib" ]
null
null
null
tests/thread/thread_func.ads
Fabien-Chouteau/ASFML
52a013554bcfb6150e0d6391871356c1443a6b93
[ "Zlib" ]
null
null
null
tests/thread/thread_func.ads
Fabien-Chouteau/ASFML
52a013554bcfb6150e0d6391871356c1443a6b93
[ "Zlib" ]
null
null
null
with System; procedure Thread_Func (Arg : System.Address); pragma Convention (C, Thread_Func);
19.2
45
0.770833
22110cc32507d75a47750b65342d09b4394f378c
103
adb
Ada
ch1/basic.adb
drm343/drm343.github.io
f736f761c6020e95abe9de22135fc9c437143c1a
[ "MIT" ]
null
null
null
ch1/basic.adb
drm343/drm343.github.io
f736f761c6020e95abe9de22135fc9c437143c1a
[ "MIT" ]
null
null
null
ch1/basic.adb
drm343/drm343.github.io
f736f761c6020e95abe9de22135fc9c437143c1a
[ "MIT" ]
null
null
null
-- 程序名稱必須跟檔案名稱相同 procedure Basic is -- 這個區塊是一個叫做 basic 的程序 begin -- 由此開始 null; end Basic; -- 由此結束
14.714286
41
0.68932
576dd4e6f60897be8ca194f9079d8c5a3ce15324
1,202
ads
Ada
src/tom/library/sl/ada/allsstrategy.ads
rewriting/tom
2918e95c78006f08a2a0919ef440413fa5c2342a
[ "BSD-3-Clause" ]
36
2016-02-19T12:09:49.000Z
2022-02-03T13:13:21.000Z
src/tom/library/sl/ada/allsstrategy.ads
rewriting/tom
2918e95c78006f08a2a0919ef440413fa5c2342a
[ "BSD-3-Clause" ]
null
null
null
src/tom/library/sl/ada/allsstrategy.ads
rewriting/tom
2918e95c78006f08a2a0919ef440413fa5c2342a
[ "BSD-3-Clause" ]
6
2017-11-30T17:07:10.000Z
2022-03-12T14:46:21.000Z
with ObjectPack, AbstractStrategyCombinatorPackage, IntrospectorPackage, StrategyPackage; use ObjectPack, AbstractStrategyCombinatorPackage, IntrospectorPackage, StrategyPackage; package AllsStrategy is ARG : constant Integer := 0; type Alls is new AbstractStrategyCombinator and Object with null record; ---------------------------------------------------------------------------- -- Object implementation ---------------------------------------------------------------------------- function toString(o: Alls) return String; ---------------------------------------------------------------------------- -- Strategy implementation ---------------------------------------------------------------------------- function visitLight(str:access Alls; any: ObjectPtr; intro: access Introspector'Class) return ObjectPtr; function visit(str: access Alls; intro: access Introspector'Class) return Integer; ---------------------------------------------------------------------------- procedure makeAlls(i : in out Alls; v: StrategyPtr); function newAlls(v: StrategyPtr) return StrategyPtr; ---------------------------------------------------------------------------- end AllsStrategy;
42.928571
105
0.490017
58300aa1c5411c9520f9176deee2ef1e9ad114d6
14,065
adb
Ada
source/web/spikedog/core/matreshka-servlet_dispatchers.adb
svn2github/matreshka
9d222b3ad9da508855fb1f5adbe5e8a4fad4c530
[ "BSD-3-Clause" ]
null
null
null
source/web/spikedog/core/matreshka-servlet_dispatchers.adb
svn2github/matreshka
9d222b3ad9da508855fb1f5adbe5e8a4fad4c530
[ "BSD-3-Clause" ]
2
2019-01-16T05:15:20.000Z
2019-02-03T10:03:32.000Z
source/web/spikedog/core/matreshka-servlet_dispatchers.adb
svn2github/matreshka
9d222b3ad9da508855fb1f5adbe5e8a4fad4c530
[ "BSD-3-Clause" ]
null
null
null
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Web Framework -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2014-2017, Vadim Godunko <[email protected]> -- -- All rights reserved. -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions -- -- are met: -- -- -- -- * Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- -- -- * Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in the -- -- documentation and/or other materials provided with the distribution. -- -- -- -- * Neither the name of the Vadim Godunko, IE nor the names of its -- -- contributors may be used to endorse or promote products derived from -- -- this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -- -- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -- -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -- -- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -- -- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ -- $Revision$ $Date$ ------------------------------------------------------------------------------ with Ada.Unchecked_Deallocation; package body Matreshka.Servlet_Dispatchers is use type Matreshka.Servlet_Registrations.Servlet_Registration_Access; Solidus : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("/"); Asterisk_Full_Stop : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("*."); Solidus_Asterisk : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("/*"); procedure Free is new Ada.Unchecked_Deallocation (Abstract_Dispatcher'Class, Dispatcher_Access); ----------------- -- Add_Mapping -- ----------------- procedure Add_Mapping (Self : not null access Context_Dispatcher'Class; Servlet : not null Matreshka.Servlet_Registrations.Servlet_Registration_Access; URL_Pattern : League.Strings.Universal_String; Success : out Boolean) is use type League.Strings.Universal_String; begin Success := False; if URL_Pattern.Is_Empty then -- Exact map to application's context root. if Self.Root_Servlet = null then Self.Root_Servlet := Servlet; Success := True; end if; elsif URL_Pattern = Solidus then -- "Default" servlet of the application. if Self.Default_Servlet = null then Self.Default_Servlet := Servlet; Success := True; end if; elsif URL_Pattern.Starts_With (Asterisk_Full_Stop) then -- Extension mapping. declare Extension : constant League.Strings.Universal_String := URL_Pattern.Tail_From (3); begin if not Extension.Is_Empty and then Extension.Index ('.') = 0 and then not Self.Extension_Servlets.Contains (Extension) then -- Extension should not be empty string, extension should not -- contains '.' character and should not be mapped already. Self.Extension_Servlets.Insert (Extension, Servlet); Success := True; end if; end; elsif URL_Pattern.Starts_With (Solidus) then -- Path mapping. declare Is_Pattern : constant Boolean := URL_Pattern.Ends_With (Solidus_Asterisk); URL : constant League.Strings.Universal_String := (if Is_Pattern then URL_Pattern.Head (URL_Pattern.Length - 2) else URL_Pattern); Path : League.String_Vectors.Universal_String_Vector := URL.Split ('/', League.Strings.Skip_Empty); Index : Positive := 1; Current : Dispatcher_Access; Parent : Dispatcher_Access := Self; Aux : Dispatcher_Access; Position : Dispatcher_Maps.Cursor; begin if URL_Pattern.Ends_With (Solidus) then Path.Append (League.Strings.Empty_Universal_String); end if; loop Position := Segment_Dispatcher'Class (Parent.all).Children.Find (Path (Index)); if Dispatcher_Maps.Has_Element (Position) then Current := Dispatcher_Maps.Element (Position); else -- Current segment of path is not mapped to dispatcher, -- allocate new dispatcher. if Index = Path.Length then Current := new Servlet_Dispatcher; else Current := new Segment_Dispatcher; end if; Segment_Dispatcher'Class (Parent.all).Children.Insert (Path (Index), Current); end if; if Index = Path.Length then if Current.all not in Servlet_Dispatcher'Class then -- Change type of current dispatcher to servant -- dispatcher. Aux := Current; Current := new Servlet_Dispatcher' (Children => Segment_Dispatcher'Class (Aux.all).Children, others => <>); Segment_Dispatcher'Class (Parent.all).Children.Replace_Element (Position, Current); Free (Aux); end if; if Is_Pattern then if Servlet_Dispatcher'Class (Current.all).Mapping_Servlet = null then Servlet_Dispatcher'Class (Current.all).Mapping_Servlet := Servlet; Success := True; end if; else if Servlet_Dispatcher'Class (Current.all).Exact_Servlet = null then Servlet_Dispatcher'Class (Current.all).Exact_Servlet := Servlet; Success := True; end if; end if; exit; end if; -- Go to next segment. Parent := Current; Current := null; Index := Index + 1; Position := Dispatcher_Maps.No_Element; end loop; end; end if; end Add_Mapping; -------------- -- Dispatch -- -------------- overriding procedure Dispatch (Self : not null access constant Context_Dispatcher; Request : in out Matreshka.Servlet_HTTP_Requests.Abstract_HTTP_Servlet_Request'Class; Path : League.String_Vectors.Universal_String_Vector; Index : Positive; Servlet : in out Matreshka.Servlet_Registrations.Servlet_Registration_Access) is Servlet_Found : Boolean := False; -- Sets to True when servlet is found by this subprogram, but not by -- call to inherited one. begin if Path.Length < Index or (Path.Length = Index and Path (Index).Is_Empty) then -- Exact match of root, use root servlet when available; otherwise -- use default servlet. if Self.Root_Servlet /= null then Servlet := Self.Root_Servlet; Servlet_Found := True; elsif Self.Default_Servlet /= null then Servlet := Self.Default_Servlet; Servlet_Found := True; end if; else -- Call inherited subprogram to lookup exact servlet or longest -- path-prefix. Segment_Dispatcher (Self.all).Dispatch (Request, Path, Index, Servlet); if Servlet = null then -- Lookup servlet using extension mapping. declare Last_Segment : constant League.Strings.Universal_String := Path (Path.Length); Full_Stop_Position : constant Natural := Last_Segment.Last_Index ('.'); Position : constant Extension_Maps.Cursor := (if Full_Stop_Position /= 0 then Self.Extension_Servlets.Find (Last_Segment.Tail_From (Full_Stop_Position + 1)) else Extension_Maps.No_Element); begin if Extension_Maps.Has_Element (Position) then Servlet := Extension_Maps.Element (Position); Servlet_Found := True; end if; end; end if; if Servlet = null then -- Use application's default servlet. Servlet := Self.Default_Servlet; Servlet_Found := True; end if; end if; -- Set indices of last segment of context and servlet paths. if Servlet /= null then Request.Set_Context_Last_Segment (Index - 1); if Servlet_Found then Request.Set_Servlet_Last_Segment (Index - 1); end if; end if; end Dispatch; -------------- -- Dispatch -- -------------- overriding procedure Dispatch (Self : not null access constant Segment_Dispatcher; Request : in out Matreshka.Servlet_HTTP_Requests.Abstract_HTTP_Servlet_Request'Class; Path : League.String_Vectors.Universal_String_Vector; Index : Positive; Servlet : in out Matreshka.Servlet_Registrations.Servlet_Registration_Access) is begin if Path.Length < Index then -- Looked path is exactly what this (simple) dispatcher handles. -- Request for this path should be processed in another way by one of -- parent dispatchers. null; else declare Position : constant Dispatcher_Maps.Cursor := Self.Children.Find (Path (Index)); begin if Dispatcher_Maps.Has_Element (Position) then Dispatcher_Maps.Element (Position).Dispatch (Request, Path, Index + 1, Servlet); end if; end; end if; end Dispatch; -------------- -- Dispatch -- -------------- overriding procedure Dispatch (Self : not null access constant Servlet_Dispatcher; Request : in out Matreshka.Servlet_HTTP_Requests.Abstract_HTTP_Servlet_Request'Class; Path : League.String_Vectors.Universal_String_Vector; Index : Positive; Servlet : in out Matreshka.Servlet_Registrations.Servlet_Registration_Access) is begin if Path.Length < Index then -- Exact match, use exact match servlet when available. if Self.Exact_Servlet /= null then Servlet := Self.Exact_Servlet; Request.Set_Servlet_Last_Segment (Index - 1); end if; else -- Call inherited subprogram to lookup exact servlet or longest -- path-prefix. Segment_Dispatcher (Self.all).Dispatch (Request, Path, Index, Servlet); end if; if Servlet = null then -- Exact or longest path-prefix servlet was not found; use path -- mapping servlet when available for current path-prefix. if Self.Mapping_Servlet /= null then Servlet := Self.Mapping_Servlet; Request.Set_Servlet_Last_Segment (Index - 1); end if; end if; end Dispatch; end Matreshka.Servlet_Dispatchers;
38.64011
80
0.510203
579d8b786e8e034c71319b0ffed6b8d2dc37c01e
1,597
adb
Ada
src/fltk-images-pixmaps-gif.adb
micahwelf/FLTK-Ada
83e0c58ea98e5ede2cbbb158b42eae44196c3ba7
[ "Unlicense" ]
1
2020-12-18T15:20:13.000Z
2020-12-18T15:20:13.000Z
src/fltk-images-pixmaps-gif.adb
micahwelf/FLTK-Ada
83e0c58ea98e5ede2cbbb158b42eae44196c3ba7
[ "Unlicense" ]
null
null
null
src/fltk-images-pixmaps-gif.adb
micahwelf/FLTK-Ada
83e0c58ea98e5ede2cbbb158b42eae44196c3ba7
[ "Unlicense" ]
null
null
null
with Interfaces.C, System; use type System.Address; package body FLTK.Images.Pixmaps.GIF is function new_fl_gif_image (F : in Interfaces.C.char_array) return System.Address; pragma Import (C, new_fl_gif_image, "new_fl_gif_image"); pragma Inline (new_fl_gif_image); procedure free_fl_gif_image (P : in System.Address); pragma Import (C, free_fl_gif_image, "free_fl_gif_image"); pragma Inline (free_fl_gif_image); overriding procedure Finalize (This : in out GIF_Image) is begin if This.Void_Ptr /= System.Null_Address and then This in GIF_Image'Class then free_fl_gif_image (This.Void_Ptr); This.Void_Ptr := System.Null_Address; end if; Finalize (Pixmap (This)); end Finalize; package body Forge is function Create (Filename : in String) return GIF_Image is begin return This : GIF_Image do This.Void_Ptr := new_fl_gif_image (Interfaces.C.To_C (Filename)); case fl_image_fail (This.Void_Ptr) is when 1 => raise No_Image_Error; when 2 => raise File_Access_Error; when 3 => raise Format_Error; when others => null; end case; end return; end Create; end Forge; end FLTK.Images.Pixmaps.GIF;
22.180556
62
0.536005
1cd1140fea4c7028d38c801b7d45fd89cb0aaacc
1,033
adb
Ada
tests/src/Safe_Alloc/safe_alloc_suite.adb
mhatzl/spark_unbound
21d6b80516c9a494a2d7db6b2a62ee226e9a98c1
[ "MIT" ]
8
2022-01-27T14:16:48.000Z
2022-02-01T16:35:35.000Z
tests/src/Safe_Alloc/safe_alloc_suite.adb
mhatzl/spark_unbound
21d6b80516c9a494a2d7db6b2a62ee226e9a98c1
[ "MIT" ]
2
2021-12-13T08:13:22.000Z
2022-02-06T17:59:57.000Z
tests/src/Safe_Alloc/safe_alloc_suite.adb
mhatzl/spark_unbound
21d6b80516c9a494a2d7db6b2a62ee226e9a98c1
[ "MIT" ]
null
null
null
with AUnit.Test_Caller; with SA_Arrays_Tests; with SA_Definite_Tests; package body Safe_Alloc_Suite is package SA_Arrays_Test_Caller is new AUnit.Test_Caller(SA_Arrays_Tests.Test_Fixture); package SA_Definite_Test_Caller is new AUnit.Test_Caller(SA_Definite_Tests.Test_Fixture); function Suite return Access_Test_Suite is SA_Suite : constant Access_Test_Suite := new Test_Suite; begin -- Add Arrays Tests --------------------------------- SA_Suite.Add_Test(SA_Arrays_Test_Caller.Create("Test Arrays Alloc with trying to force Storage_Error => Returns `null`", SA_Arrays_Tests.TestAlloc_WithForcingStorageError_ResultNullReturned'Access)); -- Add Definite Tests --------------------------------- SA_Suite.Add_Test(SA_Definite_Test_Caller.Create("Test Definite Alloc with trying to force Storage_Error => Returns `null`", SA_Definite_Tests.TestAlloc_WithForcingStorageError_ResultNullReturned'Access)); return SA_Suite; end Suite; end Safe_Alloc_Suite;
41.32
211
0.730881