yong-stropheruby 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.autotest +9 -0
- data/History.txt +4 -0
- data/Manifest.txt +39 -0
- data/PostInstall.txt +4 -0
- data/README.rdoc +143 -0
- data/Rakefile +21 -0
- data/ext/auth.c +990 -0
- data/ext/common.h +287 -0
- data/ext/conn.c +609 -0
- data/ext/ctx.c +416 -0
- data/ext/event.c +345 -0
- data/ext/extconf.rb +6 -0
- data/ext/handler.c +592 -0
- data/ext/hash.c +278 -0
- data/ext/hash.h +64 -0
- data/ext/jid.c +177 -0
- data/ext/md5.c +289 -0
- data/ext/md5.h +41 -0
- data/ext/ostypes.h +27 -0
- data/ext/parser.c +206 -0
- data/ext/sasl.c +614 -0
- data/ext/sasl.h +44 -0
- data/ext/sha1.c +389 -0
- data/ext/sha1.h +31 -0
- data/ext/snprintf.c +839 -0
- data/ext/sock.c +911 -0
- data/ext/sock.h +51 -0
- data/ext/stanza.c +908 -0
- data/ext/strophe.h +372 -0
- data/ext/strophe_ruby.c +687 -0
- data/ext/thread.c +119 -0
- data/ext/thread.h +43 -0
- data/ext/tls.h +46 -0
- data/ext/tls_dummy.c +89 -0
- data/ext/util.c +107 -0
- data/ext/util.h +32 -0
- data/lib/strophe_ruby.rb +6 -0
- data/test/test_helper.rb +3 -0
- data/test/test_strophe_ruby.rb +11 -0
- data/test/test_strophe_ruby_extn.rb +9 -0
- metadata +108 -0
data/ext/sock.h
ADDED
@@ -0,0 +1,51 @@
|
|
1
|
+
/* sock.h
|
2
|
+
** strophe XMPP client library -- socket abstraction header
|
3
|
+
**
|
4
|
+
** Copyright (C) 2005-2008 OGG, LLC. All rights reserved.
|
5
|
+
**
|
6
|
+
** This software is provided AS-IS with no warranty, either express
|
7
|
+
** or implied.
|
8
|
+
**
|
9
|
+
** This software is distributed under license and may not be copied,
|
10
|
+
** modified or distributed except as expressly authorized under the
|
11
|
+
** terms of the license contained in the file LICENSE.txt in this
|
12
|
+
** distribution.
|
13
|
+
*/
|
14
|
+
|
15
|
+
/** @file
|
16
|
+
* Socket abstraction API.
|
17
|
+
*/
|
18
|
+
|
19
|
+
#ifndef __LIBSTROPHE_SOCK_H__
|
20
|
+
#define __LIBSTROPHE_SOCK_H__
|
21
|
+
|
22
|
+
#include <stdio.h>
|
23
|
+
|
24
|
+
#ifndef _WIN32
|
25
|
+
typedef int sock_t;
|
26
|
+
#else
|
27
|
+
#include <winsock2.h>
|
28
|
+
typedef SOCKET sock_t;
|
29
|
+
#endif
|
30
|
+
|
31
|
+
void sock_initialize(void);
|
32
|
+
void sock_shutdown(void);
|
33
|
+
|
34
|
+
int sock_error(void);
|
35
|
+
|
36
|
+
sock_t sock_connect(const char * const host, const unsigned int port);
|
37
|
+
int sock_close(const sock_t sock);
|
38
|
+
|
39
|
+
int sock_set_blocking(const sock_t sock);
|
40
|
+
int sock_set_nonblocking(const sock_t sock);
|
41
|
+
int sock_read(const sock_t sock, void * const buff, const size_t len);
|
42
|
+
int sock_write(const sock_t sock, const void * const buff, const size_t len);
|
43
|
+
int sock_is_recoverable(const int error);
|
44
|
+
/* checks for an error after connect, return 0 if connect successful */
|
45
|
+
int sock_connect_error(const sock_t sock);
|
46
|
+
|
47
|
+
int sock_srv_lookup(const char *service, const char *proto,
|
48
|
+
const char *domain, char *resulttarget,
|
49
|
+
int resulttargetlength, int *resultport);
|
50
|
+
|
51
|
+
#endif /* __LIBSTROPHE_SOCK_H__ */
|