The data contained in this repository can be downloaded to your computer using one of several clients.
Please see the documentation of your version control software client for more information.

Please select the desired protocol below to get the URL.

This URL has Read-Only access.

Statistics
| Branch: | Revision:

main_repo / libpurple / plugins / perl / common / SSLConn.c @ a274da4f

History | View | Annotate | Download (8.43 KB)

1
/*
2
 * This file was generated automatically by ExtUtils::ParseXS version 3.18 from the
3
 * contents of SSLConn.xs. Do not edit this file, edit SSLConn.xs instead.
4
 *
5
 *    ANY CHANGES MADE HERE WILL BE LOST!
6
 *
7
 */
8

    
9
#line 1 "SSLConn.xs"
10
#include "module.h"
11

    
12
/* TODO
13

14

15
Purple::Ssl::Connection
16
purple_ssl_connect(account, host, port, func, error_func, data)
17
        Purple::Account account
18
        const char *host
19
        int port
20
        PurpleSslInputFunction func
21
        PurpleSslErrorFunction error_func
22

23
void
24
purple_ssl_input_add(gsc, func, data)
25
        Purple::Ssl::Connection gsc
26
        Purple::SslInputFunction func
27

28
Purple::Ssl::Connection
29
purple_ssl_connect_fd(account, fd, func, error_func, data)
30
        Purple::Account account
31
        int fd
32
        PurpleSslInputFunction func
33
        PurpleSslErrorFunction error_func
34

35
*/
36

    
37
#line 38 "SSLConn.c"
38
#ifndef PERL_UNUSED_VAR
39
#  define PERL_UNUSED_VAR(var) if (0) var = var
40
#endif
41

    
42
#ifndef dVAR
43
#  define dVAR                dNOOP
44
#endif
45

    
46

    
47
/* This stuff is not part of the API! You have been warned. */
48
#ifndef PERL_VERSION_DECIMAL
49
#  define PERL_VERSION_DECIMAL(r,v,s) (r*1000000 + v*1000 + s)
50
#endif
51
#ifndef PERL_DECIMAL_VERSION
52
#  define PERL_DECIMAL_VERSION \
53
          PERL_VERSION_DECIMAL(PERL_REVISION,PERL_VERSION,PERL_SUBVERSION)
54
#endif
55
#ifndef PERL_VERSION_GE
56
#  define PERL_VERSION_GE(r,v,s) \
57
          (PERL_DECIMAL_VERSION >= PERL_VERSION_DECIMAL(r,v,s))
58
#endif
59
#ifndef PERL_VERSION_LE
60
#  define PERL_VERSION_LE(r,v,s) \
61
          (PERL_DECIMAL_VERSION <= PERL_VERSION_DECIMAL(r,v,s))
62
#endif
63

    
64
/* XS_INTERNAL is the explicit static-linkage variant of the default
65
 * XS macro.
66
 *
67
 * XS_EXTERNAL is the same as XS_INTERNAL except it does not include
68
 * "STATIC", ie. it exports XSUB symbols. You probably don't want that
69
 * for anything but the BOOT XSUB.
70
 *
71
 * See XSUB.h in core!
72
 */
73

    
74

    
75
/* TODO: This might be compatible further back than 5.10.0. */
76
#if PERL_VERSION_GE(5, 10, 0) && PERL_VERSION_LE(5, 15, 1)
77
#  undef XS_EXTERNAL
78
#  undef XS_INTERNAL
79
#  if defined(__CYGWIN__) && defined(USE_DYNAMIC_LOADING)
80
#    define XS_EXTERNAL(name) __declspec(dllexport) XSPROTO(name)
81
#    define XS_INTERNAL(name) STATIC XSPROTO(name)
82
#  endif
83
#  if defined(__SYMBIAN32__)
84
#    define XS_EXTERNAL(name) EXPORT_C XSPROTO(name)
85
#    define XS_INTERNAL(name) EXPORT_C STATIC XSPROTO(name)
86
#  endif
87
#  ifndef XS_EXTERNAL
88
#    if defined(HASATTRIBUTE_UNUSED) && !defined(__cplusplus)
89
#      define XS_EXTERNAL(name) void name(pTHX_ CV* cv __attribute__unused__)
90
#      define XS_INTERNAL(name) STATIC void name(pTHX_ CV* cv __attribute__unused__)
91
#    else
92
#      ifdef __cplusplus
93
#        define XS_EXTERNAL(name) extern "C" XSPROTO(name)
94
#        define XS_INTERNAL(name) static XSPROTO(name)
95
#      else
96
#        define XS_EXTERNAL(name) XSPROTO(name)
97
#        define XS_INTERNAL(name) STATIC XSPROTO(name)
98
#      endif
99
#    endif
100
#  endif
101
#endif
102

    
103
/* perl >= 5.10.0 && perl <= 5.15.1 */
104

    
105

    
106
/* The XS_EXTERNAL macro is used for functions that must not be static
107
 * like the boot XSUB of a module. If perl didn't have an XS_EXTERNAL
108
 * macro defined, the best we can do is assume XS is the same.
109
 * Dito for XS_INTERNAL.
110
 */
111
#ifndef XS_EXTERNAL
112
#  define XS_EXTERNAL(name) XS(name)
113
#endif
114
#ifndef XS_INTERNAL
115
#  define XS_INTERNAL(name) XS(name)
116
#endif
117

    
118
/* Now, finally, after all this mess, we want an ExtUtils::ParseXS
119
 * internal macro that we're free to redefine for varying linkage due
120
 * to the EXPORT_XSUB_SYMBOLS XS keyword. This is internal, use
121
 * XS_EXTERNAL(name) or XS_INTERNAL(name) in your code if you need to!
122
 */
123

    
124
#undef XS_EUPXS
125
#if defined(PERL_EUPXS_ALWAYS_EXPORT)
126
#  define XS_EUPXS(name) XS_EXTERNAL(name)
127
#else
128
   /* default to internal */
129
#  define XS_EUPXS(name) XS_INTERNAL(name)
130
#endif
131

    
132
#ifndef PERL_ARGS_ASSERT_CROAK_XS_USAGE
133
#define PERL_ARGS_ASSERT_CROAK_XS_USAGE assert(cv); assert(params)
134

    
135
/* prototype to pass -Wmissing-prototypes */
136
STATIC void
137
S_croak_xs_usage(pTHX_ const CV *const cv, const char *const params);
138

    
139
STATIC void
140
S_croak_xs_usage(pTHX_ const CV *const cv, const char *const params)
141
{
142
    const GV *const gv = CvGV(cv);
143

    
144
    PERL_ARGS_ASSERT_CROAK_XS_USAGE;
145

    
146
    if (gv) {
147
        const char *const gvname = GvNAME(gv);
148
        const HV *const stash = GvSTASH(gv);
149
        const char *const hvname = stash ? HvNAME(stash) : NULL;
150

    
151
        if (hvname)
152
            Perl_croak(aTHX_ "Usage: %s::%s(%s)", hvname, gvname, params);
153
        else
154
            Perl_croak(aTHX_ "Usage: %s(%s)", gvname, params);
155
    } else {
156
        /* Pants. I don't think that it should be possible to get here. */
157
        Perl_croak(aTHX_ "Usage: CODE(0x%"UVxf")(%s)", PTR2UV(cv), params);
158
    }
159
}
160
#undef  PERL_ARGS_ASSERT_CROAK_XS_USAGE
161

    
162
#ifdef PERL_IMPLICIT_CONTEXT
163
#define croak_xs_usage(a,b)    S_croak_xs_usage(aTHX_ a,b)
164
#else
165
#define croak_xs_usage        S_croak_xs_usage
166
#endif
167

    
168
#endif
169

    
170
/* NOTE: the prototype of newXSproto() is different in versions of perls,
171
 * so we define a portable version of newXSproto()
172
 */
173
#ifdef newXS_flags
174
#define newXSproto_portable(name, c_impl, file, proto) newXS_flags(name, c_impl, file, proto, 0)
175
#else
176
#define newXSproto_portable(name, c_impl, file, proto) (PL_Sv=(SV*)newXS(name, c_impl, file), sv_setpv(PL_Sv, proto), (CV*)PL_Sv)
177
#endif /* !defined(newXS_flags) */
178

    
179
#line 180 "SSLConn.c"
180

    
181
XS_EUPXS(XS_Purple__SSL_close); /* prototype to pass -Wmissing-prototypes */
182
XS_EUPXS(XS_Purple__SSL_close)
183
{
184
    dVAR; dXSARGS;
185
    if (items != 1)
186
       croak_xs_usage(cv,  "gsc");
187
    {
188
        Purple__Ssl__Connection        gsc = purple_perl_ref_object(ST(0))
189
;
190

    
191
        purple_ssl_close(gsc);
192
    }
193
    XSRETURN_EMPTY;
194
}
195

    
196

    
197
XS_EUPXS(XS_Purple__SSL_get_ops); /* prototype to pass -Wmissing-prototypes */
198
XS_EUPXS(XS_Purple__SSL_get_ops)
199
{
200
    dVAR; dXSARGS;
201
    if (items != 0)
202
       croak_xs_usage(cv,  "");
203
    {
204
        Purple__Ssl__Ops        RETVAL;
205

    
206
        RETVAL = purple_ssl_get_ops();
207
        ST(0) = purple_perl_bless_object(RETVAL, "Purple::Ssl::Ops");
208
        sv_2mortal(ST(0));
209
    }
210
    XSRETURN(1);
211
}
212

    
213

    
214
XS_EUPXS(XS_Purple__SSL_is_supported); /* prototype to pass -Wmissing-prototypes */
215
XS_EUPXS(XS_Purple__SSL_is_supported)
216
{
217
    dVAR; dXSARGS;
218
    if (items != 0)
219
       croak_xs_usage(cv,  "");
220
    {
221
        gboolean        RETVAL;
222

    
223
        RETVAL = purple_ssl_is_supported();
224
        ST(0) = sv_newmortal();
225
        ST(0) = boolSV(RETVAL);
226
    }
227
    XSRETURN(1);
228
}
229

    
230

    
231
XS_EUPXS(XS_Purple__SSL_read); /* prototype to pass -Wmissing-prototypes */
232
XS_EUPXS(XS_Purple__SSL_read)
233
{
234
    dVAR; dXSARGS;
235
    if (items != 3)
236
       croak_xs_usage(cv,  "gsc, buffer, len");
237
    {
238
        Purple__Ssl__Connection        gsc = purple_perl_ref_object(ST(0))
239
;
240
        void *        buffer = INT2PTR(void *,SvIV(ST(1)))
241
;
242
        size_t        len = (size_t)SvUV(ST(2))
243
;
244
        size_t        RETVAL;
245
        dXSTARG;
246

    
247
        RETVAL = purple_ssl_read(gsc, buffer, len);
248
        XSprePUSH; PUSHu((UV)RETVAL);
249
    }
250
    XSRETURN(1);
251
}
252

    
253

    
254
XS_EUPXS(XS_Purple__SSL_set_ops); /* prototype to pass -Wmissing-prototypes */
255
XS_EUPXS(XS_Purple__SSL_set_ops)
256
{
257
    dVAR; dXSARGS;
258
    if (items != 1)
259
       croak_xs_usage(cv,  "ops");
260
    {
261
        Purple__Ssl__Ops        ops = purple_perl_ref_object(ST(0))
262
;
263

    
264
        purple_ssl_set_ops(ops);
265
    }
266
    XSRETURN_EMPTY;
267
}
268

    
269

    
270
XS_EUPXS(XS_Purple__SSL_write); /* prototype to pass -Wmissing-prototypes */
271
XS_EUPXS(XS_Purple__SSL_write)
272
{
273
    dVAR; dXSARGS;
274
    if (items != 3)
275
       croak_xs_usage(cv,  "gsc, buffer, len");
276
    {
277
        Purple__Ssl__Connection        gsc = purple_perl_ref_object(ST(0))
278
;
279
        void *        buffer = INT2PTR(void *,SvIV(ST(1)))
280
;
281
        size_t        len = (size_t)SvUV(ST(2))
282
;
283
        size_t        RETVAL;
284
        dXSTARG;
285

    
286
        RETVAL = purple_ssl_write(gsc, buffer, len);
287
        XSprePUSH; PUSHu((UV)RETVAL);
288
    }
289
    XSRETURN(1);
290
}
291

    
292
#ifdef __cplusplus
293
extern "C"
294
#endif
295
XS_EXTERNAL(boot_Purple__SSL); /* prototype to pass -Wmissing-prototypes */
296
XS_EXTERNAL(boot_Purple__SSL)
297
{
298
    dVAR; dXSARGS;
299
#if (PERL_REVISION == 5 && PERL_VERSION < 9)
300
    char* file = __FILE__;
301
#else
302
    const char* file = __FILE__;
303
#endif
304

    
305
    PERL_UNUSED_VAR(cv); /* -W */
306
    PERL_UNUSED_VAR(items); /* -W */
307
#ifdef XS_APIVERSION_BOOTCHECK
308
    XS_APIVERSION_BOOTCHECK;
309
#endif
310
    XS_VERSION_BOOTCHECK;
311

    
312
        (void)newXSproto_portable("Purple::SSL::close", XS_Purple__SSL_close, file, "$");
313
        (void)newXSproto_portable("Purple::SSL::get_ops", XS_Purple__SSL_get_ops, file, "");
314
        (void)newXSproto_portable("Purple::SSL::is_supported", XS_Purple__SSL_is_supported, file, "");
315
        (void)newXSproto_portable("Purple::SSL::read", XS_Purple__SSL_read, file, "$$$");
316
        (void)newXSproto_portable("Purple::SSL::set_ops", XS_Purple__SSL_set_ops, file, "$");
317
        (void)newXSproto_portable("Purple::SSL::write", XS_Purple__SSL_write, file, "$$$");
318
#if (PERL_REVISION == 5 && PERL_VERSION >= 9)
319
  if (PL_unitcheckav)
320
       call_list(PL_scopestack_ix, PL_unitcheckav);
321
#endif
322
    XSRETURN_YES;
323
}
324