Rebuilt with GCC 7.3
Removed some non-efecitve use clauses.
This commit is contained in:
parent
a7b61b6bed
commit
7f6d9043ba
8
Makefile
8
Makefile
|
@ -38,11 +38,11 @@ generate:
|
|||
rm -rf src/gen/*
|
||||
mkdir -p .temp src/gen
|
||||
echo "#include <zmq.h>">.temp/x.c
|
||||
(cd .temp;g++ -c -fdump-ada-spec x.c)
|
||||
(cd .temp;g++ -c -fdump-ada-spec -C x.c)
|
||||
python rename.py .temp/zmq_h.ads
|
||||
gnatchop -w -gnat12 .temp/zmq_h.ads src/gen
|
||||
gnat pretty -P zmq.gpr -rf -M128 src/gen/*.ads
|
||||
|
||||
cp .temp/zmq_h.ads src/gen/zmq-low_level.ads
|
||||
gnatpp -rf -M128 --comments-special src/gen/*.ads
|
||||
sed "s-Zmq.Low_Level-ZMQ.Low_Level-" -i src/gen/zmq-low_level.ads
|
||||
clean:
|
||||
git clean -fXd
|
||||
test:
|
||||
|
|
|
@ -174,7 +174,7 @@ def parsargs(args):
|
|||
if not exists(join(args.withzmqinclude, "zmq.h")):
|
||||
sys.stderr.write("No zmq.h found\n")
|
||||
fail = True
|
||||
#if not exists(join(args.withzmqlib, "libzmq.a")):
|
||||
# if not exists(join(args.withzmqlib, "libzmq.a")):
|
||||
# sys.stderr.write("No libzmq found\n")
|
||||
# fail = True
|
||||
if fail:
|
||||
|
|
|
@ -1,14 +1,13 @@
|
|||
|
||||
|
||||
with Ada.Strings.Unbounded;
|
||||
|
||||
with Ada.Containers.Indefinite_Vectors;
|
||||
package ZMQ.Examples.Sparse is
|
||||
type Sparse_Data;
|
||||
type Sparse_Data_Access is access all Sparse_Data'Class;
|
||||
|
||||
type Sparse_Data (Name : not null access String) is tagged record
|
||||
type Sparse_Data (Name : not null access String) is abstract tagged record
|
||||
Changed : Boolean := False;
|
||||
Name : GNAT.Strings.String_Access;
|
||||
Parent : Sparse_Data_Access;
|
||||
end record;
|
||||
|
||||
|
@ -23,6 +22,7 @@ package ZMQ.Examples.Sparse is
|
|||
type Sparse_Boolean is new Sparse_Data with record
|
||||
Value : access Boolean;
|
||||
end record;
|
||||
|
||||
procedure Set (Self : Sparse_Integer; Value : Boolean);
|
||||
type Sparse_Float is new Sparse_Data with record
|
||||
Value : access Float;
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
../zmq.ide.py
|
118
rename.py
118
rename.py
|
@ -3,7 +3,8 @@
|
|||
|
||||
import sys
|
||||
import re
|
||||
header="""-------------------------------------------------------------------------------
|
||||
|
||||
header = """-------------------------------------------------------------------------------
|
||||
-- --
|
||||
-- 0MQ Ada-binding --
|
||||
-- --
|
||||
|
@ -33,20 +34,25 @@ header="""----------------------------------------------------------------------
|
|||
-- ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR --
|
||||
-- OTHER DEALINGS IN THE SOFTWARE. --
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
|
||||
-- begin read only
|
||||
--
|
||||
-- The contents of this file is derived from zmq.h using the
|
||||
-- -fdump-ada-spec switch for gcc.
|
||||
|
||||
"""
|
||||
|
||||
renames=[["stddef_h.size_t","size_t"],
|
||||
["with stddef_h;",""],
|
||||
["with stdint_h;","with Interfaces.C.Extensions;"],
|
||||
["stdint_h.uint16_t","Extensions.Unsigned_16"],
|
||||
["stdint_h.int32_t","Extensions.Signed_32"],
|
||||
["stdint_h.uint8_t","Extensions.Unsigned_8"],
|
||||
["package zmq_h is","""package ZMQ.Low_Level is
|
||||
tail = "-- end read only"
|
||||
|
||||
renames = [["stddef_h.size_t", "size_t"],
|
||||
["with stddef_h;", ""],
|
||||
["with bits_stdint_uintn_h;", ""],
|
||||
["with stdint_h;", " with Interfaces.C.Extensions;"],
|
||||
["stdint_h.uint16_t", "Extensions.Unsigned_16"],
|
||||
["stdint_h.int32_t", "Extensions.Signed_32"],
|
||||
["stdint_h.uint8_t", "Extensions.Unsigned_8"],
|
||||
["bits_stdint_uintn_h.uint32_t", "Interfaces.Unsigned_32"],
|
||||
["bits_stdint_uintn_h.uint16_t", "Interfaces.Unsigned_16"],
|
||||
["bits_stdint_uintn_h.uint8_t", "Interfaces.Unsigned_8"],
|
||||
["package zmq_h is", """package ZMQ.Low_Level is
|
||||
|
||||
pragma Preelaborate;
|
||||
pragma Warnings (Off);
|
||||
|
@ -56,56 +62,80 @@ renames=[["stddef_h.size_t","size_t"],
|
|||
-- identifiers in Ada are caseinsensetive.
|
||||
|
||||
"""],
|
||||
["procedure zmq_version",""" end Defs;
|
||||
|
||||
procedure zmq_version"""],
|
||||
["zmq_h","ZMQ.Low_Level"]]
|
||||
["function zmq_errno", """ end Defs;
|
||||
|
||||
function zmq_errno"""],
|
||||
["--**", "-- **"],
|
||||
[" zmq_h ", " ZMQ.Low_Level "],
|
||||
[" zmq_h;", " ZMQ.Low_Level;"]]
|
||||
|
||||
|
||||
obslolete_functions=["zmq_ctx_shutdown","zmq_ctx_term","zmq_term","zmq_sendmsg","zmq_recvmsg"]
|
||||
obslolete_functions = ["zmq_ctx_shutdown",
|
||||
"zmq_ctx_term",
|
||||
"zmq_term",
|
||||
"zmq_sendmsg",
|
||||
"zmq_recvmsg"]
|
||||
|
||||
|
||||
def main(path):
|
||||
dumped = False
|
||||
with file(path) as f:
|
||||
buffer=f.read()
|
||||
buffer = f.read()
|
||||
|
||||
for i in renames:
|
||||
buffer=buffer.replace(i[0],i[1])
|
||||
buffer = buffer.replace(i[0], i[1])
|
||||
|
||||
buffer=buffer.split("\n")
|
||||
include_matcher=re.compile("(.+-- +)(/.+/include/)(.*)")
|
||||
buffer = buffer.split("\n")
|
||||
include_matcher = re.compile("(.+-- +)(/.+/include/)(.*)")
|
||||
# -- unsupported macro: EFSM (ZMQ_HAUSNUMERO + 51)
|
||||
e_matcher=re.compile(r""".+unsupported macro: (\w+) \((\w+) \+ (\w+)\).*""")
|
||||
e_matcher = re.compile(r""".+unsupported macro: (\w+) \((\w+) \+ (\w+)\).*""")
|
||||
|
||||
#-- unsupported macro: ZMQ_XREQ ZMQ_DEALER
|
||||
r_matcher=re.compile(r""".+unsupported macro: (\w+) (\w+)$""")
|
||||
for i in range(0,len(buffer)):
|
||||
m=include_matcher.match(buffer[i])
|
||||
if m:
|
||||
buffer[i]=m.group(1) + m.group(3)
|
||||
m=e_matcher.match(buffer[i])
|
||||
if m:
|
||||
buffer[i]="%s : constant := %s + %s;" % (m.group(1) , m.group(2), m.group(3))
|
||||
# -- unsupported macro: ZMQ_XREQ ZMQ_DEALER
|
||||
r_matcher = re.compile(r""".+unsupported macro: (\w+) (\w+)$""")
|
||||
for i in range(0, len(buffer)):
|
||||
m = include_matcher.match(buffer[i])
|
||||
if m:
|
||||
buffer[i] = m.group(1) + m.group(3)
|
||||
m = e_matcher.match(buffer[i])
|
||||
if m:
|
||||
buffer[i] = "%s : constant := %s + %s;" % (m.group(1), m.group(2), m.group(3))
|
||||
|
||||
m=r_matcher.match(buffer[i])
|
||||
if m:
|
||||
buffer[i]="%s : constant := %s;" % (m.group(1) , m.group(2))
|
||||
m = r_matcher.match(buffer[i])
|
||||
if m:
|
||||
buffer[i] = "%s : constant := %s;" % (m.group(1), m.group(2))
|
||||
|
||||
for obslolete in obslolete_functions:
|
||||
pattern=r'^.*pragma Import *\(C, *(%s), *"%s"\);' % (obslolete, obslolete)
|
||||
if not dumped:
|
||||
print pattern
|
||||
matcher=re.compile(pattern)
|
||||
if matcher.match(buffer[i]):
|
||||
buffer[i] = " pragma Obsolescent;\n%s" % buffer[i]
|
||||
dumped = True
|
||||
for obslolete in obslolete_functions:
|
||||
pattern = r'^.*pragma Import *\(C, *(%s), *"%s"\);' % (obslolete, obslolete)
|
||||
if not dumped:
|
||||
print pattern
|
||||
matcher = re.compile(pattern)
|
||||
if matcher.match(buffer[i]):
|
||||
buffer[i] = " pragma Obsolescent;\n%s" % buffer[i]
|
||||
dumped = True
|
||||
|
||||
|
||||
buffer="\n".join(buffer)
|
||||
with file(path,"w") as f:
|
||||
buffer = "\n".join(buffer)
|
||||
with file(path, "w") as f:
|
||||
f.write(header)
|
||||
f.write(buffer)
|
||||
f.write(tail)
|
||||
|
||||
|
||||
matcher = re.compile(r"\w+ (zmq_\w+) .*")
|
||||
with open("zmq-case_exceptions.xml","w") as outf:
|
||||
outf.write("""<?xml version="1.0" ?>
|
||||
<exceptions>
|
||||
<case_exceptions>
|
||||
""")
|
||||
with open(path) as inf:
|
||||
for line in inf:
|
||||
line = line.strip()
|
||||
m = matcher.match(line)
|
||||
if m:
|
||||
outf.write(" <word>%s</word>\n" % m.group(1))
|
||||
outf.write(""" </case_exceptions>
|
||||
</exceptions>""")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main(sys.argv[1])
|
||||
main(sys.argv[1])
|
||||
|
|
50
renames.py
50
renames.py
|
@ -1,50 +0,0 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
|
||||
renames=[["with stddef_h;\n",""],
|
||||
["stddef_h.size_t","size_t"],
|
||||
["zmq_h","ZMQ.Low_Level"]]
|
||||
|
||||
|
||||
import sys
|
||||
import os
|
||||
import re
|
||||
|
||||
|
||||
m=re.compile("(^.*-- *)(/.*?/)(zmq\\.h.*$)")
|
||||
def fix(line):
|
||||
ma=m.match(line)
|
||||
if ma:
|
||||
line=ma.group(1)+ma.group(3)
|
||||
ma=re.match("^\\s+--\\s+unsupported\\s+macro:\\s+(\\w+)\\s+.ZMQ_HAUSNUMERO\\s+\\+\\s+(\\w+).*",line)
|
||||
if ma:
|
||||
line=" %s : constant := ZMQ_HAUSNUMERO + %s;" % (ma.group(1), ma.group(2))
|
||||
return line
|
||||
|
||||
def rename(p):
|
||||
f=file(p)
|
||||
buffer=f.read()
|
||||
f.close();
|
||||
|
||||
for i in renames:
|
||||
buffer=buffer.replace(i[0],i[1])
|
||||
|
||||
buffer=buffer.split("\n")
|
||||
ret=[]
|
||||
ret.append('--------------------------------------------------------------------')
|
||||
ret.append('-- --')
|
||||
ret.append('-- Do not edit, this file is automaticly generated from "zmq.h" --')
|
||||
ret.append('-- --')
|
||||
ret.append('--------------------------------------------------------------------')
|
||||
ret.append('')
|
||||
for line in buffer:
|
||||
ret.append(fix(line))
|
||||
if re.match("^package.*is",line):
|
||||
ret.append(" pragma Preelaborate;")
|
||||
|
||||
f=file(p,"w")
|
||||
f.write("\n".join(ret))
|
||||
f.close()
|
||||
|
||||
if __name__ == "__main__":
|
||||
rename(sys.argv[1])
|
|
@ -28,11 +28,10 @@
|
|||
-- ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR --
|
||||
-- OTHER DEALINGS IN THE SOFTWARE. --
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
|
||||
-- begin read only
|
||||
--
|
||||
-- The contents of this file is derived from zmq.h using the
|
||||
-- -fdump-ada-spec switch for gcc.
|
||||
|
||||
pragma Ada_2005;
|
||||
pragma Style_Checks (Off);
|
||||
|
||||
|
@ -40,34 +39,29 @@ with Interfaces.C; use Interfaces.C;
|
|||
with Interfaces.C.Strings;
|
||||
with System;
|
||||
|
||||
with Interfaces.C.Extensions;
|
||||
|
||||
package ZMQ.Low_Level is
|
||||
|
||||
pragma Preelaborate;
|
||||
pragma Warnings (Off);
|
||||
|
||||
package Defs is
|
||||
-- This package is here to give a namespace to constants, since
|
||||
-- identifiers in Ada are caseinsensetive.
|
||||
|
||||
|
||||
|
||||
-- This package is here to give a namespace to constants, since
|
||||
-- identifiers in Ada are caseinsensetive.
|
||||
|
||||
ZMQ_VERSION_MAJOR : constant := 4; -- zmq.h:32
|
||||
ZMQ_VERSION_MINOR : constant := 1; -- zmq.h:33
|
||||
ZMQ_VERSION_PATCH : constant := 5; -- zmq.h:34
|
||||
-- arg-macro: function ZMQ_MAKE_VERSION ((major) * 10000 + (minor) * 100 + (patch)
|
||||
ZMQ_VERSION_PATCH : constant := 6; -- zmq.h:34
|
||||
-- arg-macro: function ZMQ_MAKE_VERSION (major, minor, patch)
|
||||
-- return (major) * 10000 + (minor) * 100 + (patch);
|
||||
-- unsupported macro: ZMQ_VERSION ZMQ_MAKE_VERSION(ZMQ_VERSION_MAJOR, ZMQ_VERSION_MINOR, ZMQ_VERSION_PATCH)
|
||||
|
||||
ZMQ_DEFINED_STDINT : constant := 1; -- zmq.h:74
|
||||
|
||||
ZMQ_HAUSNUMERO : constant := 156384712; -- zmq.h:98
|
||||
EFSM : constant := ZMQ_HAUSNUMERO + 51;
|
||||
EFSM : constant := ZMQ_HAUSNUMERO + 51;
|
||||
ENOCOMPATPROTO : constant := ZMQ_HAUSNUMERO + 52;
|
||||
ETERM : constant := ZMQ_HAUSNUMERO + 53;
|
||||
EMTHREAD : constant := ZMQ_HAUSNUMERO + 54;
|
||||
ETERM : constant := ZMQ_HAUSNUMERO + 53;
|
||||
EMTHREAD : constant := ZMQ_HAUSNUMERO + 54;
|
||||
|
||||
ZMQ_IO_THREADS : constant := 1; -- zmq.h:180
|
||||
ZMQ_MAX_SOCKETS : constant := 2; -- zmq.h:181
|
||||
|
@ -75,389 +69,424 @@ package ZMQ.Low_Level is
|
|||
ZMQ_THREAD_PRIORITY : constant := 3; -- zmq.h:183
|
||||
ZMQ_THREAD_SCHED_POLICY : constant := 4; -- zmq.h:184
|
||||
|
||||
ZMQ_IO_THREADS_DFLT : constant := 1; -- zmq.h:187
|
||||
ZMQ_MAX_SOCKETS_DFLT : constant := 1023; -- zmq.h:188
|
||||
ZMQ_THREAD_PRIORITY_DFLT : constant := -1; -- zmq.h:189
|
||||
ZMQ_IO_THREADS_DFLT : constant := 1; -- zmq.h:187
|
||||
ZMQ_MAX_SOCKETS_DFLT : constant := 1023; -- zmq.h:188
|
||||
ZMQ_THREAD_PRIORITY_DFLT : constant := -1; -- zmq.h:189
|
||||
ZMQ_THREAD_SCHED_POLICY_DFLT : constant := -1; -- zmq.h:190
|
||||
|
||||
ZMQ_PAIR : constant := 0; -- zmq.h:234
|
||||
ZMQ_PUB : constant := 1; -- zmq.h:235
|
||||
ZMQ_SUB : constant := 2; -- zmq.h:236
|
||||
ZMQ_REQ : constant := 3; -- zmq.h:237
|
||||
ZMQ_REP : constant := 4; -- zmq.h:238
|
||||
ZMQ_DEALER : constant := 5; -- zmq.h:239
|
||||
ZMQ_ROUTER : constant := 6; -- zmq.h:240
|
||||
ZMQ_PULL : constant := 7; -- zmq.h:241
|
||||
ZMQ_PUSH : constant := 8; -- zmq.h:242
|
||||
ZMQ_XPUB : constant := 9; -- zmq.h:243
|
||||
ZMQ_XSUB : constant := 10; -- zmq.h:244
|
||||
ZMQ_STREAM : constant := 11; -- zmq.h:245
|
||||
ZMQ_XREQ : constant := ZMQ_DEALER;
|
||||
ZMQ_XREP : constant := ZMQ_ROUTER;
|
||||
ZMQ_PAIR : constant := 0; -- zmq.h:250
|
||||
ZMQ_PUB : constant := 1; -- zmq.h:251
|
||||
ZMQ_SUB : constant := 2; -- zmq.h:252
|
||||
ZMQ_REQ : constant := 3; -- zmq.h:253
|
||||
ZMQ_REP : constant := 4; -- zmq.h:254
|
||||
ZMQ_DEALER : constant := 5; -- zmq.h:255
|
||||
ZMQ_ROUTER : constant := 6; -- zmq.h:256
|
||||
ZMQ_PULL : constant := 7; -- zmq.h:257
|
||||
ZMQ_PUSH : constant := 8; -- zmq.h:258
|
||||
ZMQ_XPUB : constant := 9; -- zmq.h:259
|
||||
ZMQ_XSUB : constant := 10; -- zmq.h:260
|
||||
ZMQ_STREAM : constant := 11; -- zmq.h:261
|
||||
ZMQ_XREQ : constant := ZMQ_DEALER;
|
||||
ZMQ_XREP : constant := ZMQ_ROUTER;
|
||||
|
||||
ZMQ_AFFINITY : constant := 4; -- zmq.h:252
|
||||
ZMQ_IDENTITY : constant := 5; -- zmq.h:253
|
||||
ZMQ_SUBSCRIBE : constant := 6; -- zmq.h:254
|
||||
ZMQ_UNSUBSCRIBE : constant := 7; -- zmq.h:255
|
||||
ZMQ_RATE : constant := 8; -- zmq.h:256
|
||||
ZMQ_RECOVERY_IVL : constant := 9; -- zmq.h:257
|
||||
ZMQ_SNDBUF : constant := 11; -- zmq.h:258
|
||||
ZMQ_RCVBUF : constant := 12; -- zmq.h:259
|
||||
ZMQ_RCVMORE : constant := 13; -- zmq.h:260
|
||||
ZMQ_FD : constant := 14; -- zmq.h:261
|
||||
ZMQ_EVENTS : constant := 15; -- zmq.h:262
|
||||
ZMQ_TYPE : constant := 16; -- zmq.h:263
|
||||
ZMQ_LINGER : constant := 17; -- zmq.h:264
|
||||
ZMQ_RECONNECT_IVL : constant := 18; -- zmq.h:265
|
||||
ZMQ_BACKLOG : constant := 19; -- zmq.h:266
|
||||
ZMQ_RECONNECT_IVL_MAX : constant := 21; -- zmq.h:267
|
||||
ZMQ_MAXMSGSIZE : constant := 22; -- zmq.h:268
|
||||
ZMQ_SNDHWM : constant := 23; -- zmq.h:269
|
||||
ZMQ_RCVHWM : constant := 24; -- zmq.h:270
|
||||
ZMQ_MULTICAST_HOPS : constant := 25; -- zmq.h:271
|
||||
ZMQ_RCVTIMEO : constant := 27; -- zmq.h:272
|
||||
ZMQ_SNDTIMEO : constant := 28; -- zmq.h:273
|
||||
ZMQ_LAST_ENDPOINT : constant := 32; -- zmq.h:274
|
||||
ZMQ_ROUTER_MANDATORY : constant := 33; -- zmq.h:275
|
||||
ZMQ_TCP_KEEPALIVE : constant := 34; -- zmq.h:276
|
||||
ZMQ_TCP_KEEPALIVE_CNT : constant := 35; -- zmq.h:277
|
||||
ZMQ_TCP_KEEPALIVE_IDLE : constant := 36; -- zmq.h:278
|
||||
ZMQ_TCP_KEEPALIVE_INTVL : constant := 37; -- zmq.h:279
|
||||
ZMQ_IMMEDIATE : constant := 39; -- zmq.h:280
|
||||
ZMQ_XPUB_VERBOSE : constant := 40; -- zmq.h:281
|
||||
ZMQ_ROUTER_RAW : constant := 41; -- zmq.h:282
|
||||
ZMQ_IPV6 : constant := 42; -- zmq.h:283
|
||||
ZMQ_MECHANISM : constant := 43; -- zmq.h:284
|
||||
ZMQ_PLAIN_SERVER : constant := 44; -- zmq.h:285
|
||||
ZMQ_PLAIN_USERNAME : constant := 45; -- zmq.h:286
|
||||
ZMQ_PLAIN_PASSWORD : constant := 46; -- zmq.h:287
|
||||
ZMQ_CURVE_SERVER : constant := 47; -- zmq.h:288
|
||||
ZMQ_CURVE_PUBLICKEY : constant := 48; -- zmq.h:289
|
||||
ZMQ_CURVE_SECRETKEY : constant := 49; -- zmq.h:290
|
||||
ZMQ_CURVE_SERVERKEY : constant := 50; -- zmq.h:291
|
||||
ZMQ_PROBE_ROUTER : constant := 51; -- zmq.h:292
|
||||
ZMQ_REQ_CORRELATE : constant := 52; -- zmq.h:293
|
||||
ZMQ_REQ_RELAXED : constant := 53; -- zmq.h:294
|
||||
ZMQ_CONFLATE : constant := 54; -- zmq.h:295
|
||||
ZMQ_ZAP_DOMAIN : constant := 55; -- zmq.h:296
|
||||
ZMQ_ROUTER_HANDOVER : constant := 56; -- zmq.h:297
|
||||
ZMQ_TOS : constant := 57; -- zmq.h:298
|
||||
ZMQ_CONNECT_RID : constant := 61; -- zmq.h:299
|
||||
ZMQ_GSSAPI_SERVER : constant := 62; -- zmq.h:300
|
||||
ZMQ_GSSAPI_PRINCIPAL : constant := 63; -- zmq.h:301
|
||||
ZMQ_GSSAPI_SERVICE_PRINCIPAL : constant := 64; -- zmq.h:302
|
||||
ZMQ_GSSAPI_PLAINTEXT : constant := 65; -- zmq.h:303
|
||||
ZMQ_HANDSHAKE_IVL : constant := 66; -- zmq.h:304
|
||||
ZMQ_SOCKS_PROXY : constant := 68; -- zmq.h:305
|
||||
ZMQ_XPUB_NODROP : constant := 69; -- zmq.h:306
|
||||
ZMQ_AFFINITY : constant := 4; -- zmq.h:268
|
||||
ZMQ_IDENTITY : constant := 5; -- zmq.h:269
|
||||
ZMQ_SUBSCRIBE : constant := 6; -- zmq.h:270
|
||||
ZMQ_UNSUBSCRIBE : constant := 7; -- zmq.h:271
|
||||
ZMQ_RATE : constant := 8; -- zmq.h:272
|
||||
ZMQ_RECOVERY_IVL : constant := 9; -- zmq.h:273
|
||||
ZMQ_SNDBUF : constant := 11; -- zmq.h:274
|
||||
ZMQ_RCVBUF : constant := 12; -- zmq.h:275
|
||||
ZMQ_RCVMORE : constant := 13; -- zmq.h:276
|
||||
ZMQ_FD : constant := 14; -- zmq.h:277
|
||||
ZMQ_EVENTS : constant := 15; -- zmq.h:278
|
||||
ZMQ_TYPE : constant := 16; -- zmq.h:279
|
||||
ZMQ_LINGER : constant := 17; -- zmq.h:280
|
||||
ZMQ_RECONNECT_IVL : constant := 18; -- zmq.h:281
|
||||
ZMQ_BACKLOG : constant := 19; -- zmq.h:282
|
||||
ZMQ_RECONNECT_IVL_MAX : constant := 21; -- zmq.h:283
|
||||
ZMQ_MAXMSGSIZE : constant := 22; -- zmq.h:284
|
||||
ZMQ_SNDHWM : constant := 23; -- zmq.h:285
|
||||
ZMQ_RCVHWM : constant := 24; -- zmq.h:286
|
||||
ZMQ_MULTICAST_HOPS : constant := 25; -- zmq.h:287
|
||||
ZMQ_RCVTIMEO : constant := 27; -- zmq.h:288
|
||||
ZMQ_SNDTIMEO : constant := 28; -- zmq.h:289
|
||||
ZMQ_LAST_ENDPOINT : constant := 32; -- zmq.h:290
|
||||
ZMQ_ROUTER_MANDATORY : constant := 33; -- zmq.h:291
|
||||
ZMQ_TCP_KEEPALIVE : constant := 34; -- zmq.h:292
|
||||
ZMQ_TCP_KEEPALIVE_CNT : constant := 35; -- zmq.h:293
|
||||
ZMQ_TCP_KEEPALIVE_IDLE : constant := 36; -- zmq.h:294
|
||||
ZMQ_TCP_KEEPALIVE_INTVL : constant := 37; -- zmq.h:295
|
||||
ZMQ_IMMEDIATE : constant := 39; -- zmq.h:296
|
||||
ZMQ_XPUB_VERBOSE : constant := 40; -- zmq.h:297
|
||||
ZMQ_ROUTER_RAW : constant := 41; -- zmq.h:298
|
||||
ZMQ_IPV6 : constant := 42; -- zmq.h:299
|
||||
ZMQ_MECHANISM : constant := 43; -- zmq.h:300
|
||||
ZMQ_PLAIN_SERVER : constant := 44; -- zmq.h:301
|
||||
ZMQ_PLAIN_USERNAME : constant := 45; -- zmq.h:302
|
||||
ZMQ_PLAIN_PASSWORD : constant := 46; -- zmq.h:303
|
||||
ZMQ_CURVE_SERVER : constant := 47; -- zmq.h:304
|
||||
ZMQ_CURVE_PUBLICKEY : constant := 48; -- zmq.h:305
|
||||
ZMQ_CURVE_SECRETKEY : constant := 49; -- zmq.h:306
|
||||
ZMQ_CURVE_SERVERKEY : constant := 50; -- zmq.h:307
|
||||
ZMQ_PROBE_ROUTER : constant := 51; -- zmq.h:308
|
||||
ZMQ_REQ_CORRELATE : constant := 52; -- zmq.h:309
|
||||
ZMQ_REQ_RELAXED : constant := 53; -- zmq.h:310
|
||||
ZMQ_CONFLATE : constant := 54; -- zmq.h:311
|
||||
ZMQ_ZAP_DOMAIN : constant := 55; -- zmq.h:312
|
||||
ZMQ_ROUTER_HANDOVER : constant := 56; -- zmq.h:313
|
||||
ZMQ_TOS : constant := 57; -- zmq.h:314
|
||||
ZMQ_CONNECT_RID : constant := 61; -- zmq.h:315
|
||||
ZMQ_GSSAPI_SERVER : constant := 62; -- zmq.h:316
|
||||
ZMQ_GSSAPI_PRINCIPAL : constant := 63; -- zmq.h:317
|
||||
ZMQ_GSSAPI_SERVICE_PRINCIPAL : constant := 64; -- zmq.h:318
|
||||
ZMQ_GSSAPI_PLAINTEXT : constant := 65; -- zmq.h:319
|
||||
ZMQ_HANDSHAKE_IVL : constant := 66; -- zmq.h:320
|
||||
ZMQ_SOCKS_PROXY : constant := 68; -- zmq.h:321
|
||||
ZMQ_XPUB_NODROP : constant := 69; -- zmq.h:322
|
||||
|
||||
ZMQ_MORE : constant := 1; -- zmq.h:309
|
||||
ZMQ_SRCFD : constant := 2; -- zmq.h:310
|
||||
ZMQ_SHARED : constant := 3; -- zmq.h:311
|
||||
ZMQ_MORE : constant := 1; -- zmq.h:325
|
||||
ZMQ_SRCFD : constant := 2; -- zmq.h:326
|
||||
ZMQ_SHARED : constant := 3; -- zmq.h:327
|
||||
|
||||
ZMQ_DONTWAIT : constant := 1; -- zmq.h:314
|
||||
ZMQ_SNDMORE : constant := 2; -- zmq.h:315
|
||||
ZMQ_DONTWAIT : constant := 1; -- zmq.h:330
|
||||
ZMQ_SNDMORE : constant := 2; -- zmq.h:331
|
||||
|
||||
ZMQ_NULL : constant := 0; -- zmq.h:318
|
||||
ZMQ_PLAIN : constant := 1; -- zmq.h:319
|
||||
ZMQ_CURVE : constant := 2; -- zmq.h:320
|
||||
ZMQ_GSSAPI : constant := 3; -- zmq.h:321
|
||||
ZMQ_NULL : constant := 0; -- zmq.h:334
|
||||
ZMQ_PLAIN : constant := 1; -- zmq.h:335
|
||||
ZMQ_CURVE : constant := 2; -- zmq.h:336
|
||||
ZMQ_GSSAPI : constant := 3; -- zmq.h:337
|
||||
|
||||
ZMQ_TCP_ACCEPT_FILTER : constant := 38; -- zmq.h:324
|
||||
ZMQ_IPC_FILTER_PID : constant := 58; -- zmq.h:325
|
||||
ZMQ_IPC_FILTER_UID : constant := 59; -- zmq.h:326
|
||||
ZMQ_IPC_FILTER_GID : constant := 60; -- zmq.h:327
|
||||
ZMQ_IPV4ONLY : constant := 31; -- zmq.h:328
|
||||
ZMQ_DELAY_ATTACH_ON_CONNECT : constant := ZMQ_IMMEDIATE;
|
||||
ZMQ_NOBLOCK : constant := ZMQ_DONTWAIT;
|
||||
ZMQ_FAIL_UNROUTABLE : constant := ZMQ_ROUTER_MANDATORY;
|
||||
ZMQ_ROUTER_BEHAVIOR : constant := ZMQ_ROUTER_MANDATORY;
|
||||
ZMQ_TCP_ACCEPT_FILTER : constant := 38; -- zmq.h:340
|
||||
ZMQ_IPC_FILTER_PID : constant := 58; -- zmq.h:341
|
||||
ZMQ_IPC_FILTER_UID : constant := 59; -- zmq.h:342
|
||||
ZMQ_IPC_FILTER_GID : constant := 60; -- zmq.h:343
|
||||
ZMQ_IPV4ONLY : constant := 31; -- zmq.h:344
|
||||
ZMQ_DELAY_ATTACH_ON_CONNECT : constant := ZMQ_IMMEDIATE;
|
||||
ZMQ_NOBLOCK : constant := ZMQ_DONTWAIT;
|
||||
ZMQ_FAIL_UNROUTABLE : constant := ZMQ_ROUTER_MANDATORY;
|
||||
ZMQ_ROUTER_BEHAVIOR : constant := ZMQ_ROUTER_MANDATORY;
|
||||
|
||||
ZMQ_EVENT_CONNECTED : constant := 16#0001#; -- zmq.h:340
|
||||
ZMQ_EVENT_CONNECT_DELAYED : constant := 16#0002#; -- zmq.h:341
|
||||
ZMQ_EVENT_CONNECT_RETRIED : constant := 16#0004#; -- zmq.h:342
|
||||
ZMQ_EVENT_LISTENING : constant := 16#0008#; -- zmq.h:343
|
||||
ZMQ_EVENT_BIND_FAILED : constant := 16#0010#; -- zmq.h:344
|
||||
ZMQ_EVENT_ACCEPTED : constant := 16#0020#; -- zmq.h:345
|
||||
ZMQ_EVENT_ACCEPT_FAILED : constant := 16#0040#; -- zmq.h:346
|
||||
ZMQ_EVENT_CLOSED : constant := 16#0080#; -- zmq.h:347
|
||||
ZMQ_EVENT_CLOSE_FAILED : constant := 16#0100#; -- zmq.h:348
|
||||
ZMQ_EVENT_DISCONNECTED : constant := 16#0200#; -- zmq.h:349
|
||||
ZMQ_EVENT_MONITOR_STOPPED : constant := 16#0400#; -- zmq.h:350
|
||||
ZMQ_EVENT_ALL : constant := 16#FFFF#; -- zmq.h:351
|
||||
ZMQ_EVENT_CONNECTED : constant := 16#0001#; -- zmq.h:356
|
||||
ZMQ_EVENT_CONNECT_DELAYED : constant := 16#0002#; -- zmq.h:357
|
||||
ZMQ_EVENT_CONNECT_RETRIED : constant := 16#0004#; -- zmq.h:358
|
||||
ZMQ_EVENT_LISTENING : constant := 16#0008#; -- zmq.h:359
|
||||
ZMQ_EVENT_BIND_FAILED : constant := 16#0010#; -- zmq.h:360
|
||||
ZMQ_EVENT_ACCEPTED : constant := 16#0020#; -- zmq.h:361
|
||||
ZMQ_EVENT_ACCEPT_FAILED : constant := 16#0040#; -- zmq.h:362
|
||||
ZMQ_EVENT_CLOSED : constant := 16#0080#; -- zmq.h:363
|
||||
ZMQ_EVENT_CLOSE_FAILED : constant := 16#0100#; -- zmq.h:364
|
||||
ZMQ_EVENT_DISCONNECTED : constant := 16#0200#; -- zmq.h:365
|
||||
ZMQ_EVENT_MONITOR_STOPPED : constant := 16#0400#; -- zmq.h:366
|
||||
ZMQ_EVENT_ALL : constant := 16#FFFF#; -- zmq.h:367
|
||||
|
||||
ZMQ_POLLIN : constant := 1; -- zmq.h:373
|
||||
ZMQ_POLLOUT : constant := 2; -- zmq.h:374
|
||||
ZMQ_POLLERR : constant := 4; -- zmq.h:375
|
||||
ZMQ_POLLIN : constant := 1; -- zmq.h:389
|
||||
ZMQ_POLLOUT : constant := 2; -- zmq.h:390
|
||||
ZMQ_POLLERR : constant := 4; -- zmq.h:391
|
||||
|
||||
ZMQ_POLLITEMS_DFLT : constant := 16; -- zmq.h:389
|
||||
ZMQ_POLLITEMS_DFLT : constant := 16; -- zmq.h:405
|
||||
|
||||
ZMQ_HAS_CAPABILITIES : constant := 1; -- zmq.h:404
|
||||
ZMQ_HAS_CAPABILITIES : constant := 1; -- zmq.h:420
|
||||
|
||||
ZMQ_STREAMER : constant := 1; -- zmq.h:408
|
||||
ZMQ_FORWARDER : constant := 2; -- zmq.h:409
|
||||
ZMQ_QUEUE : constant := 3; -- zmq.h:410
|
||||
ZMQ_STREAMER : constant := 1; -- zmq.h:424
|
||||
ZMQ_FORWARDER : constant := 2; -- zmq.h:425
|
||||
ZMQ_QUEUE : constant := 3; -- zmq.h:426
|
||||
|
||||
function Zmq_Errno return Int; -- zmq.h:166
|
||||
pragma Import (C, Zmq_Errno, "zmq_errno");
|
||||
|
||||
function Zmq_Strerror (Errnum : Int) return Interfaces.C.Strings.Chars_Ptr; -- zmq.h:169
|
||||
pragma Import (C, Zmq_Strerror, "zmq_strerror");
|
||||
-- Copyright (c) 2007-2015 Contributors as noted in the AUTHORS file
|
||||
-- This file is part of 0MQ.
|
||||
-- 0MQ is free software; you can redistribute it and/or modify it under
|
||||
-- the terms of the GNU Lesser General Public License as published by
|
||||
-- the Free Software Foundation; either version 3 of the License, or
|
||||
-- (at your option) any later version.
|
||||
-- 0MQ 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 Lesser General Public License for more details.
|
||||
-- You should have received a copy of the GNU Lesser General Public License
|
||||
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
-- *************************************************************************
|
||||
-- NOTE to contributors. This file comprises the principal public contract
|
||||
-- for ZeroMQ API users (along with zmq_utils.h). Any change to this file
|
||||
-- supplied in a stable release SHOULD not break existing applications.
|
||||
-- In practice this means that the value of constants must not change, and
|
||||
-- that old values may not be reused for new constants.
|
||||
-- *************************************************************************
|
||||
--
|
||||
|
||||
-- Version macros for compile-time API version detection
|
||||
-- Handle DSO symbol visibility
|
||||
-- Define integer types needed for event interface
|
||||
-- ****************************************************************************
|
||||
-- 0MQ errors.
|
||||
-- ****************************************************************************
|
||||
-- A number random enough not to collide with different errno ranges on
|
||||
-- different OSes. The assumption is that error_t is at least 32-bit type.
|
||||
-- On Windows platform some of the standard POSIX errnos are not defined.
|
||||
-- Native 0MQ error codes.
|
||||
-- This function retrieves the errno as it is known to 0MQ library. The goal
|
||||
-- of this function is to make the code 100% portable, including where 0MQ
|
||||
-- compiled with certain CRT library (on Windows) is linked to an
|
||||
-- application that uses different CRT library.
|
||||
end Defs;
|
||||
|
||||
procedure Zmq_Version
|
||||
(Major : access Int;
|
||||
Minor : access Int;
|
||||
Patch : access Int); -- zmq.h:172
|
||||
pragma Import (C, Zmq_Version, "zmq_version");
|
||||
function zmq_errno return int; -- zmq.h:166
|
||||
pragma Import (C, zmq_errno, "zmq_errno");
|
||||
|
||||
function Zmq_Ctx_New return System.Address; -- zmq.h:192
|
||||
pragma Import (C, Zmq_Ctx_New, "zmq_ctx_new");
|
||||
-- Resolves system errors and 0MQ errors to human-readable string.
|
||||
function zmq_strerror (errnum : int) return Interfaces.C.Strings.chars_ptr; -- zmq.h:169
|
||||
pragma Import (C, zmq_strerror, "zmq_strerror");
|
||||
|
||||
function Zmq_Ctx_Term (Context : System.Address) return Int; -- zmq.h:193
|
||||
-- Run-time API version detection
|
||||
procedure zmq_version (major : access int; minor : access int; patch : access int); -- zmq.h:172
|
||||
pragma Import (C, zmq_version, "zmq_version");
|
||||
|
||||
-- ****************************************************************************
|
||||
-- 0MQ infrastructure (a.k.a. context) initialisation & termination.
|
||||
-- ****************************************************************************
|
||||
-- New API
|
||||
-- Context options
|
||||
-- Default for new contexts
|
||||
function zmq_ctx_new return System.Address; -- zmq.h:192
|
||||
pragma Import (C, zmq_ctx_new, "zmq_ctx_new");
|
||||
|
||||
function zmq_ctx_term (context : System.Address) return int; -- zmq.h:193
|
||||
pragma Obsolescent;
|
||||
pragma Import (C, Zmq_Ctx_Term, "zmq_ctx_term");
|
||||
pragma Import (C, zmq_ctx_term, "zmq_ctx_term");
|
||||
|
||||
function Zmq_Ctx_Shutdown (Ctx_U : System.Address) return Int; -- zmq.h:194
|
||||
function zmq_ctx_shutdown (ctx_u : System.Address) return int; -- zmq.h:194
|
||||
pragma Obsolescent;
|
||||
pragma Import (C, Zmq_Ctx_Shutdown, "zmq_ctx_shutdown");
|
||||
pragma Import (C, zmq_ctx_shutdown, "zmq_ctx_shutdown");
|
||||
|
||||
function Zmq_Ctx_Set
|
||||
(Context : System.Address;
|
||||
Option : Int;
|
||||
Optval : Int) return Int; -- zmq.h:195
|
||||
pragma Import (C, Zmq_Ctx_Set, "zmq_ctx_set");
|
||||
function zmq_ctx_set (context : System.Address; option : int; optval : int) return int; -- zmq.h:195
|
||||
pragma Import (C, zmq_ctx_set, "zmq_ctx_set");
|
||||
|
||||
function Zmq_Ctx_Get (Context : System.Address; Option : Int) return Int; -- zmq.h:196
|
||||
pragma Import (C, Zmq_Ctx_Get, "zmq_ctx_get");
|
||||
function zmq_ctx_get (context : System.Address; option : int) return int; -- zmq.h:196
|
||||
pragma Import (C, zmq_ctx_get, "zmq_ctx_get");
|
||||
|
||||
function Zmq_Init (Io_Threads : Int) return System.Address; -- zmq.h:199
|
||||
pragma Import (C, Zmq_Init, "zmq_init");
|
||||
-- Old (legacy) API
|
||||
function zmq_init (io_threads : int) return System.Address; -- zmq.h:199
|
||||
pragma Import (C, zmq_init, "zmq_init");
|
||||
|
||||
function Zmq_Term (Context : System.Address) return Int; -- zmq.h:200
|
||||
function zmq_term (context : System.Address) return int; -- zmq.h:200
|
||||
pragma Obsolescent;
|
||||
pragma Import (C, Zmq_Term, "zmq_term");
|
||||
pragma Import (C, zmq_term, "zmq_term");
|
||||
|
||||
function Zmq_Ctx_Destroy (Context : System.Address) return Int; -- zmq.h:201
|
||||
pragma Import (C, Zmq_Ctx_Destroy, "zmq_ctx_destroy");
|
||||
function zmq_ctx_destroy (context : System.Address) return int; -- zmq.h:201
|
||||
pragma Import (C, zmq_ctx_destroy, "zmq_ctx_destroy");
|
||||
|
||||
type Zmq_Msg_T_U_U_Array is array (0 .. 63) of aliased Unsigned_Char;
|
||||
type Zmq_Msg_T is record
|
||||
U_U : aliased Zmq_Msg_T_U_U_Array; -- zmq.h:208
|
||||
-- ****************************************************************************
|
||||
-- 0MQ message definition.
|
||||
-- ****************************************************************************
|
||||
-- Some architectures, like sparc64 and some variants of aarch64, enforce pointer
|
||||
-- * alignment and raise sigbus on violations. Make sure applications allocate
|
||||
-- * zmq_msg_t on addresses aligned on a pointer-size boundary to avoid this issue.
|
||||
--
|
||||
|
||||
type zmq_msg_t_u_u_array is array (0 .. 63) of aliased unsigned_char;
|
||||
type zmq_msg_t is record
|
||||
u_u : aliased zmq_msg_t_u_u_array; -- zmq.h:216
|
||||
end record;
|
||||
pragma Convention (C_Pass_By_Copy, Zmq_Msg_T); -- zmq.h:208
|
||||
pragma Convention (C_Pass_By_Copy, zmq_msg_t); -- zmq.h:212
|
||||
|
||||
-- skipped function type zmq_free_fn
|
||||
|
||||
function Zmq_Msg_Init (Msg : access Zmq_Msg_T) return Int; -- zmq.h:212
|
||||
pragma Import (C, Zmq_Msg_Init, "zmq_msg_init");
|
||||
function zmq_msg_init (msg : access zmq_msg_t) return int; -- zmq.h:228
|
||||
pragma Import (C, zmq_msg_init, "zmq_msg_init");
|
||||
|
||||
function Zmq_Msg_Init_Size (Msg : access Zmq_Msg_T; Size : size_t) return Int; -- zmq.h:213
|
||||
pragma Import (C, Zmq_Msg_Init_Size, "zmq_msg_init_size");
|
||||
function zmq_msg_init_size (msg : access zmq_msg_t; size : size_t) return int; -- zmq.h:229
|
||||
pragma Import (C, zmq_msg_init_size, "zmq_msg_init_size");
|
||||
|
||||
function Zmq_Msg_Init_Data
|
||||
(Msg : access Zmq_Msg_T;
|
||||
Data : System.Address;
|
||||
Size : size_t;
|
||||
Ffn : access procedure (Arg1 : System.Address; Arg2 : System.Address);
|
||||
Hint : System.Address) return Int; -- zmq.h:214
|
||||
pragma Import (C, Zmq_Msg_Init_Data, "zmq_msg_init_data");
|
||||
function zmq_msg_init_data (msg : access zmq_msg_t; data : System.Address; size : size_t;
|
||||
ffn : access procedure (arg1 : System.Address; arg2 : System.Address); hint : System.Address) return int; -- zmq.h:230
|
||||
pragma Import (C, zmq_msg_init_data, "zmq_msg_init_data");
|
||||
|
||||
function Zmq_Msg_Send
|
||||
(Msg : access Zmq_Msg_T;
|
||||
S : System.Address;
|
||||
Flags : Int) return Int; -- zmq.h:216
|
||||
pragma Import (C, Zmq_Msg_Send, "zmq_msg_send");
|
||||
function zmq_msg_send (msg : access zmq_msg_t; s : System.Address; flags : int) return int; -- zmq.h:232
|
||||
pragma Import (C, zmq_msg_send, "zmq_msg_send");
|
||||
|
||||
function Zmq_Msg_Recv
|
||||
(Msg : access Zmq_Msg_T;
|
||||
S : System.Address;
|
||||
Flags : Int) return Int; -- zmq.h:217
|
||||
pragma Import (C, Zmq_Msg_Recv, "zmq_msg_recv");
|
||||
function zmq_msg_recv (msg : access zmq_msg_t; s : System.Address; flags : int) return int; -- zmq.h:233
|
||||
pragma Import (C, zmq_msg_recv, "zmq_msg_recv");
|
||||
|
||||
function Zmq_Msg_Close (Msg : access Zmq_Msg_T) return Int; -- zmq.h:218
|
||||
pragma Import (C, Zmq_Msg_Close, "zmq_msg_close");
|
||||
function zmq_msg_close (msg : access zmq_msg_t) return int; -- zmq.h:234
|
||||
pragma Import (C, zmq_msg_close, "zmq_msg_close");
|
||||
|
||||
function Zmq_Msg_Move (Dest : access Zmq_Msg_T; Src : access Zmq_Msg_T) return Int; -- zmq.h:219
|
||||
pragma Import (C, Zmq_Msg_Move, "zmq_msg_move");
|
||||
function zmq_msg_move (dest : access zmq_msg_t; src : access zmq_msg_t) return int; -- zmq.h:235
|
||||
pragma Import (C, zmq_msg_move, "zmq_msg_move");
|
||||
|
||||
function Zmq_Msg_Copy (Dest : access Zmq_Msg_T; Src : access Zmq_Msg_T) return Int; -- zmq.h:220
|
||||
pragma Import (C, Zmq_Msg_Copy, "zmq_msg_copy");
|
||||
function zmq_msg_copy (dest : access zmq_msg_t; src : access zmq_msg_t) return int; -- zmq.h:236
|
||||
pragma Import (C, zmq_msg_copy, "zmq_msg_copy");
|
||||
|
||||
function Zmq_Msg_Data (Msg : access Zmq_Msg_T) return System.Address; -- zmq.h:221
|
||||
pragma Import (C, Zmq_Msg_Data, "zmq_msg_data");
|
||||
function zmq_msg_data (msg : access zmq_msg_t) return System.Address; -- zmq.h:237
|
||||
pragma Import (C, zmq_msg_data, "zmq_msg_data");
|
||||
|
||||
function Zmq_Msg_Size (Msg : access Zmq_Msg_T) return size_t; -- zmq.h:222
|
||||
pragma Import (C, Zmq_Msg_Size, "zmq_msg_size");
|
||||
function zmq_msg_size (msg : access zmq_msg_t) return size_t; -- zmq.h:238
|
||||
pragma Import (C, zmq_msg_size, "zmq_msg_size");
|
||||
|
||||
function Zmq_Msg_More (Msg : access Zmq_Msg_T) return Int; -- zmq.h:223
|
||||
pragma Import (C, Zmq_Msg_More, "zmq_msg_more");
|
||||
function zmq_msg_more (msg : access zmq_msg_t) return int; -- zmq.h:239
|
||||
pragma Import (C, zmq_msg_more, "zmq_msg_more");
|
||||
|
||||
function Zmq_Msg_Get (Msg : access Zmq_Msg_T; Property : Int) return Int; -- zmq.h:224
|
||||
pragma Import (C, Zmq_Msg_Get, "zmq_msg_get");
|
||||
function zmq_msg_get (msg : access zmq_msg_t; property : int) return int; -- zmq.h:240
|
||||
pragma Import (C, zmq_msg_get, "zmq_msg_get");
|
||||
|
||||
function Zmq_Msg_Set
|
||||
(Msg : access Zmq_Msg_T;
|
||||
Property : Int;
|
||||
Optval : Int) return Int; -- zmq.h:225
|
||||
pragma Import (C, Zmq_Msg_Set, "zmq_msg_set");
|
||||
function zmq_msg_set (msg : access zmq_msg_t; property : int; optval : int) return int; -- zmq.h:241
|
||||
pragma Import (C, zmq_msg_set, "zmq_msg_set");
|
||||
|
||||
function Zmq_Msg_Gets (Msg : access Zmq_Msg_T; Property : Interfaces.C.Strings.Chars_Ptr) return Interfaces.C.Strings.Chars_Ptr; -- zmq.h:226
|
||||
pragma Import (C, Zmq_Msg_Gets, "zmq_msg_gets");
|
||||
function zmq_msg_gets (msg : access zmq_msg_t;
|
||||
property : Interfaces.C.Strings.chars_ptr) return Interfaces.C.Strings.chars_ptr; -- zmq.h:242
|
||||
pragma Import (C, zmq_msg_gets, "zmq_msg_gets");
|
||||
|
||||
function Zmq_Socket (Arg1 : System.Address; C_Type : Int) return System.Address; -- zmq.h:353
|
||||
pragma Import (C, Zmq_Socket, "zmq_socket");
|
||||
-- ****************************************************************************
|
||||
-- 0MQ socket definition.
|
||||
-- ****************************************************************************
|
||||
-- Socket types.
|
||||
-- Deprecated aliases
|
||||
-- Socket options.
|
||||
-- Message options
|
||||
-- Send/recv options.
|
||||
-- Security mechanisms
|
||||
-- Deprecated options and aliases
|
||||
-- ****************************************************************************
|
||||
-- 0MQ socket events and monitoring
|
||||
-- ****************************************************************************
|
||||
-- Socket transport events (TCP and IPC only)
|
||||
function zmq_socket (arg1 : System.Address; c_type : int) return System.Address; -- zmq.h:369
|
||||
pragma Import (C, zmq_socket, "zmq_socket");
|
||||
|
||||
function Zmq_Close (S : System.Address) return Int; -- zmq.h:354
|
||||
pragma Import (C, Zmq_Close, "zmq_close");
|
||||
function zmq_close (s : System.Address) return int; -- zmq.h:370
|
||||
pragma Import (C, zmq_close, "zmq_close");
|
||||
|
||||
function Zmq_Setsockopt
|
||||
(S : System.Address;
|
||||
Option : Int;
|
||||
Optval : System.Address;
|
||||
Optvallen : size_t) return Int; -- zmq.h:355
|
||||
pragma Import (C, Zmq_Setsockopt, "zmq_setsockopt");
|
||||
function zmq_setsockopt (s : System.Address; option : int; optval : System.Address;
|
||||
optvallen : size_t) return int; -- zmq.h:371
|
||||
pragma Import (C, zmq_setsockopt, "zmq_setsockopt");
|
||||
|
||||
function Zmq_Getsockopt
|
||||
(S : System.Address;
|
||||
Option : Int;
|
||||
Optval : System.Address;
|
||||
Optvallen : access size_t) return Int; -- zmq.h:357
|
||||
pragma Import (C, Zmq_Getsockopt, "zmq_getsockopt");
|
||||
function zmq_getsockopt (s : System.Address; option : int; optval : System.Address;
|
||||
optvallen : access size_t) return int; -- zmq.h:373
|
||||
pragma Import (C, zmq_getsockopt, "zmq_getsockopt");
|
||||
|
||||
function Zmq_Bind (S : System.Address; Addr : Interfaces.C.Strings.Chars_Ptr) return Int; -- zmq.h:359
|
||||
pragma Import (C, Zmq_Bind, "zmq_bind");
|
||||
function zmq_bind (s : System.Address; addr : Interfaces.C.Strings.chars_ptr) return int; -- zmq.h:375
|
||||
pragma Import (C, zmq_bind, "zmq_bind");
|
||||
|
||||
function Zmq_Connect (S : System.Address; Addr : Interfaces.C.Strings.Chars_Ptr) return Int; -- zmq.h:360
|
||||
pragma Import (C, Zmq_Connect, "zmq_connect");
|
||||
function zmq_connect (s : System.Address; addr : Interfaces.C.Strings.chars_ptr) return int; -- zmq.h:376
|
||||
pragma Import (C, zmq_connect, "zmq_connect");
|
||||
|
||||
function Zmq_Unbind (S : System.Address; Addr : Interfaces.C.Strings.Chars_Ptr) return Int; -- zmq.h:361
|
||||
pragma Import (C, Zmq_Unbind, "zmq_unbind");
|
||||
function zmq_unbind (s : System.Address; addr : Interfaces.C.Strings.chars_ptr) return int; -- zmq.h:377
|
||||
pragma Import (C, zmq_unbind, "zmq_unbind");
|
||||
|
||||
function Zmq_Disconnect (S : System.Address; Addr : Interfaces.C.Strings.Chars_Ptr) return Int; -- zmq.h:362
|
||||
pragma Import (C, Zmq_Disconnect, "zmq_disconnect");
|
||||
function zmq_disconnect (s : System.Address; addr : Interfaces.C.Strings.chars_ptr) return int; -- zmq.h:378
|
||||
pragma Import (C, zmq_disconnect, "zmq_disconnect");
|
||||
|
||||
function Zmq_Send
|
||||
(S : System.Address;
|
||||
Buf : System.Address;
|
||||
Len : size_t;
|
||||
Flags : Int) return Int; -- zmq.h:363
|
||||
pragma Import (C, Zmq_Send, "zmq_send");
|
||||
function zmq_send (s : System.Address; buf : System.Address; len : size_t; flags : int) return int; -- zmq.h:379
|
||||
pragma Import (C, zmq_send, "zmq_send");
|
||||
|
||||
function Zmq_Send_Const
|
||||
(S : System.Address;
|
||||
Buf : System.Address;
|
||||
Len : size_t;
|
||||
Flags : Int) return Int; -- zmq.h:364
|
||||
pragma Import (C, Zmq_Send_Const, "zmq_send_const");
|
||||
function zmq_send_const (s : System.Address; buf : System.Address; len : size_t; flags : int) return int; -- zmq.h:380
|
||||
pragma Import (C, zmq_send_const, "zmq_send_const");
|
||||
|
||||
function Zmq_Recv
|
||||
(S : System.Address;
|
||||
Buf : System.Address;
|
||||
Len : size_t;
|
||||
Flags : Int) return Int; -- zmq.h:365
|
||||
pragma Import (C, Zmq_Recv, "zmq_recv");
|
||||
function zmq_recv (s : System.Address; buf : System.Address; len : size_t; flags : int) return int; -- zmq.h:381
|
||||
pragma Import (C, zmq_recv, "zmq_recv");
|
||||
|
||||
function Zmq_Socket_Monitor
|
||||
(S : System.Address;
|
||||
Addr : Interfaces.C.Strings.Chars_Ptr;
|
||||
Events : Int) return Int; -- zmq.h:366
|
||||
pragma Import (C, Zmq_Socket_Monitor, "zmq_socket_monitor");
|
||||
function zmq_socket_monitor (s : System.Address; addr : Interfaces.C.Strings.chars_ptr;
|
||||
events : int) return int; -- zmq.h:382
|
||||
pragma Import (C, zmq_socket_monitor, "zmq_socket_monitor");
|
||||
|
||||
type Zmq_Pollitem_T is record
|
||||
Socket : System.Address; -- zmq.h:379
|
||||
Fd : aliased Int; -- zmq.h:383
|
||||
Events : aliased Short; -- zmq.h:385
|
||||
Revents : aliased Short; -- zmq.h:386
|
||||
-- ****************************************************************************
|
||||
-- I/O multiplexing.
|
||||
-- ****************************************************************************
|
||||
type zmq_pollitem_t is record
|
||||
socket : System.Address; -- zmq.h:395
|
||||
fd : aliased int; -- zmq.h:399
|
||||
events : aliased short; -- zmq.h:401
|
||||
revents : aliased short; -- zmq.h:402
|
||||
end record;
|
||||
pragma Convention (C_Pass_By_Copy, Zmq_Pollitem_T); -- zmq.h:377
|
||||
pragma Convention (C_Pass_By_Copy, zmq_pollitem_t); -- zmq.h:393
|
||||
|
||||
function Zmq_Poll
|
||||
(Items : access Zmq_Pollitem_T;
|
||||
Nitems : Int;
|
||||
Timeout : Long) return Int; -- zmq.h:391
|
||||
pragma Import (C, Zmq_Poll, "zmq_poll");
|
||||
function zmq_poll (items : access zmq_pollitem_t; nitems : int; timeout : long) return int; -- zmq.h:407
|
||||
pragma Import (C, zmq_poll, "zmq_poll");
|
||||
|
||||
function Zmq_Proxy
|
||||
(Frontend : System.Address;
|
||||
Backend : System.Address;
|
||||
Capture : System.Address) return Int; -- zmq.h:397
|
||||
pragma Import (C, Zmq_Proxy, "zmq_proxy");
|
||||
-- ****************************************************************************
|
||||
-- Message proxying
|
||||
-- ****************************************************************************
|
||||
function zmq_proxy (frontend : System.Address; backend : System.Address; capture : System.Address) return int; -- zmq.h:413
|
||||
pragma Import (C, zmq_proxy, "zmq_proxy");
|
||||
|
||||
function Zmq_Proxy_Steerable
|
||||
(Frontend : System.Address;
|
||||
Backend : System.Address;
|
||||
Capture : System.Address;
|
||||
Control : System.Address) return Int; -- zmq.h:398
|
||||
pragma Import (C, Zmq_Proxy_Steerable, "zmq_proxy_steerable");
|
||||
function zmq_proxy_steerable (frontend : System.Address; backend : System.Address; capture : System.Address;
|
||||
control : System.Address) return int; -- zmq.h:414
|
||||
pragma Import (C, zmq_proxy_steerable, "zmq_proxy_steerable");
|
||||
|
||||
function zmq_has (Capability : Interfaces.C.Strings.Chars_Ptr) return Int; -- zmq.h:405
|
||||
-- ****************************************************************************
|
||||
-- Probe library capabilities
|
||||
-- ****************************************************************************
|
||||
function zmq_has (capability : Interfaces.C.Strings.chars_ptr) return int; -- zmq.h:421
|
||||
pragma Import (C, zmq_has, "zmq_has");
|
||||
|
||||
function Zmq_Device
|
||||
(C_Type : Int;
|
||||
Frontend : System.Address;
|
||||
Backend : System.Address) return Int; -- zmq.h:413
|
||||
pragma Import (C, Zmq_Device, "zmq_device");
|
||||
-- Deprecated aliases
|
||||
-- Deprecated methods
|
||||
function zmq_device (c_type : int; frontend : System.Address; backend : System.Address) return int; -- zmq.h:429
|
||||
pragma Import (C, zmq_device, "zmq_device");
|
||||
|
||||
function Zmq_Sendmsg
|
||||
(S : System.Address;
|
||||
Msg : access Zmq_Msg_T;
|
||||
Flags : Int) return Int; -- zmq.h:414
|
||||
function zmq_sendmsg (s : System.Address; msg : access zmq_msg_t; flags : int) return int; -- zmq.h:430
|
||||
pragma Obsolescent;
|
||||
pragma Import (C, Zmq_Sendmsg, "zmq_sendmsg");
|
||||
pragma Import (C, zmq_sendmsg, "zmq_sendmsg");
|
||||
|
||||
function Zmq_Recvmsg
|
||||
(S : System.Address;
|
||||
Msg : access Zmq_Msg_T;
|
||||
Flags : Int) return Int; -- zmq.h:415
|
||||
function zmq_recvmsg (s : System.Address; msg : access zmq_msg_t; flags : int) return int; -- zmq.h:431
|
||||
pragma Obsolescent;
|
||||
pragma Import (C, Zmq_Recvmsg, "zmq_recvmsg");
|
||||
pragma Import (C, zmq_recvmsg, "zmq_recvmsg");
|
||||
|
||||
function Zmq_Z85_Encode
|
||||
(Dest : Interfaces.C.Strings.Chars_Ptr;
|
||||
Data : access Extensions.Unsigned_8;
|
||||
Size : size_t) return Interfaces.C.Strings.Chars_Ptr; -- zmq.h:423
|
||||
pragma Import (C, Zmq_Z85_Encode, "zmq_z85_encode");
|
||||
-- ****************************************************************************
|
||||
-- Encryption functions
|
||||
-- ****************************************************************************
|
||||
-- Encode data with Z85 encoding. Returns encoded data
|
||||
function zmq_z85_encode (dest : Interfaces.C.Strings.chars_ptr; data : access Interfaces.Unsigned_8;
|
||||
size : size_t) return Interfaces.C.Strings.chars_ptr; -- zmq.h:439
|
||||
pragma Import (C, zmq_z85_encode, "zmq_z85_encode");
|
||||
|
||||
function Zmq_Z85_Decode (Dest : access Extensions.Unsigned_8; String : Interfaces.C.Strings.Chars_Ptr) return access Extensions.Unsigned_8; -- zmq.h:426
|
||||
pragma Import (C, Zmq_Z85_Decode, "zmq_z85_decode");
|
||||
-- Decode data with Z85 encoding. Returns decoded data
|
||||
function zmq_z85_decode (dest : access Interfaces.Unsigned_8;
|
||||
string : Interfaces.C.Strings.chars_ptr) return access Interfaces.Unsigned_8; -- zmq.h:442
|
||||
pragma Import (C, zmq_z85_decode, "zmq_z85_decode");
|
||||
|
||||
function Zmq_Curve_Keypair (Z85_Public_Key : Interfaces.C.Strings.Chars_Ptr; Z85_Secret_Key : Interfaces.C.Strings.Chars_Ptr) return Int; -- zmq.h:430
|
||||
pragma Import (C, Zmq_Curve_Keypair, "zmq_curve_keypair");
|
||||
-- Generate z85-encoded public and private keypair with libsodium.
|
||||
-- Returns 0 on success.
|
||||
function zmq_curve_keypair (z85_public_key : Interfaces.C.Strings.chars_ptr;
|
||||
z85_secret_key : Interfaces.C.Strings.chars_ptr) return int; -- zmq.h:446
|
||||
pragma Import (C, zmq_curve_keypair, "zmq_curve_keypair");
|
||||
|
||||
-- skipped empty struct iovec
|
||||
-- ****************************************************************************
|
||||
-- These functions are not documented by man pages -- use at your own risk.
|
||||
-- If you need these to be part of the formal ZMQ API, then (a) write a man
|
||||
-- page, and (b) write a test case in tests.
|
||||
-- ****************************************************************************
|
||||
-- skipped incomplete struct iovec
|
||||
|
||||
function Zmq_Sendiov
|
||||
(S : System.Address;
|
||||
Iov : System.Address;
|
||||
Count : size_t;
|
||||
Flags : Int) return Int; -- zmq.h:441
|
||||
pragma Import (C, Zmq_Sendiov, "zmq_sendiov");
|
||||
function zmq_sendiov (s : System.Address; iov : System.Address; count : size_t; flags : int) return int; -- zmq.h:457
|
||||
pragma Import (C, zmq_sendiov, "zmq_sendiov");
|
||||
|
||||
function Zmq_Recviov
|
||||
(S : System.Address;
|
||||
Iov : System.Address;
|
||||
Count : access size_t;
|
||||
Flags : Int) return Int; -- zmq.h:442
|
||||
pragma Import (C, Zmq_Recviov, "zmq_recviov");
|
||||
function zmq_recviov (s : System.Address; iov : System.Address; count : access size_t; flags : int) return int; -- zmq.h:458
|
||||
pragma Import (C, zmq_recviov, "zmq_recviov");
|
||||
|
||||
function Zmq_Stopwatch_Start return System.Address; -- zmq.h:448
|
||||
pragma Import (C, Zmq_Stopwatch_Start, "zmq_stopwatch_start");
|
||||
-- Helper functions are used by perf tests so that they don't have to care
|
||||
-- about minutiae of time-related functions on different OS platforms.
|
||||
-- Starts the stopwatch. Returns the handle to the watch.
|
||||
function zmq_stopwatch_start return System.Address; -- zmq.h:464
|
||||
pragma Import (C, zmq_stopwatch_start, "zmq_stopwatch_start");
|
||||
|
||||
function Zmq_Stopwatch_Stop (Watch_U : System.Address) return Unsigned_Long; -- zmq.h:452
|
||||
pragma Import (C, Zmq_Stopwatch_Stop, "zmq_stopwatch_stop");
|
||||
-- Stops the stopwatch. Returns the number of microseconds elapsed since
|
||||
-- the stopwatch was started.
|
||||
function zmq_stopwatch_stop (watch_u : System.Address) return unsigned_long; -- zmq.h:468
|
||||
pragma Import (C, zmq_stopwatch_stop, "zmq_stopwatch_stop");
|
||||
|
||||
procedure Zmq_Sleep (Seconds_U : Int); -- zmq.h:455
|
||||
pragma Import (C, Zmq_Sleep, "zmq_sleep");
|
||||
-- Sleeps for specified number of seconds.
|
||||
procedure zmq_sleep (seconds_u : int); -- zmq.h:471
|
||||
pragma Import (C, zmq_sleep, "zmq_sleep");
|
||||
|
||||
-- skipped function type zmq_thread_fn
|
||||
|
||||
function Zmq_Threadstart (Func : access procedure (Arg1 : System.Address); Arg : System.Address) return System.Address; -- zmq.h:460
|
||||
pragma Import (C, Zmq_Threadstart, "zmq_threadstart");
|
||||
-- Start a thread. Returns a handle to the thread.
|
||||
function zmq_threadstart (func : access procedure (arg1 : System.Address);
|
||||
arg : System.Address) return System.Address; -- zmq.h:476
|
||||
pragma Import (C, zmq_threadstart, "zmq_threadstart");
|
||||
|
||||
procedure Zmq_Threadclose (Thread : System.Address); -- zmq.h:463
|
||||
pragma Import (C, Zmq_Threadclose, "zmq_threadclose");
|
||||
-- Wait for thread to complete then free up resources.
|
||||
procedure zmq_threadclose (thread : System.Address); -- zmq.h:479
|
||||
pragma Import (C, zmq_threadclose, "zmq_threadclose");
|
||||
|
||||
end ZMQ.Low_Level;
|
||||
-- end read only
|
||||
|
|
|
@ -50,7 +50,7 @@ package body ZMQ.Contexts is
|
|||
if This.C /= Null_Address then
|
||||
raise ZMQ_Error with "Already Initialized";
|
||||
end if;
|
||||
This.C := Low_Level.Zmq_Ctx_New;
|
||||
This.C := Low_Level.zmq_ctx_new;
|
||||
if This.C = Null_Address then
|
||||
raise ZMQ_Error with Error_Message (GNAT.OS_Lib.Errno) & " in " &
|
||||
GNAT.Source_Info.Enclosing_Entity;
|
||||
|
@ -67,7 +67,7 @@ package body ZMQ.Contexts is
|
|||
Rc : int;
|
||||
begin
|
||||
if This.Is_Connected then
|
||||
Rc := Low_Level.Zmq_Ctx_Destroy (This.C);
|
||||
Rc := Low_Level.zmq_ctx_destroy (This.C);
|
||||
if Rc /= 0 then
|
||||
raise ZMQ_Error with Error_Message (GNAT.OS_Lib.Errno) & " in " &
|
||||
GNAT.Source_Info.Enclosing_Entity;
|
||||
|
@ -93,7 +93,7 @@ package body ZMQ.Contexts is
|
|||
Threads : Natural := 1) is
|
||||
Status : int;
|
||||
begin
|
||||
Status := Low_Level.Zmq_Ctx_Set
|
||||
Status := Low_Level.zmq_ctx_set
|
||||
(This.C, Low_Level.Defs.ZMQ_IO_THREADS, int (Threads));
|
||||
if Status /= 0 then
|
||||
raise Program_Error with Error_Message (Integer (Status));
|
||||
|
@ -105,7 +105,7 @@ package body ZMQ.Contexts is
|
|||
function Get_Number_Of_IO_Threads (This : in out Context) return Natural is
|
||||
begin
|
||||
return Natural
|
||||
(Low_Level.Zmq_Ctx_Get (This.C, Low_Level.Defs.ZMQ_IO_THREADS));
|
||||
(Low_Level.zmq_ctx_get (This.C, Low_Level.Defs.ZMQ_IO_THREADS));
|
||||
end Get_Number_Of_IO_Threads;
|
||||
|
||||
not overriding
|
||||
|
@ -113,7 +113,7 @@ package body ZMQ.Contexts is
|
|||
(This : in out Context; Count : Positive := 1024) is
|
||||
status : int;
|
||||
begin
|
||||
status := Low_Level.Zmq_Ctx_Set
|
||||
status := Low_Level.zmq_ctx_set
|
||||
(This.C, Low_Level.Defs.ZMQ_MAX_SOCKETS, int (Count));
|
||||
if status /= 0
|
||||
then
|
||||
|
@ -127,7 +127,7 @@ package body ZMQ.Contexts is
|
|||
(This : in out Context) return Natural is
|
||||
begin
|
||||
return Natural
|
||||
(Low_Level.Zmq_Ctx_Get (This.C, Low_Level.Defs.ZMQ_MAX_SOCKETS));
|
||||
(Low_Level.zmq_ctx_get (This.C, Low_Level.Defs.ZMQ_MAX_SOCKETS));
|
||||
end Get_Maximum_Number_Of_Sockets;
|
||||
|
||||
not overriding
|
||||
|
@ -135,7 +135,7 @@ package body ZMQ.Contexts is
|
|||
(This : in out Context; Enable : Boolean := False) is
|
||||
Status : int;
|
||||
begin
|
||||
Status := Low_Level.Zmq_Ctx_Set
|
||||
Status := Low_Level.zmq_ctx_set
|
||||
(This.C, Low_Level.Defs.ZMQ_IPV6, Boolean'Pos (Enable));
|
||||
if Status /= 0
|
||||
then
|
||||
|
@ -146,7 +146,7 @@ package body ZMQ.Contexts is
|
|||
not overriding
|
||||
function Get_IPv6 (This : in out Context) return Boolean is
|
||||
begin
|
||||
return Low_Level.Zmq_Ctx_Get
|
||||
return Low_Level.zmq_ctx_get
|
||||
(This.C, Low_Level.Defs.ZMQ_MAX_SOCKETS) = 1;
|
||||
end Get_IPv6;
|
||||
|
||||
|
|
|
@ -47,9 +47,9 @@ package body ZMQ.Messages is
|
|||
Ret : int;
|
||||
begin
|
||||
if Size > 0 then
|
||||
Ret := Low_Level.Zmq_Msg_Init_Size (Self.Msg'Access, size_t (Size));
|
||||
Ret := Low_Level.zmq_msg_init_size (Self.Msg'Access, size_t (Size));
|
||||
else
|
||||
Ret := Low_Level.Zmq_Msg_Init (Self.Msg'Access);
|
||||
Ret := Low_Level.zmq_msg_init (Self.Msg'Access);
|
||||
end if;
|
||||
if Ret /= 0 then
|
||||
raise ZMQ_Error with Error_Message (GNAT.OS_Lib.Errno) & " in " &
|
||||
|
@ -94,7 +94,7 @@ package body ZMQ.Messages is
|
|||
is
|
||||
Ret : int;
|
||||
begin
|
||||
Ret := Low_Level.Zmq_Msg_Init_Data (Self.Msg'Access,
|
||||
Ret := Low_Level.zmq_msg_init_data (Self.Msg'Access,
|
||||
Message,
|
||||
size_t (Size),
|
||||
Free,
|
||||
|
@ -170,7 +170,7 @@ package body ZMQ.Messages is
|
|||
---------------
|
||||
function GetData (Self : Message) return System.Address is
|
||||
begin
|
||||
return Low_Level.Zmq_Msg_Data (Self.Msg'Unrestricted_Access);
|
||||
return Low_Level.zmq_msg_data (Self.Msg'Unrestricted_Access);
|
||||
end GetData;
|
||||
|
||||
|
||||
|
@ -225,7 +225,7 @@ package body ZMQ.Messages is
|
|||
---------------
|
||||
function GetSize (Self : Message) return Natural is
|
||||
begin
|
||||
return Natural (Low_Level.Zmq_Msg_Size (Self.Msg'Unrestricted_Access));
|
||||
return Natural (Low_Level.zmq_msg_size (Self.Msg'Unrestricted_Access));
|
||||
end GetSize;
|
||||
|
||||
|
||||
|
@ -236,7 +236,7 @@ package body ZMQ.Messages is
|
|||
procedure Finalize (Self : in out Message) is
|
||||
Ret : int;
|
||||
begin
|
||||
Ret := Low_Level.Zmq_Msg_Close (Self.Msg'Access);
|
||||
Ret := Low_Level.zmq_msg_close (Self.Msg'Access);
|
||||
if Ret /= 0 then
|
||||
raise ZMQ_Error with Error_Message (GNAT.OS_Lib.Errno) & " in " &
|
||||
GNAT.Source_Info.Enclosing_Entity;
|
||||
|
|
|
@ -103,7 +103,7 @@ package ZMQ.Messages is
|
|||
|
||||
procedure Finalize (Self : in out Message);
|
||||
|
||||
type Zmq_Msg_T_Access is access all ZMQ.Low_Level.Zmq_Msg_T;
|
||||
type Zmq_Msg_T_Access is access all ZMQ.Low_Level.zmq_msg_t;
|
||||
function GetImpl (Self : Message) return not null Zmq_Msg_T_Access;
|
||||
|
||||
|
||||
|
@ -131,7 +131,7 @@ package ZMQ.Messages is
|
|||
|
||||
private
|
||||
type Message is new Ada.Finalization.Limited_Controlled with record
|
||||
Msg : aliased ZMQ.Low_Level.Zmq_Msg_T;
|
||||
Msg : aliased ZMQ.Low_Level.zmq_msg_t;
|
||||
end record;
|
||||
|
||||
end ZMQ.Messages;
|
||||
|
|
|
@ -41,7 +41,7 @@ package ZMQ.Pollsets is
|
|||
Timeout : Duration);
|
||||
private
|
||||
type Ll_Polset is array (Natural range <>)
|
||||
of aliased ZMQ.Low_Level.Zmq_Pollitem_T;
|
||||
of aliased ZMQ.Low_Level.zmq_pollitem_t;
|
||||
type Pollset (Max_Size : Natural := 32) is tagged limited record
|
||||
Local_Data : aliased Ll_Polset (1 .. Max_Size);
|
||||
Cursor : Natural := 1;
|
||||
|
|
|
@ -46,7 +46,7 @@ package body ZMQ.Proxys is
|
|||
Dummy : int;
|
||||
pragma Unreferenced (Dummy);
|
||||
begin
|
||||
Dummy := ZMQ.Low_Level.Zmq_Proxy
|
||||
Dummy := ZMQ.Low_Level.zmq_proxy
|
||||
(Frontend.Get_Impl, Backend.Get_Impl,
|
||||
(if Capture /= null then Capture.Get_Impl else System.Null_Address));
|
||||
end Proxy;
|
||||
|
|
|
@ -54,7 +54,7 @@ package body ZMQ.Sockets is
|
|||
raise ZMQ_Error with "Socket Initialized";
|
||||
end if;
|
||||
|
||||
This.C := Low_Level.Zmq_Socket (With_Context.GetImpl,
|
||||
This.C := Low_Level.zmq_socket (With_Context.GetImpl,
|
||||
Socket_Type'Pos (Kind));
|
||||
if This.C = Null_Address then
|
||||
raise ZMQ_Error with "Unable to initialize";
|
||||
|
@ -73,7 +73,7 @@ package body ZMQ.Sockets is
|
|||
Addr : chars_ptr := Interfaces.C.Strings.New_String (Address);
|
||||
Ret : int;
|
||||
begin
|
||||
Ret := Low_Level.Zmq_Bind (This.C, Addr);
|
||||
Ret := Low_Level.zmq_bind (This.C, Addr);
|
||||
Free (Addr);
|
||||
if Ret /= 0 then
|
||||
raise ZMQ_Error with Error_Message (GNAT.OS_Lib.Errno) & " in " &
|
||||
|
@ -95,7 +95,7 @@ package body ZMQ.Sockets is
|
|||
Addr : chars_ptr := Interfaces.C.Strings.New_String (Address);
|
||||
Ret : int;
|
||||
begin
|
||||
Ret := Low_Level.Zmq_Unbind (This.C, Addr);
|
||||
Ret := Low_Level.zmq_unbind (This.C, Addr);
|
||||
Free (Addr);
|
||||
if Ret /= 0 then
|
||||
raise ZMQ_Error with Error_Message (GNAT.OS_Lib.Errno) & " in " &
|
||||
|
@ -115,7 +115,7 @@ package body ZMQ.Sockets is
|
|||
Value_Size : Natural) is
|
||||
Ret : int;
|
||||
begin
|
||||
Ret := Low_Level.Zmq_Setsockopt
|
||||
Ret := Low_Level.zmq_setsockopt
|
||||
(This.C,
|
||||
Option,
|
||||
Value,
|
||||
|
@ -222,7 +222,7 @@ package body ZMQ.Sockets is
|
|||
Addr : chars_ptr := Interfaces.C.Strings.New_String (Address);
|
||||
Ret : int;
|
||||
begin
|
||||
Ret := Low_Level.Zmq_Connect (This.C, Addr);
|
||||
Ret := Low_Level.zmq_connect (This.C, Addr);
|
||||
Free (Addr);
|
||||
if Ret /= 0 then
|
||||
raise ZMQ_Error with Error_Message (GNAT.OS_Lib.Errno) & " in " &
|
||||
|
@ -249,7 +249,7 @@ package body ZMQ.Sockets is
|
|||
is
|
||||
Ret : int;
|
||||
begin
|
||||
Ret := Low_Level.Zmq_Msg_Send (Msg.GetImpl, This.C, int (Flags));
|
||||
Ret := Low_Level.zmq_msg_send (Msg.GetImpl, This.C, int (Flags));
|
||||
if Ret = -1 then
|
||||
raise ZMQ_Error with Error_Message (GNAT.OS_Lib.Errno) & " in " &
|
||||
GNAT.Source_Info.Enclosing_Entity;
|
||||
|
@ -302,7 +302,7 @@ package body ZMQ.Sockets is
|
|||
Flags : Socket_Flags := No_Flags) is
|
||||
Ret : int;
|
||||
begin
|
||||
Ret := Low_Level.Zmq_Send
|
||||
Ret := Low_Level.zmq_send
|
||||
(This.C, Msg_Address, Interfaces.C.size_t (Msg_Length), int (Flags));
|
||||
if Ret = -1 then
|
||||
raise ZMQ_Error with Error_Message (GNAT.OS_Lib.Errno) & " in " &
|
||||
|
@ -338,7 +338,7 @@ package body ZMQ.Sockets is
|
|||
is
|
||||
Ret : int;
|
||||
begin
|
||||
Ret := Low_Level.Zmq_Msg_Recv (Msg.GetImpl,
|
||||
Ret := Low_Level.zmq_msg_recv (Msg.GetImpl,
|
||||
This.C,
|
||||
int (Flags));
|
||||
|
||||
|
@ -413,7 +413,7 @@ package body ZMQ.Sockets is
|
|||
Ret : int;
|
||||
begin
|
||||
if This.C /= Null_Address then
|
||||
Ret := Low_Level.Zmq_Close (This.C);
|
||||
Ret := Low_Level.zmq_close (This.C);
|
||||
if Ret /= 0 then
|
||||
raise ZMQ_Error with Error_Message (GNAT.OS_Lib.Errno);
|
||||
end if;
|
||||
|
@ -426,7 +426,7 @@ package body ZMQ.Sockets is
|
|||
Capture : access Socket'Class) is
|
||||
Ret : int;
|
||||
begin
|
||||
Ret := Low_Level.Zmq_Proxy
|
||||
Ret := Low_Level.zmq_proxy
|
||||
(Frontend.C,
|
||||
Backend.C,
|
||||
(if Capture /= null then Capture.C else System.Null_Address));
|
||||
|
@ -687,7 +687,7 @@ package body ZMQ.Sockets is
|
|||
(This : Socket) return Duration is
|
||||
begin
|
||||
return Duration (Integer'(This.Getsockopt
|
||||
(Low_Level.Defs.ZMQ_RCVTIMEO)) * 1000.0);
|
||||
(Low_Level.Defs.ZMQ_RCVTIMEO))) * 1000.0;
|
||||
end Get_Recieve_Timeout;
|
||||
not overriding
|
||||
procedure Set_Recieve_Timeout
|
||||
|
@ -708,7 +708,7 @@ package body ZMQ.Sockets is
|
|||
(This : Socket) return Duration is
|
||||
begin
|
||||
return Duration (Integer'(This.Getsockopt
|
||||
(Low_Level.Defs.ZMQ_SNDTIMEO)) * 1000.0);
|
||||
(Low_Level.Defs.ZMQ_SNDTIMEO))) * 1000.0;
|
||||
end Get_Send_Timeout;
|
||||
not overriding
|
||||
procedure Set_Send_Timeout
|
||||
|
@ -755,7 +755,7 @@ package body ZMQ.Sockets is
|
|||
Ret : int;
|
||||
Value_Size_I : aliased size_t;
|
||||
begin
|
||||
Ret := Low_Level.Zmq_Getsockopt
|
||||
Ret := Low_Level.zmq_getsockopt
|
||||
(This.C,
|
||||
Option,
|
||||
Value,
|
||||
|
@ -837,7 +837,7 @@ package body ZMQ.Sockets is
|
|||
(This : in Socket;
|
||||
Option : Interfaces.C.int) return Duration is
|
||||
begin
|
||||
return Duration (Integer'(This.Getsockopt (Option)) * 1000.0);
|
||||
return Duration (Integer'(This.Getsockopt (Option))) * 1000.0;
|
||||
end Getsockopt;
|
||||
|
||||
function More_Message_Parts_To_Follow (This : Socket) return Boolean is
|
||||
|
|
|
@ -234,14 +234,12 @@ package body ZMQ.Utilities.Memory_Streams is
|
|||
end Initialize;
|
||||
|
||||
procedure Finalize (This : in out Dynamic_Memory_Stream) is
|
||||
use System.Memory;
|
||||
begin
|
||||
System.Memory.Free (This.Buffer.As_Address);
|
||||
end Finalize;
|
||||
|
||||
|
||||
procedure Initialize (This : in out Controler) is
|
||||
use System.Memory;
|
||||
begin
|
||||
This.Controled.Initialize;
|
||||
end Initialize;
|
||||
|
|
|
@ -51,7 +51,7 @@ package body ZMQ is
|
|||
Patch : aliased int;
|
||||
begin
|
||||
return Ret : Version_Type do
|
||||
Low_Level.Zmq_Version (Major'Access,
|
||||
Low_Level.zmq_version (Major'Access,
|
||||
Minor'Access,
|
||||
Patch'Access);
|
||||
Ret := (Natural (Major), Natural (Minor), Natural (Patch));
|
||||
|
|
|
@ -6,7 +6,6 @@ with AUnit.Assertions; use AUnit.Assertions;
|
|||
package body ZMQ.Tests.Testcases.Test_Pubsub is
|
||||
use AUnit;
|
||||
use Ada.Strings.Unbounded;
|
||||
use GNAT.Source_Info;
|
||||
MSG_STRING : constant Unbounded_String := To_Unbounded_String ("Query");
|
||||
|
||||
|
||||
|
|
|
@ -7,7 +7,6 @@ with GNAT.Spitbol; use GNAT.Spitbol;
|
|||
package body ZMQ.Tests.Testcases.Test_REQRESP is
|
||||
use AUnit;
|
||||
use Ada.Strings.Unbounded;
|
||||
use GNAT.Source_Info;
|
||||
|
||||
REQUEST_STRING : constant Unbounded_String := V ("Query");
|
||||
RESPONSE_STRING : constant Unbounded_String := V ("Reply");
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
../zmq.ide.py
|
|
@ -0,0 +1,41 @@
|
|||
<?xml version="1.0" ?>
|
||||
<exceptions>
|
||||
<case_exceptions>
|
||||
<word>zmq_errno</word>
|
||||
<word>zmq_strerror</word>
|
||||
<word>zmq_ctx_new</word>
|
||||
<word>zmq_ctx_term</word>
|
||||
<word>zmq_ctx_shutdown</word>
|
||||
<word>zmq_ctx_get</word>
|
||||
<word>zmq_init</word>
|
||||
<word>zmq_term</word>
|
||||
<word>zmq_ctx_destroy</word>
|
||||
<word>zmq_msg_t_u_u_array</word>
|
||||
<word>zmq_msg_t</word>
|
||||
<word>zmq_msg_init</word>
|
||||
<word>zmq_msg_init_size</word>
|
||||
<word>zmq_msg_close</word>
|
||||
<word>zmq_msg_move</word>
|
||||
<word>zmq_msg_copy</word>
|
||||
<word>zmq_msg_data</word>
|
||||
<word>zmq_msg_size</word>
|
||||
<word>zmq_msg_more</word>
|
||||
<word>zmq_msg_get</word>
|
||||
<word>zmq_msg_gets</word>
|
||||
<word>zmq_socket</word>
|
||||
<word>zmq_close</word>
|
||||
<word>zmq_bind</word>
|
||||
<word>zmq_connect</word>
|
||||
<word>zmq_unbind</word>
|
||||
<word>zmq_disconnect</word>
|
||||
<word>zmq_pollitem_t</word>
|
||||
<word>zmq_has</word>
|
||||
<word>zmq_z85_decode</word>
|
||||
<word>zmq_curve_keypair</word>
|
||||
<word>zmq_stopwatch_start</word>
|
||||
<word>zmq_stopwatch_stop</word>
|
||||
<word>zmq_sleep</word>
|
||||
<word>zmq_threadstart</word>
|
||||
<word>zmq_threadclose</word>
|
||||
</case_exceptions>
|
||||
</exceptions>
|
|
@ -0,0 +1,22 @@
|
|||
import GPS
|
||||
|
||||
from os.path import *
|
||||
|
||||
|
||||
def do_load():
|
||||
for i in [".", "..", "../.."]:
|
||||
path = join(i, "zmq-case_exceptions.xml")
|
||||
if exists(path):
|
||||
with open(path) as inf:
|
||||
buffer = inf.read()
|
||||
print buffer
|
||||
GPS.parse_xml(buffer)
|
||||
print "OK"
|
||||
|
||||
try:
|
||||
if GPS.zmq_config_is_loaded:
|
||||
print "OK"
|
||||
except:
|
||||
GPS.zmq_config_is_loaded = True
|
||||
print "\nLOAD\n"
|
||||
do_load()
|
Loading…
Reference in New Issue