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 / ImgStore.c @ a274da4f

History | View | Annotate | Download (10.8 KB)

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

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

    
12
#line 13 "ImgStore.c"
13
#ifndef PERL_UNUSED_VAR
14
#  define PERL_UNUSED_VAR(var) if (0) var = var
15
#endif
16

    
17
#ifndef dVAR
18
#  define dVAR                dNOOP
19
#endif
20

    
21

    
22
/* This stuff is not part of the API! You have been warned. */
23
#ifndef PERL_VERSION_DECIMAL
24
#  define PERL_VERSION_DECIMAL(r,v,s) (r*1000000 + v*1000 + s)
25
#endif
26
#ifndef PERL_DECIMAL_VERSION
27
#  define PERL_DECIMAL_VERSION \
28
          PERL_VERSION_DECIMAL(PERL_REVISION,PERL_VERSION,PERL_SUBVERSION)
29
#endif
30
#ifndef PERL_VERSION_GE
31
#  define PERL_VERSION_GE(r,v,s) \
32
          (PERL_DECIMAL_VERSION >= PERL_VERSION_DECIMAL(r,v,s))
33
#endif
34
#ifndef PERL_VERSION_LE
35
#  define PERL_VERSION_LE(r,v,s) \
36
          (PERL_DECIMAL_VERSION <= PERL_VERSION_DECIMAL(r,v,s))
37
#endif
38

    
39
/* XS_INTERNAL is the explicit static-linkage variant of the default
40
 * XS macro.
41
 *
42
 * XS_EXTERNAL is the same as XS_INTERNAL except it does not include
43
 * "STATIC", ie. it exports XSUB symbols. You probably don't want that
44
 * for anything but the BOOT XSUB.
45
 *
46
 * See XSUB.h in core!
47
 */
48

    
49

    
50
/* TODO: This might be compatible further back than 5.10.0. */
51
#if PERL_VERSION_GE(5, 10, 0) && PERL_VERSION_LE(5, 15, 1)
52
#  undef XS_EXTERNAL
53
#  undef XS_INTERNAL
54
#  if defined(__CYGWIN__) && defined(USE_DYNAMIC_LOADING)
55
#    define XS_EXTERNAL(name) __declspec(dllexport) XSPROTO(name)
56
#    define XS_INTERNAL(name) STATIC XSPROTO(name)
57
#  endif
58
#  if defined(__SYMBIAN32__)
59
#    define XS_EXTERNAL(name) EXPORT_C XSPROTO(name)
60
#    define XS_INTERNAL(name) EXPORT_C STATIC XSPROTO(name)
61
#  endif
62
#  ifndef XS_EXTERNAL
63
#    if defined(HASATTRIBUTE_UNUSED) && !defined(__cplusplus)
64
#      define XS_EXTERNAL(name) void name(pTHX_ CV* cv __attribute__unused__)
65
#      define XS_INTERNAL(name) STATIC void name(pTHX_ CV* cv __attribute__unused__)
66
#    else
67
#      ifdef __cplusplus
68
#        define XS_EXTERNAL(name) extern "C" XSPROTO(name)
69
#        define XS_INTERNAL(name) static XSPROTO(name)
70
#      else
71
#        define XS_EXTERNAL(name) XSPROTO(name)
72
#        define XS_INTERNAL(name) STATIC XSPROTO(name)
73
#      endif
74
#    endif
75
#  endif
76
#endif
77

    
78
/* perl >= 5.10.0 && perl <= 5.15.1 */
79

    
80

    
81
/* The XS_EXTERNAL macro is used for functions that must not be static
82
 * like the boot XSUB of a module. If perl didn't have an XS_EXTERNAL
83
 * macro defined, the best we can do is assume XS is the same.
84
 * Dito for XS_INTERNAL.
85
 */
86
#ifndef XS_EXTERNAL
87
#  define XS_EXTERNAL(name) XS(name)
88
#endif
89
#ifndef XS_INTERNAL
90
#  define XS_INTERNAL(name) XS(name)
91
#endif
92

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

    
99
#undef XS_EUPXS
100
#if defined(PERL_EUPXS_ALWAYS_EXPORT)
101
#  define XS_EUPXS(name) XS_EXTERNAL(name)
102
#else
103
   /* default to internal */
104
#  define XS_EUPXS(name) XS_INTERNAL(name)
105
#endif
106

    
107
#ifndef PERL_ARGS_ASSERT_CROAK_XS_USAGE
108
#define PERL_ARGS_ASSERT_CROAK_XS_USAGE assert(cv); assert(params)
109

    
110
/* prototype to pass -Wmissing-prototypes */
111
STATIC void
112
S_croak_xs_usage(pTHX_ const CV *const cv, const char *const params);
113

    
114
STATIC void
115
S_croak_xs_usage(pTHX_ const CV *const cv, const char *const params)
116
{
117
    const GV *const gv = CvGV(cv);
118

    
119
    PERL_ARGS_ASSERT_CROAK_XS_USAGE;
120

    
121
    if (gv) {
122
        const char *const gvname = GvNAME(gv);
123
        const HV *const stash = GvSTASH(gv);
124
        const char *const hvname = stash ? HvNAME(stash) : NULL;
125

    
126
        if (hvname)
127
            Perl_croak(aTHX_ "Usage: %s::%s(%s)", hvname, gvname, params);
128
        else
129
            Perl_croak(aTHX_ "Usage: %s(%s)", gvname, params);
130
    } else {
131
        /* Pants. I don't think that it should be possible to get here. */
132
        Perl_croak(aTHX_ "Usage: CODE(0x%"UVxf")(%s)", PTR2UV(cv), params);
133
    }
134
}
135
#undef  PERL_ARGS_ASSERT_CROAK_XS_USAGE
136

    
137
#ifdef PERL_IMPLICIT_CONTEXT
138
#define croak_xs_usage(a,b)    S_croak_xs_usage(aTHX_ a,b)
139
#else
140
#define croak_xs_usage        S_croak_xs_usage
141
#endif
142

    
143
#endif
144

    
145
/* NOTE: the prototype of newXSproto() is different in versions of perls,
146
 * so we define a portable version of newXSproto()
147
 */
148
#ifdef newXS_flags
149
#define newXSproto_portable(name, c_impl, file, proto) newXS_flags(name, c_impl, file, proto, 0)
150
#else
151
#define newXSproto_portable(name, c_impl, file, proto) (PL_Sv=(SV*)newXS(name, c_impl, file), sv_setpv(PL_Sv, proto), (CV*)PL_Sv)
152
#endif /* !defined(newXS_flags) */
153

    
154
#line 155 "ImgStore.c"
155

    
156
XS_EUPXS(XS_Purple__ImgStore_add); /* prototype to pass -Wmissing-prototypes */
157
XS_EUPXS(XS_Purple__ImgStore_add)
158
{
159
    dVAR; dXSARGS;
160
    if (items != 3)
161
       croak_xs_usage(cv,  "data, size, filename");
162
    {
163
        void *        data = INT2PTR(void *,SvIV(ST(0)))
164
;
165
        size_t        size = (size_t)SvUV(ST(1))
166
;
167
        const char *        filename = (const char *)SvPV_nolen(ST(2))
168
;
169
        Purple__StoredImage        RETVAL;
170

    
171
        RETVAL = purple_imgstore_add(data, size, filename);
172
        ST(0) = purple_perl_bless_object(RETVAL, "Purple::StoredImage");
173
        sv_2mortal(ST(0));
174
    }
175
    XSRETURN(1);
176
}
177

    
178

    
179
XS_EUPXS(XS_Purple__ImgStore_add_with_id); /* prototype to pass -Wmissing-prototypes */
180
XS_EUPXS(XS_Purple__ImgStore_add_with_id)
181
{
182
    dVAR; dXSARGS;
183
    if (items != 3)
184
       croak_xs_usage(cv,  "data, size, filename");
185
    {
186
        void *        data = INT2PTR(void *,SvIV(ST(0)))
187
;
188
        size_t        size = (size_t)SvUV(ST(1))
189
;
190
        const char *        filename = (const char *)SvPV_nolen(ST(2))
191
;
192
        int        RETVAL;
193
        dXSTARG;
194

    
195
        RETVAL = purple_imgstore_add_with_id(data, size, filename);
196
        XSprePUSH; PUSHi((IV)RETVAL);
197
    }
198
    XSRETURN(1);
199
}
200

    
201

    
202
XS_EUPXS(XS_Purple__ImgStore_find_by_id); /* prototype to pass -Wmissing-prototypes */
203
XS_EUPXS(XS_Purple__ImgStore_find_by_id)
204
{
205
    dVAR; dXSARGS;
206
    if (items != 1)
207
       croak_xs_usage(cv,  "id");
208
    {
209
        int        id = (int)SvIV(ST(0))
210
;
211
        Purple__StoredImage        RETVAL;
212

    
213
        RETVAL = purple_imgstore_find_by_id(id);
214
        ST(0) = purple_perl_bless_object(RETVAL, "Purple::StoredImage");
215
        sv_2mortal(ST(0));
216
    }
217
    XSRETURN(1);
218
}
219

    
220

    
221
XS_EUPXS(XS_Purple__ImgStore_get_data); /* prototype to pass -Wmissing-prototypes */
222
XS_EUPXS(XS_Purple__ImgStore_get_data)
223
{
224
    dVAR; dXSARGS;
225
    if (items != 1)
226
       croak_xs_usage(cv,  "i");
227
    {
228
        Purple__StoredImage        i = purple_perl_ref_object(ST(0))
229
;
230
        gconstpointer        RETVAL;
231
        dXSTARG;
232

    
233
        RETVAL = purple_imgstore_get_data(i);
234
        XSprePUSH; PUSHi(PTR2IV(RETVAL));
235
    }
236
    XSRETURN(1);
237
}
238

    
239

    
240
XS_EUPXS(XS_Purple__ImgStore_get_filename); /* prototype to pass -Wmissing-prototypes */
241
XS_EUPXS(XS_Purple__ImgStore_get_filename)
242
{
243
    dVAR; dXSARGS;
244
    if (items != 1)
245
       croak_xs_usage(cv,  "i");
246
    {
247
        Purple__StoredImage        i = purple_perl_ref_object(ST(0))
248
;
249
        const char *        RETVAL;
250
        dXSTARG;
251

    
252
        RETVAL = purple_imgstore_get_filename(i);
253
        sv_setpv(TARG, RETVAL); XSprePUSH; PUSHTARG;
254
    }
255
    XSRETURN(1);
256
}
257

    
258

    
259
XS_EUPXS(XS_Purple__ImgStore_get_size); /* prototype to pass -Wmissing-prototypes */
260
XS_EUPXS(XS_Purple__ImgStore_get_size)
261
{
262
    dVAR; dXSARGS;
263
    if (items != 1)
264
       croak_xs_usage(cv,  "i");
265
    {
266
        Purple__StoredImage        i = purple_perl_ref_object(ST(0))
267
;
268
        size_t        RETVAL;
269
        dXSTARG;
270

    
271
        RETVAL = purple_imgstore_get_size(i);
272
        XSprePUSH; PUSHu((UV)RETVAL);
273
    }
274
    XSRETURN(1);
275
}
276

    
277

    
278
XS_EUPXS(XS_Purple__ImgStore_get_extension); /* prototype to pass -Wmissing-prototypes */
279
XS_EUPXS(XS_Purple__ImgStore_get_extension)
280
{
281
    dVAR; dXSARGS;
282
    if (items != 1)
283
       croak_xs_usage(cv,  "i");
284
    {
285
        Purple__StoredImage        i = purple_perl_ref_object(ST(0))
286
;
287
        const char *        RETVAL;
288
        dXSTARG;
289

    
290
        RETVAL = purple_imgstore_get_extension(i);
291
        sv_setpv(TARG, RETVAL); XSprePUSH; PUSHTARG;
292
    }
293
    XSRETURN(1);
294
}
295

    
296

    
297
XS_EUPXS(XS_Purple__ImgStore_ref); /* prototype to pass -Wmissing-prototypes */
298
XS_EUPXS(XS_Purple__ImgStore_ref)
299
{
300
    dVAR; dXSARGS;
301
    if (items != 1)
302
       croak_xs_usage(cv,  "id");
303
    {
304
        Purple__StoredImage        id = purple_perl_ref_object(ST(0))
305
;
306
        Purple__StoredImage        RETVAL;
307

    
308
        RETVAL = purple_imgstore_ref(id);
309
        ST(0) = purple_perl_bless_object(RETVAL, "Purple::StoredImage");
310
        sv_2mortal(ST(0));
311
    }
312
    XSRETURN(1);
313
}
314

    
315

    
316
XS_EUPXS(XS_Purple__ImgStore_unref); /* prototype to pass -Wmissing-prototypes */
317
XS_EUPXS(XS_Purple__ImgStore_unref)
318
{
319
    dVAR; dXSARGS;
320
    if (items != 1)
321
       croak_xs_usage(cv,  "id");
322
    {
323
        Purple__StoredImage        id = purple_perl_ref_object(ST(0))
324
;
325
        Purple__StoredImage        RETVAL;
326

    
327
        RETVAL = purple_imgstore_unref(id);
328
        ST(0) = purple_perl_bless_object(RETVAL, "Purple::StoredImage");
329
        sv_2mortal(ST(0));
330
    }
331
    XSRETURN(1);
332
}
333

    
334

    
335
XS_EUPXS(XS_Purple__ImgStore_ref_by_id); /* prototype to pass -Wmissing-prototypes */
336
XS_EUPXS(XS_Purple__ImgStore_ref_by_id)
337
{
338
    dVAR; dXSARGS;
339
    if (items != 1)
340
       croak_xs_usage(cv,  "id");
341
    {
342
        int        id = (int)SvIV(ST(0))
343
;
344

    
345
        purple_imgstore_ref_by_id(id);
346
    }
347
    XSRETURN_EMPTY;
348
}
349

    
350

    
351
XS_EUPXS(XS_Purple__ImgStore_unref_by_id); /* prototype to pass -Wmissing-prototypes */
352
XS_EUPXS(XS_Purple__ImgStore_unref_by_id)
353
{
354
    dVAR; dXSARGS;
355
    if (items != 1)
356
       croak_xs_usage(cv,  "id");
357
    {
358
        int        id = (int)SvIV(ST(0))
359
;
360

    
361
        purple_imgstore_unref_by_id(id);
362
    }
363
    XSRETURN_EMPTY;
364
}
365

    
366
#ifdef __cplusplus
367
extern "C"
368
#endif
369
XS_EXTERNAL(boot_Purple__ImgStore); /* prototype to pass -Wmissing-prototypes */
370
XS_EXTERNAL(boot_Purple__ImgStore)
371
{
372
    dVAR; dXSARGS;
373
#if (PERL_REVISION == 5 && PERL_VERSION < 9)
374
    char* file = __FILE__;
375
#else
376
    const char* file = __FILE__;
377
#endif
378

    
379
    PERL_UNUSED_VAR(cv); /* -W */
380
    PERL_UNUSED_VAR(items); /* -W */
381
#ifdef XS_APIVERSION_BOOTCHECK
382
    XS_APIVERSION_BOOTCHECK;
383
#endif
384
    XS_VERSION_BOOTCHECK;
385

    
386
        (void)newXSproto_portable("Purple::ImgStore::add", XS_Purple__ImgStore_add, file, "$$$");
387
        (void)newXSproto_portable("Purple::ImgStore::add_with_id", XS_Purple__ImgStore_add_with_id, file, "$$$");
388
        (void)newXSproto_portable("Purple::ImgStore::find_by_id", XS_Purple__ImgStore_find_by_id, file, "$");
389
        (void)newXSproto_portable("Purple::ImgStore::get_data", XS_Purple__ImgStore_get_data, file, "$");
390
        (void)newXSproto_portable("Purple::ImgStore::get_filename", XS_Purple__ImgStore_get_filename, file, "$");
391
        (void)newXSproto_portable("Purple::ImgStore::get_size", XS_Purple__ImgStore_get_size, file, "$");
392
        (void)newXSproto_portable("Purple::ImgStore::get_extension", XS_Purple__ImgStore_get_extension, file, "$");
393
        (void)newXSproto_portable("Purple::ImgStore::ref", XS_Purple__ImgStore_ref, file, "$");
394
        (void)newXSproto_portable("Purple::ImgStore::unref", XS_Purple__ImgStore_unref, file, "$");
395
        (void)newXSproto_portable("Purple::ImgStore::ref_by_id", XS_Purple__ImgStore_ref_by_id, file, "$");
396
        (void)newXSproto_portable("Purple::ImgStore::unref_by_id", XS_Purple__ImgStore_unref_by_id, file, "$");
397
#if (PERL_REVISION == 5 && PERL_VERSION >= 9)
398
  if (PL_unitcheckav)
399
       call_list(PL_scopestack_ix, PL_unitcheckav);
400
#endif
401
    XSRETURN_YES;
402
}
403