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

History | View | Annotate | Download (12.4 KB)

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

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

    
12
#line 13 "Whiteboard.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 "Whiteboard.c"
155

    
156
XS_EUPXS(XS_Purple__Whiteboard_clear); /* prototype to pass -Wmissing-prototypes */
157
XS_EUPXS(XS_Purple__Whiteboard_clear)
158
{
159
    dVAR; dXSARGS;
160
    if (items != 1)
161
       croak_xs_usage(cv,  "wb");
162
    {
163
        Purple__Whiteboard        wb = purple_perl_ref_object(ST(0))
164
;
165

    
166
        purple_whiteboard_clear(wb);
167
    }
168
    XSRETURN_EMPTY;
169
}
170

    
171

    
172
XS_EUPXS(XS_Purple__Whiteboard_create); /* prototype to pass -Wmissing-prototypes */
173
XS_EUPXS(XS_Purple__Whiteboard_create)
174
{
175
    dVAR; dXSARGS;
176
    if (items != 3)
177
       croak_xs_usage(cv,  "account, who, state");
178
    {
179
        Purple__Account        account = purple_perl_ref_object(ST(0))
180
;
181
        const char*        who = (const char *)SvPV_nolen(ST(1))
182
;
183
        int        state = (int)SvIV(ST(2))
184
;
185
        Purple__Whiteboard        RETVAL;
186

    
187
        RETVAL = purple_whiteboard_create(account, who, state);
188
        ST(0) = purple_perl_bless_object(RETVAL, "Purple::Whiteboard");
189
        sv_2mortal(ST(0));
190
    }
191
    XSRETURN(1);
192
}
193

    
194

    
195
XS_EUPXS(XS_Purple__Whiteboard_destroy); /* prototype to pass -Wmissing-prototypes */
196
XS_EUPXS(XS_Purple__Whiteboard_destroy)
197
{
198
    dVAR; dXSARGS;
199
    if (items != 1)
200
       croak_xs_usage(cv,  "wb");
201
    {
202
        Purple__Whiteboard        wb = purple_perl_ref_object(ST(0))
203
;
204

    
205
        purple_whiteboard_destroy(wb);
206
    }
207
    XSRETURN_EMPTY;
208
}
209

    
210

    
211
XS_EUPXS(XS_Purple__Whiteboard_draw_line); /* prototype to pass -Wmissing-prototypes */
212
XS_EUPXS(XS_Purple__Whiteboard_draw_line)
213
{
214
    dVAR; dXSARGS;
215
    if (items != 7)
216
       croak_xs_usage(cv,  "wb, x1, y1, x2, y2, color, size");
217
    {
218
        Purple__Whiteboard        wb = purple_perl_ref_object(ST(0))
219
;
220
        int        x1 = (int)SvIV(ST(1))
221
;
222
        int        y1 = (int)SvIV(ST(2))
223
;
224
        int        x2 = (int)SvIV(ST(3))
225
;
226
        int        y2 = (int)SvIV(ST(4))
227
;
228
        int        color = (int)SvIV(ST(5))
229
;
230
        int        size = (int)SvIV(ST(6))
231
;
232

    
233
        purple_whiteboard_draw_line(wb, x1, y1, x2, y2, color, size);
234
    }
235
    XSRETURN_EMPTY;
236
}
237

    
238

    
239
XS_EUPXS(XS_Purple__Whiteboard_draw_point); /* prototype to pass -Wmissing-prototypes */
240
XS_EUPXS(XS_Purple__Whiteboard_draw_point)
241
{
242
    dVAR; dXSARGS;
243
    if (items != 5)
244
       croak_xs_usage(cv,  "wb, x, y, color, size");
245
    {
246
        Purple__Whiteboard        wb = purple_perl_ref_object(ST(0))
247
;
248
        int        x = (int)SvIV(ST(1))
249
;
250
        int        y = (int)SvIV(ST(2))
251
;
252
        int        color = (int)SvIV(ST(3))
253
;
254
        int        size = (int)SvIV(ST(4))
255
;
256

    
257
        purple_whiteboard_draw_point(wb, x, y, color, size);
258
    }
259
    XSRETURN_EMPTY;
260
}
261

    
262

    
263
XS_EUPXS(XS_Purple__Whiteboard_get_session); /* prototype to pass -Wmissing-prototypes */
264
XS_EUPXS(XS_Purple__Whiteboard_get_session)
265
{
266
    dVAR; dXSARGS;
267
    if (items != 2)
268
       croak_xs_usage(cv,  "account, who");
269
    {
270
        Purple__Account        account = purple_perl_ref_object(ST(0))
271
;
272
        const char*        who = (const char *)SvPV_nolen(ST(1))
273
;
274
        Purple__Whiteboard        RETVAL;
275

    
276
        RETVAL = purple_whiteboard_get_session(account, who);
277
        ST(0) = purple_perl_bless_object(RETVAL, "Purple::Whiteboard");
278
        sv_2mortal(ST(0));
279
    }
280
    XSRETURN(1);
281
}
282

    
283

    
284
XS_EUPXS(XS_Purple__Whiteboard_send_brush); /* prototype to pass -Wmissing-prototypes */
285
XS_EUPXS(XS_Purple__Whiteboard_send_brush)
286
{
287
    dVAR; dXSARGS;
288
    if (items != 3)
289
       croak_xs_usage(cv,  "wb, size, color");
290
    {
291
        Purple__Whiteboard        wb = purple_perl_ref_object(ST(0))
292
;
293
        int        size = (int)SvIV(ST(1))
294
;
295
        int        color = (int)SvIV(ST(2))
296
;
297

    
298
        purple_whiteboard_send_brush(wb, size, color);
299
    }
300
    XSRETURN_EMPTY;
301
}
302

    
303

    
304
XS_EUPXS(XS_Purple__Whiteboard_send_clear); /* prototype to pass -Wmissing-prototypes */
305
XS_EUPXS(XS_Purple__Whiteboard_send_clear)
306
{
307
    dVAR; dXSARGS;
308
    if (items != 1)
309
       croak_xs_usage(cv,  "wb");
310
    {
311
        Purple__Whiteboard        wb = purple_perl_ref_object(ST(0))
312
;
313

    
314
        purple_whiteboard_send_clear(wb);
315
    }
316
    XSRETURN_EMPTY;
317
}
318

    
319

    
320
XS_EUPXS(XS_Purple__Whiteboard_set_brush); /* prototype to pass -Wmissing-prototypes */
321
XS_EUPXS(XS_Purple__Whiteboard_set_brush)
322
{
323
    dVAR; dXSARGS;
324
    if (items != 3)
325
       croak_xs_usage(cv,  "wb, size, color");
326
    {
327
        Purple__Whiteboard        wb = purple_perl_ref_object(ST(0))
328
;
329
        int        size = (int)SvIV(ST(1))
330
;
331
        int        color = (int)SvIV(ST(2))
332
;
333

    
334
        purple_whiteboard_set_brush(wb, size, color);
335
    }
336
    XSRETURN_EMPTY;
337
}
338

    
339

    
340
XS_EUPXS(XS_Purple__Whiteboard_set_dimensions); /* prototype to pass -Wmissing-prototypes */
341
XS_EUPXS(XS_Purple__Whiteboard_set_dimensions)
342
{
343
    dVAR; dXSARGS;
344
    if (items != 3)
345
       croak_xs_usage(cv,  "wb, width, height");
346
    {
347
        Purple__Whiteboard        wb = purple_perl_ref_object(ST(0))
348
;
349
        int        width = (int)SvIV(ST(1))
350
;
351
        int        height = (int)SvIV(ST(2))
352
;
353

    
354
        purple_whiteboard_set_dimensions(wb, width, height);
355
    }
356
    XSRETURN_EMPTY;
357
}
358

    
359

    
360
XS_EUPXS(XS_Purple__Whiteboard_get_brush); /* prototype to pass -Wmissing-prototypes */
361
XS_EUPXS(XS_Purple__Whiteboard_get_brush)
362
{
363
    dVAR; dXSARGS;
364
    if (items != 1)
365
       croak_xs_usage(cv,  "wb");
366
    {
367
        Purple__Whiteboard        wb = purple_perl_ref_object(ST(0))
368
;
369
        gboolean        RETVAL;
370
        int        size;
371
        int        color;
372

    
373
        RETVAL = purple_whiteboard_get_brush(wb, &size, &color);
374
        ST(0) = sv_newmortal();
375
        ST(0) = boolSV(RETVAL);
376
        XSprePUSH;        EXTEND(SP,2);
377
        PUSHs(sv_newmortal());
378
        sv_setiv(ST(1), (IV)size);
379
        PUSHs(sv_newmortal());
380
        sv_setiv(ST(2), (IV)color);
381
    }
382
    XSRETURN(3);
383
}
384

    
385

    
386
XS_EUPXS(XS_Purple__Whiteboard_get_dimensions); /* prototype to pass -Wmissing-prototypes */
387
XS_EUPXS(XS_Purple__Whiteboard_get_dimensions)
388
{
389
    dVAR; dXSARGS;
390
    if (items != 1)
391
       croak_xs_usage(cv,  "wb");
392
    {
393
        Purple__Whiteboard        wb = purple_perl_ref_object(ST(0))
394
;
395
        gboolean        RETVAL;
396
        int        width;
397
        int        height;
398

    
399
        RETVAL = purple_whiteboard_get_dimensions(wb, &width, &height);
400
        ST(0) = sv_newmortal();
401
        ST(0) = boolSV(RETVAL);
402
        XSprePUSH;        EXTEND(SP,2);
403
        PUSHs(sv_newmortal());
404
        sv_setiv(ST(1), (IV)width);
405
        PUSHs(sv_newmortal());
406
        sv_setiv(ST(2), (IV)height);
407
    }
408
    XSRETURN(3);
409
}
410

    
411

    
412
XS_EUPXS(XS_Purple__Whiteboard_start); /* prototype to pass -Wmissing-prototypes */
413
XS_EUPXS(XS_Purple__Whiteboard_start)
414
{
415
    dVAR; dXSARGS;
416
    if (items != 1)
417
       croak_xs_usage(cv,  "wb");
418
    {
419
        Purple__Whiteboard        wb = purple_perl_ref_object(ST(0))
420
;
421

    
422
        purple_whiteboard_start(wb);
423
    }
424
    XSRETURN_EMPTY;
425
}
426

    
427
#ifdef __cplusplus
428
extern "C"
429
#endif
430
XS_EXTERNAL(boot_Purple__Whiteboard); /* prototype to pass -Wmissing-prototypes */
431
XS_EXTERNAL(boot_Purple__Whiteboard)
432
{
433
    dVAR; dXSARGS;
434
#if (PERL_REVISION == 5 && PERL_VERSION < 9)
435
    char* file = __FILE__;
436
#else
437
    const char* file = __FILE__;
438
#endif
439

    
440
    PERL_UNUSED_VAR(cv); /* -W */
441
    PERL_UNUSED_VAR(items); /* -W */
442
#ifdef XS_APIVERSION_BOOTCHECK
443
    XS_APIVERSION_BOOTCHECK;
444
#endif
445
    XS_VERSION_BOOTCHECK;
446

    
447
        (void)newXSproto_portable("Purple::Whiteboard::clear", XS_Purple__Whiteboard_clear, file, "$");
448
        (void)newXSproto_portable("Purple::Whiteboard::create", XS_Purple__Whiteboard_create, file, "$$$");
449
        (void)newXSproto_portable("Purple::Whiteboard::destroy", XS_Purple__Whiteboard_destroy, file, "$");
450
        (void)newXSproto_portable("Purple::Whiteboard::draw_line", XS_Purple__Whiteboard_draw_line, file, "$$$$$$$");
451
        (void)newXSproto_portable("Purple::Whiteboard::draw_point", XS_Purple__Whiteboard_draw_point, file, "$$$$$");
452
        (void)newXSproto_portable("Purple::Whiteboard::get_session", XS_Purple__Whiteboard_get_session, file, "$$");
453
        (void)newXSproto_portable("Purple::Whiteboard::send_brush", XS_Purple__Whiteboard_send_brush, file, "$$$");
454
        (void)newXSproto_portable("Purple::Whiteboard::send_clear", XS_Purple__Whiteboard_send_clear, file, "$");
455
        (void)newXSproto_portable("Purple::Whiteboard::set_brush", XS_Purple__Whiteboard_set_brush, file, "$$$");
456
        (void)newXSproto_portable("Purple::Whiteboard::set_dimensions", XS_Purple__Whiteboard_set_dimensions, file, "$$$");
457
        (void)newXSproto_portable("Purple::Whiteboard::get_brush", XS_Purple__Whiteboard_get_brush, file, "$");
458
        (void)newXSproto_portable("Purple::Whiteboard::get_dimensions", XS_Purple__Whiteboard_get_dimensions, file, "$");
459
        (void)newXSproto_portable("Purple::Whiteboard::start", XS_Purple__Whiteboard_start, file, "$");
460
#if (PERL_REVISION == 5 && PERL_VERSION >= 9)
461
  if (PL_unitcheckav)
462
       call_list(PL_scopestack_ix, PL_unitcheckav);
463
#endif
464
    XSRETURN_YES;
465
}
466