aboutsummaryrefslogtreecommitdiffstats
path: root/src/types.ads
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2017-09-26 20:49:24 +0200
committerTristan Gingold <tgingold@free.fr>2017-09-26 20:49:24 +0200
commit39f80aecbff4af324432a3575de91e4562aad4f9 (patch)
tree2b4f211ef2aca93c9266514b096e00c488243c64 /src/types.ads
parent685526e22ad509c82bc43e72b1780e000b0430b1 (diff)
downloadghdl-39f80aecbff4af324432a3575de91e4562aad4f9.tar.gz
ghdl-39f80aecbff4af324432a3575de91e4562aad4f9.tar.bz2
ghdl-39f80aecbff4af324432a3575de91e4562aad4f9.zip
name_table, ieee-vital_timing: reduce use of global variables.
Diffstat (limited to 'src/types.ads')
-rw-r--r--src/types.ads9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/types.ads b/src/types.ads
index 406b1284b..8a53d112e 100644
--- a/src/types.ads
+++ b/src/types.ads
@@ -16,6 +16,8 @@
-- Software Foundation, 59 Temple Place - Suite 330, Boston, MA
-- 02111-1307, USA.
with Interfaces;
+with System;
+with Ada.Unchecked_Conversion;
package Types is
pragma Preelaborate (Types);
@@ -54,6 +56,13 @@ package Types is
type String_Cst is access constant String;
type String_Acc_Array is array (Natural range <>) of String_Acc;
+ -- Fat strings, for compatibility with C.
+ subtype Fat_String is String (Positive);
+ type Fat_String_Acc is access Fat_String;
+ pragma Convention (C, Fat_String_Acc);
+ function To_Fat_String_Acc is new Ada.Unchecked_Conversion
+ (System.Address, Fat_String_Acc);
+
-- The name table is defined in Name_Table package. This is an hash table
-- that associate a uniq Name_Id to a string. Name_Id are allocated in
-- increasing numbers, so it is possible to create a parallel table