Created
January 19, 2016 13:35
-
-
Save somdoron/f27e4924031db108f5e8 to your computer and use it in GitHub Desktop.
zstruct
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<class name = "zstruct"> | |
<!-- | |
Copyright (c) the Contributors as noted in the AUTHORS file. | |
This file is part of CZMQ, the high-level C binding for 0MQ: | |
http://czmq.zeromq.org. | |
This Source Code Form is subject to the terms of the Mozilla Public | |
License, v. 2.0. If a copy of the MPL was not distributed with this | |
file, You can obtain one at http://mozilla.org/MPL/2.0/. | |
--> | |
sending and receiving structures | |
<constructor> | |
Create a new structure to be send or received over a socket. | |
The picture can contain any of these characters: | |
1 = uint8_t | |
2 = uint16_t | |
4 = uint32_t | |
8 = uint64_t | |
s = char * | |
b = byte *, size_t (2 arguments) | |
c = zchunk_t * | |
h = zhashx_t * | |
U = zuuid_t * | |
p = void * (sends the pointer value, only meaningful over inproc) | |
<argument name = "picture" type = "string" /> | |
</constructor> | |
<destructor> | |
Destroy a structure | |
</destructor> | |
<method name = "recv"> | |
Receive structure from socket. | |
Return -1 on error, 0 on success. | |
<argument name = "source" type = "anything" /> | |
<return type = "integer" /> | |
</method> | |
<method name = "send"> | |
Send the structure to the socket. | |
Return -1 on error, 0 on success. | |
<argument name = "source" type = "anything" /> | |
<return type = "integer" /> | |
</method> | |
<method name = "routing id"> | |
Return structure routing ID, if the structure came from a ZMQ_SERVER socket. | |
Else returns zero. | |
<return type = "number" size = "4" /> | |
</method> | |
<method name = "set routing id"> | |
Set routing ID on structure. This is used if/when the frame is sent to a | |
ZMQ_SERVER socket. | |
<argument name = "routing id" type = "number" size = "4" /> | |
</method> | |
<method name = "element index"> | |
Get the element index. Index of the current element being get or set. | |
<return type = "integer" /> | |
</method> | |
<method name = "set element index"> | |
Set the element index. | |
<argument name = "value" type = "integer" /> | |
</method> | |
<method name = "uint8"> | |
Get element as uint8. | |
Increasing element index. | |
Return -1 on error, 0 on success. | |
<argument name = "value_p" type = "number" size = "1" by_reference = "1" /> | |
<return type = "integer" /> | |
</method> | |
<method name = "set uint8"> | |
Set element as uint8. | |
Increasing element index. | |
Return -1 on error, 0 on success. | |
<argument name = "value" type = "number" size = "1" /> | |
<return type = "integer" /> | |
</method> | |
<method name = "uint16"> | |
Get element as uint16. | |
Increasing element index. | |
Return -1 on error, 0 on success. | |
<argument name = "value_p" type = "number" size = "2" by_reference = "1" /> | |
<return type = "integer" /> | |
</method> | |
<method name = "set uint16"> | |
Set element as uint16. | |
Increasing element index. | |
Return -1 on error, 0 on success. | |
<argument name = "value" type = "number" size = "2" /> | |
<return type = "integer" /> | |
</method> | |
<method name = "uint32"> | |
Get element as uint32. | |
Increasing element index. | |
Return -1 on error, 0 on success. | |
<argument name = "value_p" type = "number" size = "4" by_reference = "1" /> | |
<return type = "integer" /> | |
</method> | |
<method name = "set uint32"> | |
Set element as uint32. | |
Increasing element index. | |
Return -1 on error, 0 on success. | |
<argument name = "value" type = "number" size = "4" /> | |
<return type = "integer" /> | |
</method> | |
<method name = "uint64"> | |
Get element as uint64. | |
Increasing element index. | |
Return -1 on error, 0 on success. | |
<argument name = "value_p" type = "number" size = "8" by_reference = "1" /> | |
<return type = "integer" /> | |
</method> | |
<method name = "set uint64"> | |
Set element as uint64. | |
Increasing element index. | |
Return -1 on error, 0 on success. | |
<argument name = "value" type = "number" size = "8" /> | |
<return type = "integer" /> | |
</method> | |
<method name = "string"> | |
Get element as string. | |
Increasing element index. | |
Return NULL on error, string on success. | |
<return type = "string" /> | |
</method> | |
<method name = "set string"> | |
Set element as string. | |
Increasing element index. | |
Return -1 on error, 0 on success. | |
<argument name = "value" type = "string" /> | |
<return type = "integer" /> | |
</method> | |
<method name = "bytes"> | |
Get element as bytes, without transferring ownership. | |
Increasing element index. | |
Return NULL on error, bytes on success. | |
<argument name = "size_p" type = "integer" by_reference = "1" /> | |
<return type = "buffer" /> | |
</method> | |
<method name = "set bytes"> | |
Set element as bytes, transferring ownership from caller. | |
Increasing element index. | |
Return -1 on error, 0 on success. | |
<argument name = "bytes" type = "buffer" /> | |
<argument name = "size" type = "integer" /> | |
<return type = "integer" /> | |
</method> | |
<method name = "chunk"> | |
Get element as chunk, without transferring ownership. | |
Increasing element index. | |
Return NULL on error, chunk on success. | |
<return type = "zchunk" by_reference = "1" /> | |
</method> | |
<method name = "set chunk"> | |
Set element as chunk, transferring ownership from caller. | |
Increasing element index. | |
Return -1 on error, 0 on success. | |
<argument name = "chunk" type = "zchunk" by_reference = "1" /> | |
<return type = "integer" /> | |
</method> | |
<method name = "hashx"> | |
Get element as hashx, without transferring ownership. | |
Increasing element index. | |
Return NULL on error, hashx on success. | |
<return type = "zhashx" by_reference = "1" /> | |
</method> | |
<method name = "set hashx"> | |
Set element as hashx, transferring ownership from caller. | |
Increasing element index. | |
Return -1 on error, 0 on success. | |
<argument name = "hashx" type = "zhashx" by_reference = "1" /> | |
<return type = "integer" /> | |
</method> | |
<method name = "zuuid"> | |
Get element as uuid, without transferring ownership. | |
Increasing element index. | |
Return NULL on error, uuid on success. | |
<return type = "zuuid" by_reference = "1" /> | |
</method> | |
<method name = "set zuuid"> | |
Set element as uuid, transferring ownership from caller. | |
Increasing element index. | |
Return -1 on error, 0 on success. | |
<argument name = "uuid" type = "zuuid" by_reference = "1" /> | |
<return type = "integer" /> | |
</method> | |
<method name = "pointer"> | |
Get element as pointer. | |
Increasing element index. | |
Return NULL on error, pointer on success. | |
<return type = "anything" /> | |
</method> | |
<method name = "set_pointer"> | |
Set element as pointer. | |
Increasing element index. | |
Return -1 on error, 0 on success. | |
<argument name = "value" type = "anything" /> | |
<return type = "integer" /> | |
</method> | |
</class> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment