amarquee.pas 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493
  1. {
  2. This file is part of the Free Pascal run time library.
  3. A file in Amiga system run time library.
  4. Copyright (c) 1998-2000 by Nils Sjoholm
  5. member of the Amiga RTL development team.
  6. See the file COPYING.FPC, included in this distribution,
  7. for details about the copyright.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  11. **********************************************************************}
  12. {
  13. History:
  14. First translation of AMarquee.h to FPC pascal.
  15. No testing has been done so there could be bugs
  16. in here. If you find any bugs please let me know.
  17. 25 Aug 2000.
  18. Added functions and procedures with array of PtrUInt.
  19. For use with fpc 1.0.7
  20. 30 Nov 2002.
  21. Added the defines use_amiga_smartlink and
  22. use_auto_openlib.
  23. 12 Jan 2003.
  24. Changed startcode for unit.
  25. 10 Feb 2003.
  26. [email protected]
  27. }
  28. {$I useamigasmartlink.inc}
  29. {$ifdef use_amiga_smartlink}
  30. {$smartlink on}
  31. {$endif use_amiga_smartlink}
  32. unit amarquee;
  33. interface
  34. uses exec, utility;
  35. { This library contains definitions and structures necessary to use amarquee.library. }
  36. { Different error types that can be returned to the client in QMessages }
  37. { Everything is okay }
  38. const
  39. AMARQUEENAME : PChar = 'amarquee.library';
  40. QERROR_NO_ERROR = 0;
  41. { Don't know what the error was. }
  42. QERROR_UNKNOWN = -(1);
  43. { Keystring could not be parsed or "dir" does not exist }
  44. QERROR_MALFORMED_KEY = -(2);
  45. { Server did not have enough mem available to complete request }
  46. QERROR_NO_SERVER_MEM = -(3);
  47. { The connection to the server went south }
  48. QERROR_NO_CONNECTION = -(4);
  49. { You're not allowed to do that! }
  50. QERROR_UNPRIVILEGED = -(5);
  51. { Feature you requested does not exist yet }
  52. QERROR_UNIMPLEMENTED = -(6);
  53. { Your computer didn't have enough memory available to complete an action }
  54. QERROR_NO_CLIENT_MEM = -(7);
  55. { This message is a "wall" text message from a server admin }
  56. QERROR_SYS_MESSAGE = -(8);
  57. { This message is a "send done" notification from your client TCP thread (new for v47) }
  58. QERROR_SEND_DONE = -(9);
  59. { These error types may be returned by QFreeSession() or set to the error code
  60. variable (set with the QSESSION_ERRORCODEPTR tag), after a QSession
  61. allocation attempt fails. }
  62. { TCP stack wasn't running }
  63. QERROR_NO_TCP_STACK = -(20);
  64. { Hostname lookup of server failed }
  65. QERROR_HOSTNAME_LOOKUP = -(21);
  66. { TCP thread got a control-C }
  67. QERROR_ABORTED = -(22);
  68. { No AMarquee server at requested host/port }
  69. QERROR_NO_SERVER = -(23);
  70. { The program wasn't launched by inetd }
  71. QERROR_NO_INETD = -(24);
  72. { The server wouldn't accept our connection }
  73. QERROR_ACCESS_DENIED = -(25);
  74. { The client is out of memory }
  75. QERROR_NO_MEMORY = -(26);
  76. { No server at requested host/port }
  77. QERROR_NO_TCPSERVER = -(27);
  78. { Flags to use with QGo() }
  79. { Request notification via sync packet when all has settled on the server side }
  80. QGOF_SYNC = 1 shl 0;
  81. { Request notification via QERROR_SEND_DONE message when the TCP thread has finished sending this transaction (new for v47) }
  82. QGOF_NOTIFY = 1 shl 1;
  83. { Flags representing special privileges; used with QRequestPrivileges(), etc }
  84. { license to kill! }
  85. QPRIV_KILLCLIENTS = 1 shl 0;
  86. { Ability to set env vars, etc, on the server }
  87. QPRIV_ADMIN = 1 shl 1;
  88. { Ability to receive special sysadmin messages }
  89. QPRIV_GETSYSMESSAGES = 1 shl 2;
  90. { Ability to send special sysadmin messages }
  91. QPRIV_SENDSYSMESSAGES = 1 shl 3;
  92. { all possible QPRIV_ bits }
  93. QPRIV_ALL = $0F;
  94. { Wait() on this for QMessages! }
  95. { }
  96. { Invisible, private info is here... don't trust sizeof(QSession)! }
  97. { }
  98. type
  99. PQSession = ^TQSession;
  100. TQSession = record
  101. qMsgPort : PMsgPort;
  102. end;
  103. { All events from AMarquee come in this package! }
  104. { Don't directly use the contents of qm_Msg! }
  105. { Message ID # of transaction related to this opCode, or -1 if no ID is applicable. }
  106. { One of the QERROR_ codes defined in AMarquee headers. }
  107. { Pathname of a node, or NULL if not applicable. }
  108. { Pointer to beginning of data buffer, or NULL if not applicable. }
  109. { Length of qm_Data buffer, or 0 if not applicable. }
  110. { Length of the data buffer stored on the AMarquee server. }
  111. { Line # of the server source code that generated the error. Useful for debugging. }
  112. { Private info used by FreeQMessage() }
  113. { Added for v48; more private info used by FreeQMessage() }
  114. { Added for v50. The session this message comes from. Necessary with shared msgports }
  115. PQMessage = ^TQMessage;
  116. TQMessage = record
  117. qm_Msg : tMessage;
  118. qm_ID : LONG;
  119. qm_Status : longint;
  120. qm_Path : Pchar;
  121. qm_Data : pointer;
  122. qm_DataLen : ULONG;
  123. qm_ActualLen : ULONG;
  124. qm_ErrorLine : ULONG;
  125. qm_Private : pointer;
  126. qm_Private2 : pointer;
  127. qm_Session : PQSession;
  128. end;
  129. { The theoretical maximum number of bytes your server may allocate. }
  130. { The number of bytes currently allocated by your server. }
  131. { The number of bytes that may actually be allocated by your server. }
  132. { Bit-chord of QPRIV_ bits, showing what special privs you have. }
  133. { Bit-chord of QPRIV_ bits, showing what special privs you could get if you asked. }
  134. PQRunInfo = ^TQRunInfo;
  135. TQRunInfo = record
  136. qr_Allowed : LONG;
  137. qr_Alloced : LONG;
  138. qr_Avail : LONG;
  139. qr_CurrentPrivs : ULONG;
  140. qr_PossiblePrivs : ULONG;
  141. end;
  142. { Used internally }
  143. { the message port to listen on }
  144. PQSharedMessagePort = ^TQSharedMessagePort;
  145. TQSharedMessagePort = record
  146. qs_private : tSignalSemaphore;
  147. qs_mp : PMsgPort;
  148. end;
  149. { the QRAWSESSION_PROTOCOLSTOPHOOK Hook function receive a pointer to the Hook in A0, the QSession
  150. pointer in A2 and a pointer to a QProtocolStopMarkerMessage in A1. Return the length of the buffer
  151. to send to the client. Return a length of 0 if not enough data is present. With this function
  152. it's easy to make sure that no structs or other datatypes get stripped. }
  153. PQProtocolStopMarkerMessage = ^TQProtocolStopMarkerMessage;
  154. TQProtocolStopMarkerMessage = record
  155. buffer : STRPTR;
  156. length : ULONG;
  157. userdata : ULONG;
  158. id : LONG;
  159. end;
  160. { Tags to use with QNewSocketSession(Async) }
  161. { (ULONG maxBufSize) The maximum buffer size to use (same as QSetMaxRawBufSize()) }
  162. const
  163. QRAWSESSION_MAXBUFFERSIZE = $a0000001;
  164. { (struct Hook stopmarkerfunc) A hook with the function which sets the stop marker for a block of data }
  165. QRAWSESSION_PROTOCOLSTOPHOOK = $a0000002;
  166. { (BOOL b) default TRUE. Shall the last data before the connection is broken be sent to the client even though the PROTOCOLSTOPHOOK hook specify it shouldn't ? }
  167. QRAWSESSION_RECEIVE_EXCEEDING_DATA = $a0000003;
  168. { (ULONG u) The initial value of the userdata field in struct QProtocolStopMarkerMessage }
  169. QRAWSESSION_PROTOCOLSTOPHOOK_USERDATA = $a0000004;
  170. { Tags to use with QNew Session(Async) and QNewSocket Session(Async) }
  171. { (LONG errorCode) A pointer to the variable that will hold the error code }
  172. QSESSION_ERRORCODEPTR = $b0000001;
  173. { (struct QSharedMessagePort mp) A shared message port created with QCreateSharedMessagePort() }
  174. QSESSION_SHAREDMSGPORT = $b0000002;
  175. VAR AMarqueeBase : pLibrary = nil;
  176. FUNCTION QFreeSession(session : pQSession location 'a0') : LONGINT; syscall AMarqueeBase 36;
  177. FUNCTION QDebugOp(session : pQSession location 'a0'; string_ : pCHar location 'a1') : LONGINT; syscall AMarqueeBase 42;
  178. FUNCTION QGetOp(session : pQSession location 'a0'; path : pCHar location 'a1'; maxBytes : LONGINT location 'd0') : LONGINT; syscall AMarqueeBase 48;
  179. FUNCTION QDeleteOp(session : pQSession location 'a0'; path : pCHar location 'a1') : LONGINT; syscall AMarqueeBase 54;
  180. FUNCTION QRenameOp(session : pQSession location 'a0'; path : pCHar location 'a1'; label_ : pCHar location 'd0') : LONGINT; syscall AMarqueeBase 60;
  181. FUNCTION QSubscribeOp(session : pQSession location 'a0'; path : pCHar location 'a1'; maxBytes : LONGINT location 'd0') : LONGINT; syscall AMarqueeBase 66;
  182. FUNCTION QSetOp(session : pQSession location 'a0'; path : pCHar location 'a1'; buf : POINTER location 'd0'; len : ULONG location 'd1') : LONGINT; syscall AMarqueeBase 72;
  183. FUNCTION QClearSubscriptionsOp(session : pQSession location 'a0'; which : LONGINT location 'd0') : LONGINT; syscall AMarqueeBase 78;
  184. FUNCTION QPingOp(session : pQSession location 'a0') : LONGINT; syscall AMarqueeBase 84;
  185. FUNCTION QInfoOp(session : pQSession location 'a0') : LONGINT; syscall AMarqueeBase 90;
  186. FUNCTION QSetAccessOp(session : pQSession location 'a0'; hosts : pCHar location 'a1') : LONGINT; syscall AMarqueeBase 96;
  187. PROCEDURE FreeQMessage(session : pQSession location 'a0'; qmsg : pQMessage location 'a1'); syscall AMarqueeBase 102;
  188. FUNCTION QGo(session : pQSession location 'a0'; sync : ULONG location 'd0') : LONGINT; syscall AMarqueeBase 108;
  189. FUNCTION QStreamOp(session : pQSession location 'a0'; path : pCHar location 'a1'; buf : POINTER location 'd0'; len : ULONG location 'd1') : LONGINT; syscall AMarqueeBase 120;
  190. FUNCTION QSetMessageAccessOp(session : pQSession location 'a0'; access : pCHar location 'a1'; maxbytes : LONGINT location 'd0') : LONGINT; syscall AMarqueeBase 132;
  191. FUNCTION QMessageOp(session : pQSession location 'a0'; hosts : pCHar location 'a1'; buffer : POINTER location 'd0'; len : ULONG location 'd1') : LONGINT; syscall AMarqueeBase 138;
  192. FUNCTION QNumQueuedPackets(session : pQSession location 'a0') : ULONG; syscall AMarqueeBase 150;
  193. FUNCTION QNumQueuedBytes(session : pQSession location 'a0') : ULONG; syscall AMarqueeBase 156;
  194. FUNCTION QErrorName(session : LONGINT location 'd0') : pCHar; syscall AMarqueeBase 162;
  195. FUNCTION QRequestPrivilegesOp(session : pQSession location 'a0'; privBits : ULONG location 'd0') : LONGINT; syscall AMarqueeBase 168;
  196. FUNCTION QReleasePrivilegesOp(session : pQSession location 'a0'; privBits : ULONG location 'd0') : LONGINT; syscall AMarqueeBase 174;
  197. FUNCTION QKillClientsOp(session : pQSession location 'a0'; hosts : pCHar location 'a1') : LONGINT; syscall AMarqueeBase 180;
  198. FUNCTION QSetParameterOp(session : pQSession location 'a0'; paramName : pCHar location 'a1'; newValue : pCHar location 'd0') : LONGINT; syscall AMarqueeBase 186;
  199. FUNCTION QGetParameterOp(session : pQSession location 'a0'; paramName : pCHar location 'a1') : LONGINT; syscall AMarqueeBase 192;
  200. FUNCTION QSysMessageOp(session : pQSession location 'a0'; hosts : pCHar location 'a1'; message : pCHar location 'd0') : LONGINT; syscall AMarqueeBase 198;
  201. FUNCTION QGetAndSubscribeOp(session : pQSession location 'a0'; path : pCHar location 'a1'; maxBytes : LONGINT location 'd0') : LONGINT; syscall AMarqueeBase 210;
  202. FUNCTION QDetachSession(session : pQSession location 'a0'; flags : ULONG location 'd0') : BOOLEAN; syscall AMarqueeBase 216;
  203. FUNCTION QReattachSession(session : pQSession location 'a0'; flags : ULONG location 'd0') : BOOLEAN; syscall AMarqueeBase 222;
  204. FUNCTION QNewSocketSession(host : pCHar location 'a0'; port : LONGINT location 'd0'; tags : pTagItem location 'a1') : pQSession; syscall AMarqueeBase 228;
  205. FUNCTION QSendRawOp(session : pQSession location 'a0'; buf : POINTER location 'a1'; len : ULONG location 'd0') : LONGINT; syscall AMarqueeBase 234;
  206. FUNCTION QNewSocketSessionAsync(host : pCHar location 'a0'; port : LONGINT location 'd0'; tags : pTagItem location 'a1') : pQSession; syscall AMarqueeBase 240;
  207. FUNCTION QNewSocketServerSession( port : pLONGINT location 'a0'; tags : pTagItem location 'a1') : pQSession; syscall AMarqueeBase 246;
  208. FUNCTION QSetKeyAccessOp(session : pQSession location 'a0'; path : pCHar location 'a1'; hosts : pCHar location 'd0') : LONGINT; syscall AMarqueeBase 252;
  209. FUNCTION QGetHostName(session : pQSession location 'a0') : pCHar; syscall AMarqueeBase 258;
  210. FUNCTION QGetProgName(session : pQSession location 'a0') : pCHar; syscall AMarqueeBase 264;
  211. PROCEDURE QSetMaxRawBufSize(session : pQSession location 'a0'; maxBufSize : ULONG location 'd0'); syscall AMarqueeBase 270;
  212. FUNCTION QNewSession(host : pCHar location 'a0'; port : LONGINT location 'd0'; name : pCHar location 'a1'; taglist : pTagItem location 'd1') : pQSession; syscall AMarqueeBase 276;
  213. FUNCTION QNewSessionAsync(host : pCHar location 'a0'; port : LONGINT location 'd0'; name : pCHar location 'a1'; taglist : pTagItem location 'd1') : pQSession; syscall AMarqueeBase 282;
  214. FUNCTION QNewHostSession(hostnames : pCHar location 'a0'; port : pLONGINT location 'a1'; names : pCHar location 'd0'; taglist : pTagItem location 'd1') : pQSession; syscall AMarqueeBase 288;
  215. FUNCTION QNewServerSession(hostNames : pCHar location 'a0'; progNames : pCHar location 'a1'; taglist : pTagItem location 'd0') : pQSession; syscall AMarqueeBase 294;
  216. FUNCTION QCreateSharedMessagePort : pQSharedMessagePort; syscall AMarqueeBase 300;
  217. PROCEDURE QDeleteSharedMessagePort(mp : pQSharedMessagePort location 'a0'); syscall AMarqueeBase 306;
  218. FUNCTION QGetLocalIP(session : pQSession location 'a0') : pCHAR; syscall AMarqueeBase 312;
  219. {
  220. This is functions and procedures with array of PtrUInt.
  221. For use with fpc 1.0 and above.
  222. }
  223. FUNCTION QNewSocketSessiontags(host : pCHar; port : LONGINT; const argv : array of PtrUInt) : pQSession;
  224. FUNCTION QNewSocketSessionAsyncTags(host : pCHar; port : LONGINT; const argv : array of PtrUInt) : pQSession;
  225. FUNCTION QNewSocketServerSessionTags( port : pLONGINT; const argv : array of PtrUInt) : pQSession;
  226. FUNCTION QNewSessionTags(host : pCHar; port : LONGINT; name : pCHar; const argv : array of PtrUInt) : pQSession;
  227. FUNCTION QNewSessionAsyncTags(host : pCHar; port : LONGINT; name : pCHar; const argv : array of PtrUInt) : pQSession;
  228. FUNCTION QNewHostSessionTags(hostnames : pCHar; port : pLONGINT; names : pCHar; const argv : array of PtrUInt) : pQSession;
  229. FUNCTION QNewServerSessionTags(hostNames : pCHar; progNames : pCHar; const argv : array of PtrUInt) : pQSession;
  230. FUNCTION QDebugOp(session : pQSession; string_ : string) : LONGINT;
  231. FUNCTION QGetOp(session : pQSession; path : string; maxBytes : LONGINT) : LONGINT;
  232. FUNCTION QDeleteOp(session : pQSession; path : string) : LONGINT;
  233. FUNCTION QRenameOp(session : pQSession; path : string; label_ : string) : LONGINT;
  234. FUNCTION QSubscribeOp(session : pQSession; path : string; maxBytes : LONGINT) : LONGINT;
  235. FUNCTION QSetOp(session : pQSession; path : string; buf : POINTER; len : ULONG) : LONGINT;
  236. FUNCTION QSetAccessOp(session : pQSession; hosts : string) : LONGINT;
  237. FUNCTION QStreamOp(session : pQSession; path : string; buf : POINTER; len : ULONG) : LONGINT;
  238. FUNCTION QSetMessageAccessOp(session : pQSession; access : string; maxbytes : LONGINT) : LONGINT;
  239. FUNCTION QMessageOp(session : pQSession; hosts : string; buffer : POINTER; len : ULONG) : LONGINT;
  240. FUNCTION QKillClientsOp(session : pQSession; hosts : string) : LONGINT;
  241. FUNCTION QSetParameterOp(session : pQSession; paramName : string; newValue : string) : LONGINT;
  242. FUNCTION QGetParameterOp(session : pQSession; paramName : string) : LONGINT;
  243. FUNCTION QSysMessageOp(session : pQSession; hosts : string; message : string) : LONGINT;
  244. FUNCTION QGetAndSubscribeOp(session : pQSession; path : string; maxBytes : LONGINT) : LONGINT;
  245. FUNCTION QNewSocketSession(host : string; port : LONGINT; tags : pTagItem) : pQSession;
  246. FUNCTION QNewSocketSessionAsync(host : string; port : LONGINT; tags : pTagItem) : pQSession;
  247. FUNCTION QSetKeyAccessOp(session : pQSession; path : string; hosts : string) : LONGINT;
  248. FUNCTION QNewSession(host : string; port : LONGINT; name : string; taglist : pTagItem) : pQSession;
  249. FUNCTION QNewSessionAsync(host : string; port : LONGINT; name : string; taglist : pTagItem) : pQSession;
  250. FUNCTION QNewHostSession(hostnames : string; port : pLONGINT; names : string; taglist : pTagItem) : pQSession;
  251. FUNCTION QNewServerSession(hostNames : string; progNames : string; taglist : pTagItem) : pQSession;
  252. {
  253. This is functions and procedures with array of PtrUInt.
  254. For use with fpc 1.0 and above.
  255. }
  256. FUNCTION QNewSocketSessionTags(host : string; port : LONGINT; const argv : array of PtrUInt) : pQSession;
  257. FUNCTION QNewSocketSessionAsyncTags(host : string; port : LONGINT; const argv : array of PtrUInt) : pQSession;
  258. FUNCTION QNewSessionTags(host : string; port : LONGINT; name : string; const argv : array of PtrUInt) : pQSession;
  259. FUNCTION QNewSessionAsyncTags(host : string; port : LONGINT; name : string; const argv : array of PtrUInt) : pQSession;
  260. FUNCTION QNewHostSessionTags(hostnames : string; port : pLONGINT; names : string; const argv : array of PtrUInt) : pQSession;
  261. FUNCTION QNewServerSessionTags(hostNames : string; progNames : string; const argv : array of PtrUInt) : pQSession;
  262. IMPLEMENTATION
  263. uses
  264. pastoc;
  265. FUNCTION QDebugOp(session : pQSession; string_ : string) : LONGINT;
  266. begin
  267. QDebugOp := QDebugOp(session,pas2c(string_));
  268. end;
  269. FUNCTION QGetOp(session : pQSession; path : string; maxBytes : LONGINT) : LONGINT;
  270. begin
  271. QGetOp := QGetOp(session,pas2c(path),maxBytes);
  272. end;
  273. FUNCTION QDeleteOp(session : pQSession; path : string) : LONGINT;
  274. begin
  275. QDeleteOp := QDeleteOp(session,pas2c(path));
  276. end;
  277. FUNCTION QRenameOp(session : pQSession; path : string; label_ : string) : LONGINT;
  278. begin
  279. QRenameOp := QRenameOp(session,pas2c(path),pas2c(label_));
  280. end;
  281. FUNCTION QSubscribeOp(session : pQSession; path : string; maxBytes : LONGINT) : LONGINT;
  282. begin
  283. QSubscribeOp := QSubscribeOp(session,pas2c(path),maxBytes);
  284. end;
  285. FUNCTION QSetOp(session : pQSession; path : string; buf : POINTER; len : ULONG) : LONGINT;
  286. begin
  287. QSetOp := QSetOp(session,pas2c(path),buf,len);
  288. end;
  289. FUNCTION QSetAccessOp(session : pQSession; hosts : string) : LONGINT;
  290. begin
  291. QSetAccessOp := QSetAccessOp(session,pas2c(hosts));
  292. end;
  293. FUNCTION QStreamOp(session : pQSession; path : string; buf : POINTER; len : ULONG) : LONGINT;
  294. begin
  295. QStreamOp := QStreamOp(session,pas2c(path),buf,len);
  296. end;
  297. FUNCTION QSetMessageAccessOp(session : pQSession; access : string; maxbytes : LONGINT) : LONGINT;
  298. begin
  299. QSetMessageAccessOp := QSetMessageAccessOp(session,pas2c(access),maxBytes);
  300. end;
  301. FUNCTION QMessageOp(session : pQSession; hosts : string; buffer : POINTER; len : ULONG) : LONGINT;
  302. begin
  303. QMessageOp := QMessageOp(session,pas2c(hosts),buffer,len);
  304. end;
  305. FUNCTION QKillClientsOp(session : pQSession; hosts : string) : LONGINT;
  306. begin
  307. QKillClientsOp := QKillClientsOp(session,pas2c(hosts));
  308. end;
  309. FUNCTION QSetParameterOp(session : pQSession; paramName : string; newValue : string) : LONGINT;
  310. begin
  311. QSetParameterOp := QSetParameterOp(session,pas2c(paramName),pas2c(newValue));
  312. end;
  313. FUNCTION QGetParameterOp(session : pQSession; paramName : string) : LONGINT;
  314. begin
  315. QGetParameterOp := QGetParameterOp(session,pas2c(paramName));
  316. end;
  317. FUNCTION QSysMessageOp(session : pQSession; hosts : string; message : string) : LONGINT;
  318. begin
  319. QSysMessageOp := QSysMessageOp(session,pas2c(hosts),pas2c(message));
  320. end;
  321. FUNCTION QGetAndSubscribeOp(session : pQSession; path : string; maxBytes : LONGINT) : LONGINT;
  322. begin
  323. QGetAndSubscribeOp := QGetAndSubscribeOp(session,pas2c(path),maxBytes);
  324. end;
  325. FUNCTION QNewSocketSession(host : string; port : LONGINT; tags : pTagItem) : pQSession;
  326. begin
  327. QNewSocketSession := QNewSocketSession(pas2c(host),port,tags);
  328. end;
  329. FUNCTION QNewSocketSessionAsync(host : string; port : LONGINT; tags : pTagItem) : pQSession;
  330. begin
  331. QNewSocketSessionAsync := QNewSocketSessionAsync(pas2c(host),port,tags);
  332. end;
  333. FUNCTION QSetKeyAccessOp(session : pQSession; path : string; hosts : string) : LONGINT;
  334. begin
  335. QSetKeyAccessOp := QSetKeyAccessOp(session,pas2c(path),pas2c(hosts));
  336. end;
  337. FUNCTION QNewSession(host : string; port : LONGINT; name : string; taglist : pTagItem) : pQSession;
  338. begin
  339. QNewSession := QNewSession(pas2c(host),port,pas2c(name),taglist);
  340. end;
  341. FUNCTION QNewSessionAsync(host : string; port : LONGINT; name : string; taglist : pTagItem) : pQSession;
  342. begin
  343. QNewSessionAsync := QNewSessionAsync(pas2c(host),port,pas2c(name),taglist);
  344. end;
  345. FUNCTION QNewHostSession(hostnames : string; port : pLONGINT; names : string; taglist : pTagItem) : pQSession;
  346. begin
  347. QNewHostSession := QNewHostSession(pas2c(hostnames),port,pas2c(names),taglist);
  348. end;
  349. FUNCTION QNewServerSession(hostNames : string; progNames : string; taglist : pTagItem) : pQSession;
  350. begin
  351. QNewServerSession := QNewServerSession(pas2c(hostnames),pas2c(prognames),taglist);
  352. end;
  353. FUNCTION QNewSocketSessiontags(host : pCHar; port : LONGINT; const argv : array of PtrUInt) : pQSession;
  354. begin
  355. QNewSocketSessiontags := QNewSocketSession(host,port,@argv);
  356. end;
  357. FUNCTION QNewSocketSessionAsyncTags(host : pCHar; port : LONGINT; const argv : array of PtrUInt) : pQSession;
  358. begin
  359. QNewSocketSessionAsyncTags := QNewSocketSessionAsync(host,port,@argv);
  360. end;
  361. FUNCTION QNewSocketServerSessionTags( port : pLONGINT; const argv : array of PtrUInt) : pQSession;
  362. begin
  363. QNewSocketServerSessionTags := QNewSocketServerSession(port,@argv);
  364. end;
  365. FUNCTION QNewSessionTags(host : pCHar; port : LONGINT; name : pCHar; const argv : array of PtrUInt) : pQSession;
  366. begin
  367. QNewSessionTags := QNewSession(host,port,name,@argv);
  368. end;
  369. FUNCTION QNewSessionAsyncTags(host : pCHar; port : LONGINT; name : pCHar; const argv : array of PtrUInt) : pQSession;
  370. begin
  371. QNewSessionAsyncTags := QNewSessionAsync(host,port,name,@argv);
  372. end;
  373. FUNCTION QNewHostSessionTags(hostnames : pCHar; port : pLONGINT; names : pCHar; const argv : array of PtrUInt) : pQSession;
  374. begin
  375. QNewHostSessionTags := QNewHostSession(hostnames,port,names,@argv);
  376. end;
  377. FUNCTION QNewServerSessionTags(hostNames : pCHar; progNames : pCHar; const argv : array of PtrUInt) : pQSession;
  378. begin
  379. QNewServerSessionTags := QNewServerSession(hostnames,prognames,@argv);
  380. end;
  381. FUNCTION QNewSocketSessionTags(host : string; port : LONGINT; const argv : array of PtrUInt) : pQSession;
  382. begin
  383. QNewSocketSessionTags := QNewSocketSession(host,port,@argv);
  384. end;
  385. FUNCTION QNewSocketSessionAsyncTags(host : string; port : LONGINT; const argv : array of PtrUInt) : pQSession;
  386. begin
  387. QNewSocketSessionAsyncTags := QNewSocketSessionAsync(host,port,@argv);
  388. end;
  389. FUNCTION QNewSessionTags(host : string; port : LONGINT; name : string; const argv : array of PtrUInt) : pQSession;
  390. begin
  391. QNewSessionTags := QNewSession(host,port,name,@argv);
  392. end;
  393. FUNCTION QNewSessionAsyncTags(host : string; port : LONGINT; name : string; const argv : array of PtrUInt) : pQSession;
  394. begin
  395. QNewSessionAsyncTags := QNewSessionAsync(host,port,name,@argv);
  396. end;
  397. FUNCTION QNewHostSessionTags(hostnames : string; port : pLONGINT; names : string; const argv : array of PtrUInt) : pQSession;
  398. begin
  399. QNewHostSessionTags := QNewHostSession(hostnames,port,names,@argv);
  400. end;
  401. FUNCTION QNewServerSessionTags(hostNames : string; progNames : string; const argv : array of PtrUInt) : pQSession;
  402. begin
  403. QNewServerSessionTags := QNewServerSession(hostnames,prognames,@argv);
  404. end;
  405. const
  406. { Change VERSION and LIBVERSION to proper values }
  407. VERSION : string[2] = '0';
  408. LIBVERSION : longword = 0;
  409. initialization
  410. AMarqueeBase := OpenLibrary(AMARQUEENAME,LIBVERSION);
  411. finalization
  412. if Assigned(AMarqueeBase) then
  413. CloseLibrary(AMarqueeBase);
  414. END. (* UNIT AMARQUEE *)