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

History | View | Annotate | Download (61 KB)

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

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

    
12
/* This breaks on faceprint's amd64 box
13
void *
14
purple_request_action_varg(handle, title, primary, secondary, default_action, user_data, action_count, actions)
15
        void * handle
16
        const char *title
17
        const char *primary
18
        const char *secondary
19
        unsigned int default_action
20
        void *user_data
21
        size_t action_count
22
        va_list actions
23
        */
24

    
25

    
26
typedef struct {
27
        SV *ok_fun;
28
        SV *cancel_fun;
29
} PurplePerlRequestData;
30

    
31
static void
32
purple_perl_request_data_free(PurplePerlRequestData *ppr)
33
{
34
        if (ppr->ok_fun)
35
                SvREFCNT_dec(ppr->ok_fun);
36
        if (ppr->cancel_fun)
37
                SvREFCNT_dec(ppr->cancel_fun);
38
        g_free(ppr);
39
}
40

    
41
/********************************************************/
42
/*                                                      */
43
/* Callback function that calls a perl subroutine       */
44
/*                                                      */
45
/* The void * field data is being used as a way to hide */
46
/* the perl sub's name in a PurplePerlRequestData         */
47
/*                                                      */
48
/********************************************************/
49
static void
50
purple_perl_request_ok_cb(void * data, PurpleRequestFields *fields)
51
{
52
        PurplePerlRequestData *gpr = (PurplePerlRequestData *)data;
53

    
54
        dSP;
55
        ENTER;
56
        SAVETMPS;
57
        PUSHMARK(sp);
58

    
59
        XPUSHs(sv_2mortal(purple_perl_bless_object(fields, "Purple::Request::Fields")));
60
        PUTBACK;
61
        call_sv(gpr->ok_fun, G_EVAL | G_SCALAR);
62
        SPAGAIN;
63

    
64
        PUTBACK;
65
        FREETMPS;
66
        LEAVE;
67

    
68
        purple_perl_request_data_free(gpr);
69
}
70

    
71
static void
72
purple_perl_request_cancel_cb(void * data, PurpleRequestFields *fields)
73
{
74
        PurplePerlRequestData *gpr = (PurplePerlRequestData *)data;
75

    
76
        dSP;
77
        ENTER;
78
        SAVETMPS;
79
        PUSHMARK(sp);
80

    
81
        XPUSHs(sv_2mortal(purple_perl_bless_object(fields, "Purple::Request::Fields")));
82
        PUTBACK;
83
        call_sv(gpr->cancel_fun, G_EVAL | G_SCALAR);
84
        SPAGAIN;
85

    
86
        PUTBACK;
87
        FREETMPS;
88
        LEAVE;
89

    
90
        purple_perl_request_data_free(gpr);
91
}
92

    
93
#line 94 "Request.c"
94
#ifndef PERL_UNUSED_VAR
95
#  define PERL_UNUSED_VAR(var) if (0) var = var
96
#endif
97

    
98
#ifndef dVAR
99
#  define dVAR                dNOOP
100
#endif
101

    
102

    
103
/* This stuff is not part of the API! You have been warned. */
104
#ifndef PERL_VERSION_DECIMAL
105
#  define PERL_VERSION_DECIMAL(r,v,s) (r*1000000 + v*1000 + s)
106
#endif
107
#ifndef PERL_DECIMAL_VERSION
108
#  define PERL_DECIMAL_VERSION \
109
          PERL_VERSION_DECIMAL(PERL_REVISION,PERL_VERSION,PERL_SUBVERSION)
110
#endif
111
#ifndef PERL_VERSION_GE
112
#  define PERL_VERSION_GE(r,v,s) \
113
          (PERL_DECIMAL_VERSION >= PERL_VERSION_DECIMAL(r,v,s))
114
#endif
115
#ifndef PERL_VERSION_LE
116
#  define PERL_VERSION_LE(r,v,s) \
117
          (PERL_DECIMAL_VERSION <= PERL_VERSION_DECIMAL(r,v,s))
118
#endif
119

    
120
/* XS_INTERNAL is the explicit static-linkage variant of the default
121
 * XS macro.
122
 *
123
 * XS_EXTERNAL is the same as XS_INTERNAL except it does not include
124
 * "STATIC", ie. it exports XSUB symbols. You probably don't want that
125
 * for anything but the BOOT XSUB.
126
 *
127
 * See XSUB.h in core!
128
 */
129

    
130

    
131
/* TODO: This might be compatible further back than 5.10.0. */
132
#if PERL_VERSION_GE(5, 10, 0) && PERL_VERSION_LE(5, 15, 1)
133
#  undef XS_EXTERNAL
134
#  undef XS_INTERNAL
135
#  if defined(__CYGWIN__) && defined(USE_DYNAMIC_LOADING)
136
#    define XS_EXTERNAL(name) __declspec(dllexport) XSPROTO(name)
137
#    define XS_INTERNAL(name) STATIC XSPROTO(name)
138
#  endif
139
#  if defined(__SYMBIAN32__)
140
#    define XS_EXTERNAL(name) EXPORT_C XSPROTO(name)
141
#    define XS_INTERNAL(name) EXPORT_C STATIC XSPROTO(name)
142
#  endif
143
#  ifndef XS_EXTERNAL
144
#    if defined(HASATTRIBUTE_UNUSED) && !defined(__cplusplus)
145
#      define XS_EXTERNAL(name) void name(pTHX_ CV* cv __attribute__unused__)
146
#      define XS_INTERNAL(name) STATIC void name(pTHX_ CV* cv __attribute__unused__)
147
#    else
148
#      ifdef __cplusplus
149
#        define XS_EXTERNAL(name) extern "C" XSPROTO(name)
150
#        define XS_INTERNAL(name) static XSPROTO(name)
151
#      else
152
#        define XS_EXTERNAL(name) XSPROTO(name)
153
#        define XS_INTERNAL(name) STATIC XSPROTO(name)
154
#      endif
155
#    endif
156
#  endif
157
#endif
158

    
159
/* perl >= 5.10.0 && perl <= 5.15.1 */
160

    
161

    
162
/* The XS_EXTERNAL macro is used for functions that must not be static
163
 * like the boot XSUB of a module. If perl didn't have an XS_EXTERNAL
164
 * macro defined, the best we can do is assume XS is the same.
165
 * Dito for XS_INTERNAL.
166
 */
167
#ifndef XS_EXTERNAL
168
#  define XS_EXTERNAL(name) XS(name)
169
#endif
170
#ifndef XS_INTERNAL
171
#  define XS_INTERNAL(name) XS(name)
172
#endif
173

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

    
180
#undef XS_EUPXS
181
#if defined(PERL_EUPXS_ALWAYS_EXPORT)
182
#  define XS_EUPXS(name) XS_EXTERNAL(name)
183
#else
184
   /* default to internal */
185
#  define XS_EUPXS(name) XS_INTERNAL(name)
186
#endif
187

    
188
#ifndef PERL_ARGS_ASSERT_CROAK_XS_USAGE
189
#define PERL_ARGS_ASSERT_CROAK_XS_USAGE assert(cv); assert(params)
190

    
191
/* prototype to pass -Wmissing-prototypes */
192
STATIC void
193
S_croak_xs_usage(pTHX_ const CV *const cv, const char *const params);
194

    
195
STATIC void
196
S_croak_xs_usage(pTHX_ const CV *const cv, const char *const params)
197
{
198
    const GV *const gv = CvGV(cv);
199

    
200
    PERL_ARGS_ASSERT_CROAK_XS_USAGE;
201

    
202
    if (gv) {
203
        const char *const gvname = GvNAME(gv);
204
        const HV *const stash = GvSTASH(gv);
205
        const char *const hvname = stash ? HvNAME(stash) : NULL;
206

    
207
        if (hvname)
208
            Perl_croak(aTHX_ "Usage: %s::%s(%s)", hvname, gvname, params);
209
        else
210
            Perl_croak(aTHX_ "Usage: %s(%s)", gvname, params);
211
    } else {
212
        /* Pants. I don't think that it should be possible to get here. */
213
        Perl_croak(aTHX_ "Usage: CODE(0x%"UVxf")(%s)", PTR2UV(cv), params);
214
    }
215
}
216
#undef  PERL_ARGS_ASSERT_CROAK_XS_USAGE
217

    
218
#ifdef PERL_IMPLICIT_CONTEXT
219
#define croak_xs_usage(a,b)    S_croak_xs_usage(aTHX_ a,b)
220
#else
221
#define croak_xs_usage        S_croak_xs_usage
222
#endif
223

    
224
#endif
225

    
226
/* NOTE: the prototype of newXSproto() is different in versions of perls,
227
 * so we define a portable version of newXSproto()
228
 */
229
#ifdef newXS_flags
230
#define newXSproto_portable(name, c_impl, file, proto) newXS_flags(name, c_impl, file, proto, 0)
231
#else
232
#define newXSproto_portable(name, c_impl, file, proto) (PL_Sv=(SV*)newXS(name, c_impl, file), sv_setpv(PL_Sv, proto), (CV*)PL_Sv)
233
#endif /* !defined(newXS_flags) */
234

    
235
#line 236 "Request.c"
236

    
237
XS_EUPXS(XS_Purple__Request_input); /* prototype to pass -Wmissing-prototypes */
238
XS_EUPXS(XS_Purple__Request_input)
239
{
240
    dVAR; dXSARGS;
241
    if (items != 12)
242
       croak_xs_usage(cv,  "handle, title, primary, secondary, default_value, multiline, masked, hint, ok_text, ok_cb, cancel_text, cancel_cb");
243
    {
244
        Purple__Plugin        handle = purple_perl_ref_object(ST(0))
245
;
246
        const char *        title = (const char *)SvPV_nolen(ST(1))
247
;
248
        const char *        primary = (const char *)SvPV_nolen(ST(2))
249
;
250
        const char *        secondary = (const char *)SvPV_nolen(ST(3))
251
;
252
        const char *        default_value = (const char *)SvPV_nolen(ST(4))
253
;
254
        gboolean        multiline = (bool)SvTRUE(ST(5))
255
;
256
        gboolean        masked = (bool)SvTRUE(ST(6))
257
;
258
        gchar *        hint = (gchar *)SvPV_nolen(ST(7))
259
;
260
        const char *        ok_text = (const char *)SvPV_nolen(ST(8))
261
;
262
        SV *        ok_cb = ST(9)
263
;
264
        const char *        cancel_text = (const char *)SvPV_nolen(ST(10))
265
;
266
        SV *        cancel_cb = ST(11)
267
;
268
        void *        RETVAL;
269
        dXSTARG;
270
#line 137 "Request.xs"
271
        PurplePerlRequestData *gpr;
272
        char *basename;
273

    
274
        basename = g_path_get_basename(handle->path);
275
        purple_perl_normalize_script_name(basename);
276
        gpr = g_new(PurplePerlRequestData, 1);
277
        gpr->ok_fun = purple_perl_sv_from_fun(handle, ok_cb);
278
        gpr->cancel_fun = purple_perl_sv_from_fun(handle, cancel_cb);
279
        g_free(basename);
280

    
281
        RETVAL = purple_request_input(handle, title, primary, secondary, default_value, multiline, masked, hint, ok_text, G_CALLBACK(purple_perl_request_ok_cb), cancel_text, G_CALLBACK(purple_perl_request_cancel_cb), NULL, NULL, NULL, gpr);
282
#line 283 "Request.c"
283
        XSprePUSH; PUSHi(PTR2IV(RETVAL));
284
    }
285
    XSRETURN(1);
286
}
287

    
288

    
289
XS_EUPXS(XS_Purple__Request_file); /* prototype to pass -Wmissing-prototypes */
290
XS_EUPXS(XS_Purple__Request_file)
291
{
292
    dVAR; dXSARGS;
293
    if (items != 6)
294
       croak_xs_usage(cv,  "handle, title, filename, savedialog, ok_cb, cancel_cb");
295
    {
296
        Purple__Plugin        handle = purple_perl_ref_object(ST(0))
297
;
298
        const char *        title = (const char *)SvPV_nolen(ST(1))
299
;
300
        const char *        filename = (const char *)SvPV_nolen(ST(2))
301
;
302
        gboolean        savedialog = (bool)SvTRUE(ST(3))
303
;
304
        SV *        ok_cb = ST(4)
305
;
306
        SV *        cancel_cb = ST(5)
307
;
308
        void *        RETVAL;
309
        dXSTARG;
310
#line 160 "Request.xs"
311
        PurplePerlRequestData *gpr;
312
        char *basename;
313

    
314
        basename = g_path_get_basename(handle->path);
315
        purple_perl_normalize_script_name(basename);
316
        gpr = g_new(PurplePerlRequestData, 1);
317
        gpr->ok_fun = purple_perl_sv_from_fun(handle, ok_cb);
318
        gpr->cancel_fun = purple_perl_sv_from_fun(handle, cancel_cb);
319
        g_free(basename);
320

    
321
        RETVAL = purple_request_file(handle, title, filename, savedialog, G_CALLBACK(purple_perl_request_ok_cb), G_CALLBACK(purple_perl_request_cancel_cb), NULL, NULL, NULL, gpr);
322
#line 323 "Request.c"
323
        XSprePUSH; PUSHi(PTR2IV(RETVAL));
324
    }
325
    XSRETURN(1);
326
}
327

    
328

    
329
XS_EUPXS(XS_Purple__Request_fields); /* prototype to pass -Wmissing-prototypes */
330
XS_EUPXS(XS_Purple__Request_fields)
331
{
332
    dVAR; dXSARGS;
333
    if (items != 9)
334
       croak_xs_usage(cv,  "handle, title, primary, secondary, fields, ok_text, ok_cb, cancel_text, cancel_cb");
335
    {
336
        Purple__Plugin        handle = purple_perl_ref_object(ST(0))
337
;
338
        const char *        title = (const char *)SvPV_nolen(ST(1))
339
;
340
        const char *        primary = (const char *)SvPV_nolen(ST(2))
341
;
342
        const char *        secondary = (const char *)SvPV_nolen(ST(3))
343
;
344
        Purple__Request__Fields        fields = purple_perl_ref_object(ST(4))
345
;
346
        const char *        ok_text = (const char *)SvPV_nolen(ST(5))
347
;
348
        SV *        ok_cb = ST(6)
349
;
350
        const char *        cancel_text = (const char *)SvPV_nolen(ST(7))
351
;
352
        SV *        cancel_cb = ST(8)
353
;
354
        void *        RETVAL;
355
        dXSTARG;
356
#line 186 "Request.xs"
357
        PurplePerlRequestData *gpr;
358
        char *basename;
359

    
360
        basename = g_path_get_basename(handle->path);
361
        purple_perl_normalize_script_name(basename);
362
        gpr = g_new(PurplePerlRequestData, 1);
363
        gpr->ok_fun = purple_perl_sv_from_fun(handle, ok_cb);
364
        gpr->cancel_fun = purple_perl_sv_from_fun(handle, cancel_cb);
365
        g_free(basename);
366

    
367
        RETVAL = purple_request_fields(handle, title, primary, secondary, fields, ok_text, G_CALLBACK(purple_perl_request_ok_cb), cancel_text, G_CALLBACK(purple_perl_request_cancel_cb), NULL, NULL, NULL, gpr);
368
#line 369 "Request.c"
369
        XSprePUSH; PUSHi(PTR2IV(RETVAL));
370
    }
371
    XSRETURN(1);
372
}
373

    
374

    
375
XS_EUPXS(XS_Purple__Request_close); /* prototype to pass -Wmissing-prototypes */
376
XS_EUPXS(XS_Purple__Request_close)
377
{
378
    dVAR; dXSARGS;
379
    if (items != 2)
380
       croak_xs_usage(cv,  "type, uihandle");
381
    {
382
        Purple__RequestType        type = (Purple__RequestType)SvIV(ST(0))
383
;
384
        void *        uihandle = INT2PTR(void *,SvIV(ST(1)))
385
;
386

    
387
        purple_request_close(type, uihandle);
388
    }
389
    XSRETURN_EMPTY;
390
}
391

    
392

    
393
XS_EUPXS(XS_Purple__Request_close_with_handle); /* prototype to pass -Wmissing-prototypes */
394
XS_EUPXS(XS_Purple__Request_close_with_handle)
395
{
396
    dVAR; dXSARGS;
397
    if (items != 1)
398
       croak_xs_usage(cv,  "handle");
399
    {
400
        void *        handle = INT2PTR(void *,SvIV(ST(0)))
401
;
402

    
403
        purple_request_close_with_handle(handle);
404
    }
405
    XSRETURN_EMPTY;
406
}
407

    
408

    
409
XS_EUPXS(XS_Purple__Request__Field_account_new); /* prototype to pass -Wmissing-prototypes */
410
XS_EUPXS(XS_Purple__Request__Field_account_new)
411
{
412
    dVAR; dXSARGS;
413
    if (items < 3 || items > 4)
414
       croak_xs_usage(cv,  "class, id, text, account = NULL");
415
    {
416
        const char *        id = (const char *)SvPV_nolen(ST(1))
417
;
418
        const char *        text = (const char *)SvPV_nolen(ST(2))
419
;
420
        Purple__Account        account;
421
        Purple__Request__Field        RETVAL;
422

    
423
        if (items < 4)
424
            account = NULL;
425
        else {
426
            account = purple_perl_ref_object(ST(3))
427
;
428
        }
429

    
430
        RETVAL = purple_request_field_account_new(id, text, account);
431
        ST(0) = purple_perl_bless_object(RETVAL, "Purple::Request::Field");
432
        sv_2mortal(ST(0));
433
    }
434
    XSRETURN(1);
435
}
436

    
437

    
438
XS_EUPXS(XS_Purple__Request__Field_account_get_default_value); /* prototype to pass -Wmissing-prototypes */
439
XS_EUPXS(XS_Purple__Request__Field_account_get_default_value)
440
{
441
    dVAR; dXSARGS;
442
    if (items != 1)
443
       croak_xs_usage(cv,  "field");
444
    {
445
        Purple__Request__Field        field = purple_perl_ref_object(ST(0))
446
;
447
        Purple__Account        RETVAL;
448

    
449
        RETVAL = purple_request_field_account_get_default_value(field);
450
        ST(0) = purple_perl_bless_object(RETVAL, "Purple::Account");
451
        sv_2mortal(ST(0));
452
    }
453
    XSRETURN(1);
454
}
455

    
456

    
457
XS_EUPXS(XS_Purple__Request__Field_account_get_filter); /* prototype to pass -Wmissing-prototypes */
458
XS_EUPXS(XS_Purple__Request__Field_account_get_filter)
459
{
460
    dVAR; dXSARGS;
461
    if (items != 1)
462
       croak_xs_usage(cv,  "field");
463
    {
464
        Purple__Request__Field        field = purple_perl_ref_object(ST(0))
465
;
466
        IV        RETVAL;
467
        dXSTARG;
468
#line 228 "Request.xs"
469
        RETVAL = PTR2IV(purple_request_field_account_get_filter(field));
470
#line 471 "Request.c"
471
        XSprePUSH; PUSHi((IV)RETVAL);
472
    }
473
    XSRETURN(1);
474
}
475

    
476

    
477
XS_EUPXS(XS_Purple__Request__Field_account_get_show_all); /* prototype to pass -Wmissing-prototypes */
478
XS_EUPXS(XS_Purple__Request__Field_account_get_show_all)
479
{
480
    dVAR; dXSARGS;
481
    if (items != 1)
482
       croak_xs_usage(cv,  "field");
483
    {
484
        Purple__Request__Field        field = purple_perl_ref_object(ST(0))
485
;
486
        gboolean        RETVAL;
487

    
488
        RETVAL = purple_request_field_account_get_show_all(field);
489
        ST(0) = sv_newmortal();
490
        ST(0) = boolSV(RETVAL);
491
    }
492
    XSRETURN(1);
493
}
494

    
495

    
496
XS_EUPXS(XS_Purple__Request__Field_account_get_value); /* prototype to pass -Wmissing-prototypes */
497
XS_EUPXS(XS_Purple__Request__Field_account_get_value)
498
{
499
    dVAR; dXSARGS;
500
    if (items != 1)
501
       croak_xs_usage(cv,  "field");
502
    {
503
        Purple__Request__Field        field = purple_perl_ref_object(ST(0))
504
;
505
        Purple__Account        RETVAL;
506

    
507
        RETVAL = purple_request_field_account_get_value(field);
508
        ST(0) = purple_perl_bless_object(RETVAL, "Purple::Account");
509
        sv_2mortal(ST(0));
510
    }
511
    XSRETURN(1);
512
}
513

    
514

    
515
XS_EUPXS(XS_Purple__Request__Field_account_set_default_value); /* prototype to pass -Wmissing-prototypes */
516
XS_EUPXS(XS_Purple__Request__Field_account_set_default_value)
517
{
518
    dVAR; dXSARGS;
519
    if (items != 2)
520
       croak_xs_usage(cv,  "field, default_value");
521
    {
522
        Purple__Request__Field        field = purple_perl_ref_object(ST(0))
523
;
524
        Purple__Account        default_value = purple_perl_ref_object(ST(1))
525
;
526

    
527
        purple_request_field_account_set_default_value(field, default_value);
528
    }
529
    XSRETURN_EMPTY;
530
}
531

    
532

    
533
XS_EUPXS(XS_Purple__Request__Field_account_set_show_all); /* prototype to pass -Wmissing-prototypes */
534
XS_EUPXS(XS_Purple__Request__Field_account_set_show_all)
535
{
536
    dVAR; dXSARGS;
537
    if (items != 2)
538
       croak_xs_usage(cv,  "field, show_all");
539
    {
540
        Purple__Request__Field        field = purple_perl_ref_object(ST(0))
541
;
542
        gboolean        show_all = (bool)SvTRUE(ST(1))
543
;
544

    
545
        purple_request_field_account_set_show_all(field, show_all);
546
    }
547
    XSRETURN_EMPTY;
548
}
549

    
550

    
551
XS_EUPXS(XS_Purple__Request__Field_account_set_value); /* prototype to pass -Wmissing-prototypes */
552
XS_EUPXS(XS_Purple__Request__Field_account_set_value)
553
{
554
    dVAR; dXSARGS;
555
    if (items != 2)
556
       croak_xs_usage(cv,  "field, value");
557
    {
558
        Purple__Request__Field        field = purple_perl_ref_object(ST(0))
559
;
560
        Purple__Account        value = purple_perl_ref_object(ST(1))
561
;
562

    
563
        purple_request_field_account_set_value(field, value);
564
    }
565
    XSRETURN_EMPTY;
566
}
567

    
568

    
569
XS_EUPXS(XS_Purple__Request__Field_bool_new); /* prototype to pass -Wmissing-prototypes */
570
XS_EUPXS(XS_Purple__Request__Field_bool_new)
571
{
572
    dVAR; dXSARGS;
573
    if (items < 3 || items > 4)
574
       croak_xs_usage(cv,  "class, id, text, default_value = TRUE");
575
    {
576
        const char *        id = (const char *)SvPV_nolen(ST(1))
577
;
578
        const char *        text = (const char *)SvPV_nolen(ST(2))
579
;
580
        gboolean        default_value;
581
        Purple__Request__Field        RETVAL;
582

    
583
        if (items < 4)
584
            default_value = TRUE;
585
        else {
586
            default_value = (bool)SvTRUE(ST(3))
587
;
588
        }
589

    
590
        RETVAL = purple_request_field_bool_new(id, text, default_value);
591
        ST(0) = purple_perl_bless_object(RETVAL, "Purple::Request::Field");
592
        sv_2mortal(ST(0));
593
    }
594
    XSRETURN(1);
595
}
596

    
597

    
598
XS_EUPXS(XS_Purple__Request__Field_bool_get_default_value); /* prototype to pass -Wmissing-prototypes */
599
XS_EUPXS(XS_Purple__Request__Field_bool_get_default_value)
600
{
601
    dVAR; dXSARGS;
602
    if (items != 1)
603
       croak_xs_usage(cv,  "field");
604
    {
605
        Purple__Request__Field        field = purple_perl_ref_object(ST(0))
606
;
607
        gboolean        RETVAL;
608

    
609
        RETVAL = purple_request_field_bool_get_default_value(field);
610
        ST(0) = sv_newmortal();
611
        ST(0) = boolSV(RETVAL);
612
    }
613
    XSRETURN(1);
614
}
615

    
616

    
617
XS_EUPXS(XS_Purple__Request__Field_bool_get_value); /* prototype to pass -Wmissing-prototypes */
618
XS_EUPXS(XS_Purple__Request__Field_bool_get_value)
619
{
620
    dVAR; dXSARGS;
621
    if (items != 1)
622
       croak_xs_usage(cv,  "field");
623
    {
624
        Purple__Request__Field        field = purple_perl_ref_object(ST(0))
625
;
626
        gboolean        RETVAL;
627

    
628
        RETVAL = purple_request_field_bool_get_value(field);
629
        ST(0) = sv_newmortal();
630
        ST(0) = boolSV(RETVAL);
631
    }
632
    XSRETURN(1);
633
}
634

    
635

    
636
XS_EUPXS(XS_Purple__Request__Field_bool_set_default_value); /* prototype to pass -Wmissing-prototypes */
637
XS_EUPXS(XS_Purple__Request__Field_bool_set_default_value)
638
{
639
    dVAR; dXSARGS;
640
    if (items != 2)
641
       croak_xs_usage(cv,  "field, default_value");
642
    {
643
        Purple__Request__Field        field = purple_perl_ref_object(ST(0))
644
;
645
        gboolean        default_value = (bool)SvTRUE(ST(1))
646
;
647

    
648
        purple_request_field_bool_set_default_value(field, default_value);
649
    }
650
    XSRETURN_EMPTY;
651
}
652

    
653

    
654
XS_EUPXS(XS_Purple__Request__Field_bool_set_value); /* prototype to pass -Wmissing-prototypes */
655
XS_EUPXS(XS_Purple__Request__Field_bool_set_value)
656
{
657
    dVAR; dXSARGS;
658
    if (items != 2)
659
       croak_xs_usage(cv,  "field, value");
660
    {
661
        Purple__Request__Field        field = purple_perl_ref_object(ST(0))
662
;
663
        gboolean        value = (bool)SvTRUE(ST(1))
664
;
665

    
666
        purple_request_field_bool_set_value(field, value);
667
    }
668
    XSRETURN_EMPTY;
669
}
670

    
671

    
672
XS_EUPXS(XS_Purple__Request__Field_choice_new); /* prototype to pass -Wmissing-prototypes */
673
XS_EUPXS(XS_Purple__Request__Field_choice_new)
674
{
675
    dVAR; dXSARGS;
676
    if (items < 3 || items > 4)
677
       croak_xs_usage(cv,  "class, id, text, default_value = 0");
678
    {
679
        const char *        id = (const char *)SvPV_nolen(ST(1))
680
;
681
        const char *        text = (const char *)SvPV_nolen(ST(2))
682
;
683
        int        default_value;
684
        Purple__Request__Field        RETVAL;
685

    
686
        if (items < 4)
687
            default_value = 0;
688
        else {
689
            default_value = (int)SvIV(ST(3))
690
;
691
        }
692

    
693
        RETVAL = purple_request_field_choice_new(id, text, default_value);
694
        ST(0) = purple_perl_bless_object(RETVAL, "Purple::Request::Field");
695
        sv_2mortal(ST(0));
696
    }
697
    XSRETURN(1);
698
}
699

    
700

    
701
XS_EUPXS(XS_Purple__Request__Field_choice_add); /* prototype to pass -Wmissing-prototypes */
702
XS_EUPXS(XS_Purple__Request__Field_choice_add)
703
{
704
    dVAR; dXSARGS;
705
    if (items != 2)
706
       croak_xs_usage(cv,  "field, label");
707
    {
708
        Purple__Request__Field        field = purple_perl_ref_object(ST(0))
709
;
710
        const char *        label = (const char *)SvPV_nolen(ST(1))
711
;
712

    
713
        purple_request_field_choice_add(field, label);
714
    }
715
    XSRETURN_EMPTY;
716
}
717

    
718

    
719
XS_EUPXS(XS_Purple__Request__Field_choice_get_default_value); /* prototype to pass -Wmissing-prototypes */
720
XS_EUPXS(XS_Purple__Request__Field_choice_get_default_value)
721
{
722
    dVAR; dXSARGS;
723
    if (items != 1)
724
       croak_xs_usage(cv,  "field");
725
    {
726
        Purple__Request__Field        field = purple_perl_ref_object(ST(0))
727
;
728
        int        RETVAL;
729
        dXSTARG;
730

    
731
        RETVAL = purple_request_field_choice_get_default_value(field);
732
        XSprePUSH; PUSHi((IV)RETVAL);
733
    }
734
    XSRETURN(1);
735
}
736

    
737

    
738
XS_EUPXS(XS_Purple__Request__Field_choice_get_labels); /* prototype to pass -Wmissing-prototypes */
739
XS_EUPXS(XS_Purple__Request__Field_choice_get_labels)
740
{
741
    dVAR; dXSARGS;
742
    if (items != 1)
743
       croak_xs_usage(cv,  "field");
744
    PERL_UNUSED_VAR(ax); /* -Wall */
745
    SP -= items;
746
    {
747
        Purple__Request__Field        field = purple_perl_ref_object(ST(0))
748
;
749
#line 306 "Request.xs"
750
        GList *l;
751
#line 752 "Request.c"
752
#line 308 "Request.xs"
753
        for (l = purple_request_field_choice_get_labels(field); l != NULL; l = l->next) {
754
                XPUSHs(sv_2mortal(newSVpv(l->data, 0)));
755
        }
756
#line 757 "Request.c"
757
        PUTBACK;
758
        return;
759
    }
760
}
761

    
762

    
763
XS_EUPXS(XS_Purple__Request__Field_choice_get_value); /* prototype to pass -Wmissing-prototypes */
764
XS_EUPXS(XS_Purple__Request__Field_choice_get_value)
765
{
766
    dVAR; dXSARGS;
767
    if (items != 1)
768
       croak_xs_usage(cv,  "field");
769
    {
770
        Purple__Request__Field        field = purple_perl_ref_object(ST(0))
771
;
772
        int        RETVAL;
773
        dXSTARG;
774

    
775
        RETVAL = purple_request_field_choice_get_value(field);
776
        XSprePUSH; PUSHi((IV)RETVAL);
777
    }
778
    XSRETURN(1);
779
}
780

    
781

    
782
XS_EUPXS(XS_Purple__Request__Field_choice_set_default_value); /* prototype to pass -Wmissing-prototypes */
783
XS_EUPXS(XS_Purple__Request__Field_choice_set_default_value)
784
{
785
    dVAR; dXSARGS;
786
    if (items != 2)
787
       croak_xs_usage(cv,  "field, default_value");
788
    {
789
        Purple__Request__Field        field = purple_perl_ref_object(ST(0))
790
;
791
        int        default_value = (int)SvIV(ST(1))
792
;
793

    
794
        purple_request_field_choice_set_default_value(field, default_value);
795
    }
796
    XSRETURN_EMPTY;
797
}
798

    
799

    
800
XS_EUPXS(XS_Purple__Request__Field_choice_set_value); /* prototype to pass -Wmissing-prototypes */
801
XS_EUPXS(XS_Purple__Request__Field_choice_set_value)
802
{
803
    dVAR; dXSARGS;
804
    if (items != 2)
805
       croak_xs_usage(cv,  "field, value");
806
    {
807
        Purple__Request__Field        field = purple_perl_ref_object(ST(0))
808
;
809
        int        value = (int)SvIV(ST(1))
810
;
811

    
812
        purple_request_field_choice_set_value(field, value);
813
    }
814
    XSRETURN_EMPTY;
815
}
816

    
817

    
818
XS_EUPXS(XS_Purple__Request__Field_int_new); /* prototype to pass -Wmissing-prototypes */
819
XS_EUPXS(XS_Purple__Request__Field_int_new)
820
{
821
    dVAR; dXSARGS;
822
    if (items < 3 || items > 4)
823
       croak_xs_usage(cv,  "clas, id, text, default_value = 0");
824
    {
825
        const char *        id = (const char *)SvPV_nolen(ST(1))
826
;
827
        const char *        text = (const char *)SvPV_nolen(ST(2))
828
;
829
        int        default_value;
830
        Purple__Request__Field        RETVAL;
831

    
832
        if (items < 4)
833
            default_value = 0;
834
        else {
835
            default_value = (int)SvIV(ST(3))
836
;
837
        }
838

    
839
        RETVAL = purple_request_field_int_new(id, text, default_value);
840
        ST(0) = purple_perl_bless_object(RETVAL, "Purple::Request::Field");
841
        sv_2mortal(ST(0));
842
    }
843
    XSRETURN(1);
844
}
845

    
846

    
847
XS_EUPXS(XS_Purple__Request__Field_int_get_default_value); /* prototype to pass -Wmissing-prototypes */
848
XS_EUPXS(XS_Purple__Request__Field_int_get_default_value)
849
{
850
    dVAR; dXSARGS;
851
    if (items != 1)
852
       croak_xs_usage(cv,  "field");
853
    {
854
        Purple__Request__Field        field = purple_perl_ref_object(ST(0))
855
;
856
        int        RETVAL;
857
        dXSTARG;
858

    
859
        RETVAL = purple_request_field_int_get_default_value(field);
860
        XSprePUSH; PUSHi((IV)RETVAL);
861
    }
862
    XSRETURN(1);
863
}
864

    
865

    
866
XS_EUPXS(XS_Purple__Request__Field_int_get_value); /* prototype to pass -Wmissing-prototypes */
867
XS_EUPXS(XS_Purple__Request__Field_int_get_value)
868
{
869
    dVAR; dXSARGS;
870
    if (items != 1)
871
       croak_xs_usage(cv,  "field");
872
    {
873
        Purple__Request__Field        field = purple_perl_ref_object(ST(0))
874
;
875
        int        RETVAL;
876
        dXSTARG;
877

    
878
        RETVAL = purple_request_field_int_get_value(field);
879
        XSprePUSH; PUSHi((IV)RETVAL);
880
    }
881
    XSRETURN(1);
882
}
883

    
884

    
885
XS_EUPXS(XS_Purple__Request__Field_int_set_default_value); /* prototype to pass -Wmissing-prototypes */
886
XS_EUPXS(XS_Purple__Request__Field_int_set_default_value)
887
{
888
    dVAR; dXSARGS;
889
    if (items != 2)
890
       croak_xs_usage(cv,  "field, default_value");
891
    {
892
        Purple__Request__Field        field = purple_perl_ref_object(ST(0))
893
;
894
        int        default_value = (int)SvIV(ST(1))
895
;
896

    
897
        purple_request_field_int_set_default_value(field, default_value);
898
    }
899
    XSRETURN_EMPTY;
900
}
901

    
902

    
903
XS_EUPXS(XS_Purple__Request__Field_int_set_value); /* prototype to pass -Wmissing-prototypes */
904
XS_EUPXS(XS_Purple__Request__Field_int_set_value)
905
{
906
    dVAR; dXSARGS;
907
    if (items != 2)
908
       croak_xs_usage(cv,  "field, value");
909
    {
910
        Purple__Request__Field        field = purple_perl_ref_object(ST(0))
911
;
912
        int        value = (int)SvIV(ST(1))
913
;
914

    
915
        purple_request_field_int_set_value(field, value);
916
    }
917
    XSRETURN_EMPTY;
918
}
919

    
920

    
921
XS_EUPXS(XS_Purple__Request__Field_is_required); /* prototype to pass -Wmissing-prototypes */
922
XS_EUPXS(XS_Purple__Request__Field_is_required)
923
{
924
    dVAR; dXSARGS;
925
    if (items != 1)
926
       croak_xs_usage(cv,  "field");
927
    {
928
        Purple__Request__Field        field = purple_perl_ref_object(ST(0))
929
;
930
        gboolean        RETVAL;
931

    
932
        RETVAL = purple_request_field_is_required(field);
933
        ST(0) = sv_newmortal();
934
        ST(0) = boolSV(RETVAL);
935
    }
936
    XSRETURN(1);
937
}
938

    
939

    
940
XS_EUPXS(XS_Purple__Request__Field_label_new); /* prototype to pass -Wmissing-prototypes */
941
XS_EUPXS(XS_Purple__Request__Field_label_new)
942
{
943
    dVAR; dXSARGS;
944
    if (items != 3)
945
       croak_xs_usage(cv,  "class, id, text");
946
    {
947
        const char *        id = (const char *)SvPV_nolen(ST(1))
948
;
949
        const char *        text = (const char *)SvPV_nolen(ST(2))
950
;
951
        Purple__Request__Field        RETVAL;
952

    
953
        RETVAL = purple_request_field_label_new(id, text);
954
        ST(0) = purple_perl_bless_object(RETVAL, "Purple::Request::Field");
955
        sv_2mortal(ST(0));
956
    }
957
    XSRETURN(1);
958
}
959

    
960

    
961
XS_EUPXS(XS_Purple__Request__Field_list_new); /* prototype to pass -Wmissing-prototypes */
962
XS_EUPXS(XS_Purple__Request__Field_list_new)
963
{
964
    dVAR; dXSARGS;
965
    if (items != 3)
966
       croak_xs_usage(cv,  "class, id, text");
967
    {
968
        const char *        id = (const char *)SvPV_nolen(ST(1))
969
;
970
        const char *        text = (const char *)SvPV_nolen(ST(2))
971
;
972
        Purple__Request__Field        RETVAL;
973

    
974
        RETVAL = purple_request_field_list_new(id, text);
975
        ST(0) = purple_perl_bless_object(RETVAL, "Purple::Request::Field");
976
        sv_2mortal(ST(0));
977
    }
978
    XSRETURN(1);
979
}
980

    
981

    
982
XS_EUPXS(XS_Purple__Request__Field_list_add); /* prototype to pass -Wmissing-prototypes */
983
XS_EUPXS(XS_Purple__Request__Field_list_add)
984
{
985
    dVAR; dXSARGS;
986
    if (items != 3)
987
       croak_xs_usage(cv,  "field, item, data");
988
    {
989
        Purple__Request__Field        field = purple_perl_ref_object(ST(0))
990
;
991
        const char *        item = (const char *)SvPV_nolen(ST(1))
992
;
993
        void *        data = INT2PTR(void *,SvIV(ST(2)))
994
;
995

    
996
        purple_request_field_list_add(field, item, data);
997
    }
998
    XSRETURN_EMPTY;
999
}
1000

    
1001

    
1002
XS_EUPXS(XS_Purple__Request__Field_list_add_icon); /* prototype to pass -Wmissing-prototypes */
1003
XS_EUPXS(XS_Purple__Request__Field_list_add_icon)
1004
{
1005
    dVAR; dXSARGS;
1006
    if (items != 4)
1007
       croak_xs_usage(cv,  "field, item, icon_path, data");
1008
    {
1009
        Purple__Request__Field        field = purple_perl_ref_object(ST(0))
1010
;
1011
        const char *        item = (const char *)SvPV_nolen(ST(1))
1012
;
1013
        const char *        icon_path = (const char *)SvPV_nolen(ST(2))
1014
;
1015
        void *        data = INT2PTR(void *,SvIV(ST(3)))
1016
;
1017

    
1018
        purple_request_field_list_add_icon(field, item, icon_path, data);
1019
    }
1020
    XSRETURN_EMPTY;
1021
}
1022

    
1023

    
1024
XS_EUPXS(XS_Purple__Request__Field_list_add_selected); /* prototype to pass -Wmissing-prototypes */
1025
XS_EUPXS(XS_Purple__Request__Field_list_add_selected)
1026
{
1027
    dVAR; dXSARGS;
1028
    if (items != 2)
1029
       croak_xs_usage(cv,  "field, item");
1030
    {
1031
        Purple__Request__Field        field = purple_perl_ref_object(ST(0))
1032
;
1033
        const char *        item = (const char *)SvPV_nolen(ST(1))
1034
;
1035

    
1036
        purple_request_field_list_add_selected(field, item);
1037
    }
1038
    XSRETURN_EMPTY;
1039
}
1040

    
1041

    
1042
XS_EUPXS(XS_Purple__Request__Field_list_clear_selected); /* prototype to pass -Wmissing-prototypes */
1043
XS_EUPXS(XS_Purple__Request__Field_list_clear_selected)
1044
{
1045
    dVAR; dXSARGS;
1046
    if (items != 1)
1047
       croak_xs_usage(cv,  "field");
1048
    {
1049
        Purple__Request__Field        field = purple_perl_ref_object(ST(0))
1050
;
1051

    
1052
        purple_request_field_list_clear_selected(field);
1053
    }
1054
    XSRETURN_EMPTY;
1055
}
1056

    
1057

    
1058
XS_EUPXS(XS_Purple__Request__Field_list_get_data); /* prototype to pass -Wmissing-prototypes */
1059
XS_EUPXS(XS_Purple__Request__Field_list_get_data)
1060
{
1061
    dVAR; dXSARGS;
1062
    if (items != 2)
1063
       croak_xs_usage(cv,  "field, text");
1064
    {
1065
        Purple__Request__Field        field = purple_perl_ref_object(ST(0))
1066
;
1067
        const char *        text = (const char *)SvPV_nolen(ST(1))
1068
;
1069
        void *        RETVAL;
1070
        dXSTARG;
1071

    
1072
        RETVAL = purple_request_field_list_get_data(field, text);
1073
        XSprePUSH; PUSHi(PTR2IV(RETVAL));
1074
    }
1075
    XSRETURN(1);
1076
}
1077

    
1078

    
1079
XS_EUPXS(XS_Purple__Request__Field_list_get_items); /* prototype to pass -Wmissing-prototypes */
1080
XS_EUPXS(XS_Purple__Request__Field_list_get_items)
1081
{
1082
    dVAR; dXSARGS;
1083
    if (items != 1)
1084
       croak_xs_usage(cv,  "field");
1085
    PERL_UNUSED_VAR(ax); /* -Wall */
1086
    SP -= items;
1087
    {
1088
        Purple__Request__Field        field = purple_perl_ref_object(ST(0))
1089
;
1090
#line 407 "Request.xs"
1091
        GList *l;
1092
#line 1093 "Request.c"
1093
#line 409 "Request.xs"
1094
        for (l = purple_request_field_list_get_items(field); l != NULL; l = l->next) {
1095
                XPUSHs(sv_2mortal(newSVpv(l->data, 0)));
1096
        }
1097
#line 1098 "Request.c"
1098
        PUTBACK;
1099
        return;
1100
    }
1101
}
1102

    
1103

    
1104
XS_EUPXS(XS_Purple__Request__Field_list_get_multi_select); /* prototype to pass -Wmissing-prototypes */
1105
XS_EUPXS(XS_Purple__Request__Field_list_get_multi_select)
1106
{
1107
    dVAR; dXSARGS;
1108
    if (items != 1)
1109
       croak_xs_usage(cv,  "field");
1110
    {
1111
        Purple__Request__Field        field = purple_perl_ref_object(ST(0))
1112
;
1113
        gboolean        RETVAL;
1114

    
1115
        RETVAL = purple_request_field_list_get_multi_select(field);
1116
        ST(0) = sv_newmortal();
1117
        ST(0) = boolSV(RETVAL);
1118
    }
1119
    XSRETURN(1);
1120
}
1121

    
1122

    
1123
XS_EUPXS(XS_Purple__Request__Field_list_get_selected); /* prototype to pass -Wmissing-prototypes */
1124
XS_EUPXS(XS_Purple__Request__Field_list_get_selected)
1125
{
1126
    dVAR; dXSARGS;
1127
    if (items != 1)
1128
       croak_xs_usage(cv,  "field");
1129
    PERL_UNUSED_VAR(ax); /* -Wall */
1130
    SP -= items;
1131
    {
1132
        Purple__Request__Field        field = purple_perl_ref_object(ST(0))
1133
;
1134
#line 421 "Request.xs"
1135
        GList *l;
1136
#line 1137 "Request.c"
1137
#line 423 "Request.xs"
1138
        for (l = purple_request_field_list_get_selected(field); l != NULL; l = l->next) {
1139
                XPUSHs(sv_2mortal(newSVpv(l->data, 0)));
1140
        }
1141
#line 1142 "Request.c"
1142
        PUTBACK;
1143
        return;
1144
    }
1145
}
1146

    
1147

    
1148
XS_EUPXS(XS_Purple__Request__Field_list_is_selected); /* prototype to pass -Wmissing-prototypes */
1149
XS_EUPXS(XS_Purple__Request__Field_list_is_selected)
1150
{
1151
    dVAR; dXSARGS;
1152
    if (items != 2)
1153
       croak_xs_usage(cv,  "field, item");
1154
    {
1155
        Purple__Request__Field        field = purple_perl_ref_object(ST(0))
1156
;
1157
        const char *        item = (const char *)SvPV_nolen(ST(1))
1158
;
1159
        gboolean        RETVAL;
1160

    
1161
        RETVAL = purple_request_field_list_is_selected(field, item);
1162
        ST(0) = sv_newmortal();
1163
        ST(0) = boolSV(RETVAL);
1164
    }
1165
    XSRETURN(1);
1166
}
1167

    
1168

    
1169
XS_EUPXS(XS_Purple__Request__Field_list_set_multi_select); /* prototype to pass -Wmissing-prototypes */
1170
XS_EUPXS(XS_Purple__Request__Field_list_set_multi_select)
1171
{
1172
    dVAR; dXSARGS;
1173
    if (items != 2)
1174
       croak_xs_usage(cv,  "field, multi_select");
1175
    {
1176
        Purple__Request__Field        field = purple_perl_ref_object(ST(0))
1177
;
1178
        gboolean        multi_select = (bool)SvTRUE(ST(1))
1179
;
1180

    
1181
        purple_request_field_list_set_multi_select(field, multi_select);
1182
    }
1183
    XSRETURN_EMPTY;
1184
}
1185

    
1186

    
1187
XS_EUPXS(XS_Purple__Request__Field_new); /* prototype to pass -Wmissing-prototypes */
1188
XS_EUPXS(XS_Purple__Request__Field_new)
1189
{
1190
    dVAR; dXSARGS;
1191
    if (items != 4)
1192
       croak_xs_usage(cv,  "class, id, text, type");
1193
    {
1194
        const char *        id = (const char *)SvPV_nolen(ST(1))
1195
;
1196
        const char *        text = (const char *)SvPV_nolen(ST(2))
1197
;
1198
        Purple__RequestFieldType        type = (Purple__RequestFieldType)SvIV(ST(3))
1199
;
1200
        Purple__Request__Field        RETVAL;
1201

    
1202
        RETVAL = purple_request_field_new(id, text, type);
1203
        ST(0) = purple_perl_bless_object(RETVAL, "Purple::Request::Field");
1204
        sv_2mortal(ST(0));
1205
    }
1206
    XSRETURN(1);
1207
}
1208

    
1209

    
1210
XS_EUPXS(XS_Purple__Request__Field_set_label); /* prototype to pass -Wmissing-prototypes */
1211
XS_EUPXS(XS_Purple__Request__Field_set_label)
1212
{
1213
    dVAR; dXSARGS;
1214
    if (items != 2)
1215
       croak_xs_usage(cv,  "field, label");
1216
    {
1217
        Purple__Request__Field        field = purple_perl_ref_object(ST(0))
1218
;
1219
        const char *        label = (const char *)SvPV_nolen(ST(1))
1220
;
1221

    
1222
        purple_request_field_set_label(field, label);
1223
    }
1224
    XSRETURN_EMPTY;
1225
}
1226

    
1227

    
1228
XS_EUPXS(XS_Purple__Request__Field_set_required); /* prototype to pass -Wmissing-prototypes */
1229
XS_EUPXS(XS_Purple__Request__Field_set_required)
1230
{
1231
    dVAR; dXSARGS;
1232
    if (items != 2)
1233
       croak_xs_usage(cv,  "field, required");
1234
    {
1235
        Purple__Request__Field        field = purple_perl_ref_object(ST(0))
1236
;
1237
        gboolean        required = (bool)SvTRUE(ST(1))
1238
;
1239

    
1240
        purple_request_field_set_required(field, required);
1241
    }
1242
    XSRETURN_EMPTY;
1243
}
1244

    
1245

    
1246
XS_EUPXS(XS_Purple__Request__Field_set_type_hint); /* prototype to pass -Wmissing-prototypes */
1247
XS_EUPXS(XS_Purple__Request__Field_set_type_hint)
1248
{
1249
    dVAR; dXSARGS;
1250
    if (items != 2)
1251
       croak_xs_usage(cv,  "field, type_hint");
1252
    {
1253
        Purple__Request__Field        field = purple_perl_ref_object(ST(0))
1254
;
1255
        const char *        type_hint = (const char *)SvPV_nolen(ST(1))
1256
;
1257

    
1258
        purple_request_field_set_type_hint(field, type_hint);
1259
    }
1260
    XSRETURN_EMPTY;
1261
}
1262

    
1263

    
1264
XS_EUPXS(XS_Purple__Request__Field_set_visible); /* prototype to pass -Wmissing-prototypes */
1265
XS_EUPXS(XS_Purple__Request__Field_set_visible)
1266
{
1267
    dVAR; dXSARGS;
1268
    if (items != 2)
1269
       croak_xs_usage(cv,  "field, visible");
1270
    {
1271
        Purple__Request__Field        field = purple_perl_ref_object(ST(0))
1272
;
1273
        gboolean        visible = (bool)SvTRUE(ST(1))
1274
;
1275

    
1276
        purple_request_field_set_visible(field, visible);
1277
    }
1278
    XSRETURN_EMPTY;
1279
}
1280

    
1281

    
1282
XS_EUPXS(XS_Purple__Request__Field_string_new); /* prototype to pass -Wmissing-prototypes */
1283
XS_EUPXS(XS_Purple__Request__Field_string_new)
1284
{
1285
    dVAR; dXSARGS;
1286
    if (items != 5)
1287
       croak_xs_usage(cv,  "class, id, text, default_value, multiline");
1288
    {
1289
        const char *        id = (const char *)SvPV_nolen(ST(1))
1290
;
1291
        const char *        text = (const char *)SvPV_nolen(ST(2))
1292
;
1293
        const char *        default_value = (const char *)SvPV_nolen(ST(3))
1294
;
1295
        gboolean        multiline = (bool)SvTRUE(ST(4))
1296
;
1297
        Purple__Request__Field        RETVAL;
1298

    
1299
        RETVAL = purple_request_field_string_new(id, text, default_value, multiline);
1300
        ST(0) = purple_perl_bless_object(RETVAL, "Purple::Request::Field");
1301
        sv_2mortal(ST(0));
1302
    }
1303
    XSRETURN(1);
1304
}
1305

    
1306

    
1307
XS_EUPXS(XS_Purple__Request__Field_string_get_default_value); /* prototype to pass -Wmissing-prototypes */
1308
XS_EUPXS(XS_Purple__Request__Field_string_get_default_value)
1309
{
1310
    dVAR; dXSARGS;
1311
    if (items != 1)
1312
       croak_xs_usage(cv,  "field");
1313
    {
1314
        Purple__Request__Field        field = purple_perl_ref_object(ST(0))
1315
;
1316
        const char *        RETVAL;
1317
        dXSTARG;
1318

    
1319
        RETVAL = purple_request_field_string_get_default_value(field);
1320
        sv_setpv(TARG, RETVAL); XSprePUSH; PUSHTARG;
1321
    }
1322
    XSRETURN(1);
1323
}
1324

    
1325

    
1326
XS_EUPXS(XS_Purple__Request__Field_string_get_value); /* prototype to pass -Wmissing-prototypes */
1327
XS_EUPXS(XS_Purple__Request__Field_string_get_value)
1328
{
1329
    dVAR; dXSARGS;
1330
    if (items != 1)
1331
       croak_xs_usage(cv,  "field");
1332
    {
1333
        Purple__Request__Field        field = purple_perl_ref_object(ST(0))
1334
;
1335
        const char *        RETVAL;
1336
        dXSTARG;
1337

    
1338
        RETVAL = purple_request_field_string_get_value(field);
1339
        sv_setpv(TARG, RETVAL); XSprePUSH; PUSHTARG;
1340
    }
1341
    XSRETURN(1);
1342
}
1343

    
1344

    
1345
XS_EUPXS(XS_Purple__Request__Field_string_is_editable); /* prototype to pass -Wmissing-prototypes */
1346
XS_EUPXS(XS_Purple__Request__Field_string_is_editable)
1347
{
1348
    dVAR; dXSARGS;
1349
    if (items != 1)
1350
       croak_xs_usage(cv,  "field");
1351
    {
1352
        Purple__Request__Field        field = purple_perl_ref_object(ST(0))
1353
;
1354
        gboolean        RETVAL;
1355

    
1356
        RETVAL = purple_request_field_string_is_editable(field);
1357
        ST(0) = sv_newmortal();
1358
        ST(0) = boolSV(RETVAL);
1359
    }
1360
    XSRETURN(1);
1361
}
1362

    
1363

    
1364
XS_EUPXS(XS_Purple__Request__Field_string_is_masked); /* prototype to pass -Wmissing-prototypes */
1365
XS_EUPXS(XS_Purple__Request__Field_string_is_masked)
1366
{
1367
    dVAR; dXSARGS;
1368
    if (items != 1)
1369
       croak_xs_usage(cv,  "field");
1370
    {
1371
        Purple__Request__Field        field = purple_perl_ref_object(ST(0))
1372
;
1373
        gboolean        RETVAL;
1374

    
1375
        RETVAL = purple_request_field_string_is_masked(field);
1376
        ST(0) = sv_newmortal();
1377
        ST(0) = boolSV(RETVAL);
1378
    }
1379
    XSRETURN(1);
1380
}
1381

    
1382

    
1383
XS_EUPXS(XS_Purple__Request__Field_string_is_multiline); /* prototype to pass -Wmissing-prototypes */
1384
XS_EUPXS(XS_Purple__Request__Field_string_is_multiline)
1385
{
1386
    dVAR; dXSARGS;
1387
    if (items != 1)
1388
       croak_xs_usage(cv,  "field");
1389
    {
1390
        Purple__Request__Field        field = purple_perl_ref_object(ST(0))
1391
;
1392
        gboolean        RETVAL;
1393

    
1394
        RETVAL = purple_request_field_string_is_multiline(field);
1395
        ST(0) = sv_newmortal();
1396
        ST(0) = boolSV(RETVAL);
1397
    }
1398
    XSRETURN(1);
1399
}
1400

    
1401

    
1402
XS_EUPXS(XS_Purple__Request__Field_string_set_default_value); /* prototype to pass -Wmissing-prototypes */
1403
XS_EUPXS(XS_Purple__Request__Field_string_set_default_value)
1404
{
1405
    dVAR; dXSARGS;
1406
    if (items != 2)
1407
       croak_xs_usage(cv,  "field, default_value");
1408
    {
1409
        Purple__Request__Field        field = purple_perl_ref_object(ST(0))
1410
;
1411
        const char *        default_value = (const char *)SvPV_nolen(ST(1))
1412
;
1413

    
1414
        purple_request_field_string_set_default_value(field, default_value);
1415
    }
1416
    XSRETURN_EMPTY;
1417
}
1418

    
1419

    
1420
XS_EUPXS(XS_Purple__Request__Field_string_set_editable); /* prototype to pass -Wmissing-prototypes */
1421
XS_EUPXS(XS_Purple__Request__Field_string_set_editable)
1422
{
1423
    dVAR; dXSARGS;
1424
    if (items != 2)
1425
       croak_xs_usage(cv,  "field, editable");
1426
    {
1427
        Purple__Request__Field        field = purple_perl_ref_object(ST(0))
1428
;
1429
        gboolean        editable = (bool)SvTRUE(ST(1))
1430
;
1431

    
1432
        purple_request_field_string_set_editable(field, editable);
1433
    }
1434
    XSRETURN_EMPTY;
1435
}
1436

    
1437

    
1438
XS_EUPXS(XS_Purple__Request__Field_string_set_masked); /* prototype to pass -Wmissing-prototypes */
1439
XS_EUPXS(XS_Purple__Request__Field_string_set_masked)
1440
{
1441
    dVAR; dXSARGS;
1442
    if (items != 2)
1443
       croak_xs_usage(cv,  "field, masked");
1444
    {
1445
        Purple__Request__Field        field = purple_perl_ref_object(ST(0))
1446
;
1447
        gboolean        masked = (bool)SvTRUE(ST(1))
1448
;
1449

    
1450
        purple_request_field_string_set_masked(field, masked);
1451
    }
1452
    XSRETURN_EMPTY;
1453
}
1454

    
1455

    
1456
XS_EUPXS(XS_Purple__Request__Field_string_set_value); /* prototype to pass -Wmissing-prototypes */
1457
XS_EUPXS(XS_Purple__Request__Field_string_set_value)
1458
{
1459
    dVAR; dXSARGS;
1460
    if (items != 2)
1461
       croak_xs_usage(cv,  "field, value");
1462
    {
1463
        Purple__Request__Field        field = purple_perl_ref_object(ST(0))
1464
;
1465
        const char *        value = (const char *)SvPV_nolen(ST(1))
1466
;
1467

    
1468
        purple_request_field_string_set_value(field, value);
1469
    }
1470
    XSRETURN_EMPTY;
1471
}
1472

    
1473

    
1474
XS_EUPXS(XS_Purple__Request__Field__Group_add_field); /* prototype to pass -Wmissing-prototypes */
1475
XS_EUPXS(XS_Purple__Request__Field__Group_add_field)
1476
{
1477
    dVAR; dXSARGS;
1478
    if (items != 2)
1479
       croak_xs_usage(cv,  "group, field");
1480
    {
1481
        Purple__Request__Field__Group        group = purple_perl_ref_object(ST(0))
1482
;
1483
        Purple__Request__Field        field = purple_perl_ref_object(ST(1))
1484
;
1485

    
1486
        purple_request_field_group_add_field(group, field);
1487
    }
1488
    XSRETURN_EMPTY;
1489
}
1490

    
1491

    
1492
XS_EUPXS(XS_Purple__Request__Field__Group_destroy); /* prototype to pass -Wmissing-prototypes */
1493
XS_EUPXS(XS_Purple__Request__Field__Group_destroy)
1494
{
1495
    dVAR; dXSARGS;
1496
    if (items != 1)
1497
       croak_xs_usage(cv,  "group");
1498
    {
1499
        Purple__Request__Field__Group        group = purple_perl_ref_object(ST(0))
1500
;
1501

    
1502
        purple_request_field_group_destroy(group);
1503
    }
1504
    XSRETURN_EMPTY;
1505
}
1506

    
1507

    
1508
XS_EUPXS(XS_Purple__Request__Field__Group_get_fields); /* prototype to pass -Wmissing-prototypes */
1509
XS_EUPXS(XS_Purple__Request__Field__Group_get_fields)
1510
{
1511
    dVAR; dXSARGS;
1512
    if (items != 1)
1513
       croak_xs_usage(cv,  "group");
1514
    PERL_UNUSED_VAR(ax); /* -Wall */
1515
    SP -= items;
1516
    {
1517
        Purple__Request__Field__Group        group = purple_perl_ref_object(ST(0))
1518
;
1519
#line 534 "Request.xs"
1520
        GList *l;
1521
#line 1522 "Request.c"
1522
#line 536 "Request.xs"
1523
        for (l = purple_request_field_group_get_fields(group); l != NULL; l = l->next) {
1524
                XPUSHs(sv_2mortal(purple_perl_bless_object(l->data, "Purple::Request::Field")));
1525
        }
1526
#line 1527 "Request.c"
1527
        PUTBACK;
1528
        return;
1529
    }
1530
}
1531

    
1532

    
1533
XS_EUPXS(XS_Purple__Request__Field__Group_get_title); /* prototype to pass -Wmissing-prototypes */
1534
XS_EUPXS(XS_Purple__Request__Field__Group_get_title)
1535
{
1536
    dVAR; dXSARGS;
1537
    if (items != 1)
1538
       croak_xs_usage(cv,  "group");
1539
    {
1540
        Purple__Request__Field__Group        group = purple_perl_ref_object(ST(0))
1541
;
1542
        const char *        RETVAL;
1543
        dXSTARG;
1544

    
1545
        RETVAL = purple_request_field_group_get_title(group);
1546
        sv_setpv(TARG, RETVAL); XSprePUSH; PUSHTARG;
1547
    }
1548
    XSRETURN(1);
1549
}
1550

    
1551

    
1552
XS_EUPXS(XS_Purple__Request__Field__Group_new); /* prototype to pass -Wmissing-prototypes */
1553
XS_EUPXS(XS_Purple__Request__Field__Group_new)
1554
{
1555
    dVAR; dXSARGS;
1556
    if (items != 2)
1557
       croak_xs_usage(cv,  "class, title");
1558
    {
1559
        const char *        title = (const char *)SvPV_nolen(ST(1))
1560
;
1561
        Purple__Request__Field__Group        RETVAL;
1562

    
1563
        RETVAL = purple_request_field_group_new(title);
1564
        ST(0) = purple_perl_bless_object(RETVAL, "Purple::Request::Field::Group");
1565
        sv_2mortal(ST(0));
1566
    }
1567
    XSRETURN(1);
1568
}
1569

    
1570

    
1571
XS_EUPXS(XS_Purple__Request__Field_destroy); /* prototype to pass -Wmissing-prototypes */
1572
XS_EUPXS(XS_Purple__Request__Field_destroy)
1573
{
1574
    dVAR; dXSARGS;
1575
    if (items != 1)
1576
       croak_xs_usage(cv,  "field");
1577
    {
1578
        Purple__Request__Field        field = purple_perl_ref_object(ST(0))
1579
;
1580

    
1581
        purple_request_field_destroy(field);
1582
    }
1583
    XSRETURN_EMPTY;
1584
}
1585

    
1586

    
1587
XS_EUPXS(XS_Purple__Request__Field_get_id); /* prototype to pass -Wmissing-prototypes */
1588
XS_EUPXS(XS_Purple__Request__Field_get_id)
1589
{
1590
    dVAR; dXSARGS;
1591
    if (items != 1)
1592
       croak_xs_usage(cv,  "field");
1593
    {
1594
        Purple__Request__Field        field = purple_perl_ref_object(ST(0))
1595
;
1596
        const char *        RETVAL;
1597
        dXSTARG;
1598

    
1599
        RETVAL = purple_request_field_get_id(field);
1600
        sv_setpv(TARG, RETVAL); XSprePUSH; PUSHTARG;
1601
    }
1602
    XSRETURN(1);
1603
}
1604

    
1605

    
1606
XS_EUPXS(XS_Purple__Request__Field_get_label); /* prototype to pass -Wmissing-prototypes */
1607
XS_EUPXS(XS_Purple__Request__Field_get_label)
1608
{
1609
    dVAR; dXSARGS;
1610
    if (items != 1)
1611
       croak_xs_usage(cv,  "field");
1612
    {
1613
        Purple__Request__Field        field = purple_perl_ref_object(ST(0))
1614
;
1615
        const char *        RETVAL;
1616
        dXSTARG;
1617

    
1618
        RETVAL = purple_request_field_get_label(field);
1619
        sv_setpv(TARG, RETVAL); XSprePUSH; PUSHTARG;
1620
    }
1621
    XSRETURN(1);
1622
}
1623

    
1624

    
1625
XS_EUPXS(XS_Purple__Request__Field_get_type); /* prototype to pass -Wmissing-prototypes */
1626
XS_EUPXS(XS_Purple__Request__Field_get_type)
1627
{
1628
    dVAR; dXSARGS;
1629
    if (items != 1)
1630
       croak_xs_usage(cv,  "field");
1631
    {
1632
        Purple__Request__Field        field = purple_perl_ref_object(ST(0))
1633
;
1634
        Purple__RequestFieldType        RETVAL;
1635
        dXSTARG;
1636

    
1637
        RETVAL = purple_request_field_get_type(field);
1638
        XSprePUSH; PUSHi((IV)RETVAL);
1639
    }
1640
    XSRETURN(1);
1641
}
1642

    
1643

    
1644
XS_EUPXS(XS_Purple__Request__Field_get_type_hint); /* prototype to pass -Wmissing-prototypes */
1645
XS_EUPXS(XS_Purple__Request__Field_get_type_hint)
1646
{
1647
    dVAR; dXSARGS;
1648
    if (items != 1)
1649
       croak_xs_usage(cv,  "field");
1650
    {
1651
        Purple__Request__Field        field = purple_perl_ref_object(ST(0))
1652
;
1653
        const char *        RETVAL;
1654
        dXSTARG;
1655

    
1656
        RETVAL = purple_request_field_get_type_hint(field);
1657
        sv_setpv(TARG, RETVAL); XSprePUSH; PUSHTARG;
1658
    }
1659
    XSRETURN(1);
1660
}
1661

    
1662

    
1663
XS_EUPXS(XS_Purple__Request__Field_is_visible); /* prototype to pass -Wmissing-prototypes */
1664
XS_EUPXS(XS_Purple__Request__Field_is_visible)
1665
{
1666
    dVAR; dXSARGS;
1667
    if (items != 1)
1668
       croak_xs_usage(cv,  "field");
1669
    {
1670
        Purple__Request__Field        field = purple_perl_ref_object(ST(0))
1671
;
1672
        gboolean        RETVAL;
1673

    
1674
        RETVAL = purple_request_field_is_visible(field);
1675
        ST(0) = sv_newmortal();
1676
        ST(0) = boolSV(RETVAL);
1677
    }
1678
    XSRETURN(1);
1679
}
1680

    
1681

    
1682
XS_EUPXS(XS_Purple__Request__Fields_new); /* prototype to pass -Wmissing-prototypes */
1683
XS_EUPXS(XS_Purple__Request__Fields_new)
1684
{
1685
    dVAR; dXSARGS;
1686
    if (items != 1)
1687
       croak_xs_usage(cv,  "class");
1688
    {
1689
        Purple__Request__Fields        RETVAL;
1690

    
1691
        RETVAL = purple_request_fields_new(/* void */);
1692
        ST(0) = purple_perl_bless_object(RETVAL, "Purple::Request::Fields");
1693
        sv_2mortal(ST(0));
1694
    }
1695
    XSRETURN(1);
1696
}
1697

    
1698

    
1699
XS_EUPXS(XS_Purple__Request__Fields_add_group); /* prototype to pass -Wmissing-prototypes */
1700
XS_EUPXS(XS_Purple__Request__Fields_add_group)
1701
{
1702
    dVAR; dXSARGS;
1703
    if (items != 2)
1704
       croak_xs_usage(cv,  "fields, group");
1705
    {
1706
        Purple__Request__Fields        fields = purple_perl_ref_object(ST(0))
1707
;
1708
        Purple__Request__Field__Group        group = purple_perl_ref_object(ST(1))
1709
;
1710

    
1711
        purple_request_fields_add_group(fields, group);
1712
    }
1713
    XSRETURN_EMPTY;
1714
}
1715

    
1716

    
1717
XS_EUPXS(XS_Purple__Request__Fields_all_required_filled); /* prototype to pass -Wmissing-prototypes */
1718
XS_EUPXS(XS_Purple__Request__Fields_all_required_filled)
1719
{
1720
    dVAR; dXSARGS;
1721
    if (items != 1)
1722
       croak_xs_usage(cv,  "fields");
1723
    {
1724
        Purple__Request__Fields        fields = purple_perl_ref_object(ST(0))
1725
;
1726
        gboolean        RETVAL;
1727

    
1728
        RETVAL = purple_request_fields_all_required_filled(fields);
1729
        ST(0) = sv_newmortal();
1730
        ST(0) = boolSV(RETVAL);
1731
    }
1732
    XSRETURN(1);
1733
}
1734

    
1735

    
1736
XS_EUPXS(XS_Purple__Request__Fields_destroy); /* prototype to pass -Wmissing-prototypes */
1737
XS_EUPXS(XS_Purple__Request__Fields_destroy)
1738
{
1739
    dVAR; dXSARGS;
1740
    if (items != 1)
1741
       croak_xs_usage(cv,  "fields");
1742
    {
1743
        Purple__Request__Fields        fields = purple_perl_ref_object(ST(0))
1744
;
1745

    
1746
        purple_request_fields_destroy(fields);
1747
    }
1748
    XSRETURN_EMPTY;
1749
}
1750

    
1751

    
1752
XS_EUPXS(XS_Purple__Request__Fields_exists); /* prototype to pass -Wmissing-prototypes */
1753
XS_EUPXS(XS_Purple__Request__Fields_exists)
1754
{
1755
    dVAR; dXSARGS;
1756
    if (items != 2)
1757
       croak_xs_usage(cv,  "fields, id");
1758
    {
1759
        Purple__Request__Fields        fields = purple_perl_ref_object(ST(0))
1760
;
1761
        const char *        id = (const char *)SvPV_nolen(ST(1))
1762
;
1763
        gboolean        RETVAL;
1764

    
1765
        RETVAL = purple_request_fields_exists(fields, id);
1766
        ST(0) = sv_newmortal();
1767
        ST(0) = boolSV(RETVAL);
1768
    }
1769
    XSRETURN(1);
1770
}
1771

    
1772

    
1773
XS_EUPXS(XS_Purple__Request__Fields_get_account); /* prototype to pass -Wmissing-prototypes */
1774
XS_EUPXS(XS_Purple__Request__Fields_get_account)
1775
{
1776
    dVAR; dXSARGS;
1777
    if (items != 2)
1778
       croak_xs_usage(cv,  "fields, id");
1779
    {
1780
        Purple__Request__Fields        fields = purple_perl_ref_object(ST(0))
1781
;
1782
        const char *        id = (const char *)SvPV_nolen(ST(1))
1783
;
1784
        Purple__Account        RETVAL;
1785

    
1786
        RETVAL = purple_request_fields_get_account(fields, id);
1787
        ST(0) = purple_perl_bless_object(RETVAL, "Purple::Account");
1788
        sv_2mortal(ST(0));
1789
    }
1790
    XSRETURN(1);
1791
}
1792

    
1793

    
1794
XS_EUPXS(XS_Purple__Request__Fields_get_bool); /* prototype to pass -Wmissing-prototypes */
1795
XS_EUPXS(XS_Purple__Request__Fields_get_bool)
1796
{
1797
    dVAR; dXSARGS;
1798
    if (items != 2)
1799
       croak_xs_usage(cv,  "fields, id");
1800
    {
1801
        Purple__Request__Fields        fields = purple_perl_ref_object(ST(0))
1802
;
1803
        const char *        id = (const char *)SvPV_nolen(ST(1))
1804
;
1805
        gboolean        RETVAL;
1806

    
1807
        RETVAL = purple_request_fields_get_bool(fields, id);
1808
        ST(0) = sv_newmortal();
1809
        ST(0) = boolSV(RETVAL);
1810
    }
1811
    XSRETURN(1);
1812
}
1813

    
1814

    
1815
XS_EUPXS(XS_Purple__Request__Fields_get_choice); /* prototype to pass -Wmissing-prototypes */
1816
XS_EUPXS(XS_Purple__Request__Fields_get_choice)
1817
{
1818
    dVAR; dXSARGS;
1819
    if (items != 2)
1820
       croak_xs_usage(cv,  "fields, id");
1821
    {
1822
        Purple__Request__Fields        fields = purple_perl_ref_object(ST(0))
1823
;
1824
        const char *        id = (const char *)SvPV_nolen(ST(1))
1825
;
1826
        int        RETVAL;
1827
        dXSTARG;
1828

    
1829
        RETVAL = purple_request_fields_get_choice(fields, id);
1830
        XSprePUSH; PUSHi((IV)RETVAL);
1831
    }
1832
    XSRETURN(1);
1833
}
1834

    
1835

    
1836
XS_EUPXS(XS_Purple__Request__Fields_get_field); /* prototype to pass -Wmissing-prototypes */
1837
XS_EUPXS(XS_Purple__Request__Fields_get_field)
1838
{
1839
    dVAR; dXSARGS;
1840
    if (items != 2)
1841
       croak_xs_usage(cv,  "fields, id");
1842
    {
1843
        Purple__Request__Fields        fields = purple_perl_ref_object(ST(0))
1844
;
1845
        const char *        id = (const char *)SvPV_nolen(ST(1))
1846
;
1847
        Purple__Request__Field        RETVAL;
1848

    
1849
        RETVAL = purple_request_fields_get_field(fields, id);
1850
        ST(0) = purple_perl_bless_object(RETVAL, "Purple::Request::Field");
1851
        sv_2mortal(ST(0));
1852
    }
1853
    XSRETURN(1);
1854
}
1855

    
1856

    
1857
XS_EUPXS(XS_Purple__Request__Fields_get_groups); /* prototype to pass -Wmissing-prototypes */
1858
XS_EUPXS(XS_Purple__Request__Fields_get_groups)
1859
{
1860
    dVAR; dXSARGS;
1861
    if (items != 1)
1862
       croak_xs_usage(cv,  "fields");
1863
    PERL_UNUSED_VAR(ax); /* -Wall */
1864
    SP -= items;
1865
    {
1866
        Purple__Request__Fields        fields = purple_perl_ref_object(ST(0))
1867
;
1868
#line 625 "Request.xs"
1869
        GList *l;
1870
#line 1871 "Request.c"
1871
#line 627 "Request.xs"
1872
        for (l = purple_request_fields_get_groups(fields); l != NULL; l = l->next) {
1873
                XPUSHs(sv_2mortal(purple_perl_bless_object(l->data, "Purple::Request::Field::Group")));
1874
        }
1875
#line 1876 "Request.c"
1876
        PUTBACK;
1877
        return;
1878
    }
1879
}
1880

    
1881

    
1882
XS_EUPXS(XS_Purple__Request__Fields_get_integer); /* prototype to pass -Wmissing-prototypes */
1883
XS_EUPXS(XS_Purple__Request__Fields_get_integer)
1884
{
1885
    dVAR; dXSARGS;
1886
    if (items != 2)
1887
       croak_xs_usage(cv,  "fields, id");
1888
    {
1889
        Purple__Request__Fields        fields = purple_perl_ref_object(ST(0))
1890
;
1891
        const char *        id = (const char *)SvPV_nolen(ST(1))
1892
;
1893
        int        RETVAL;
1894
        dXSTARG;
1895

    
1896
        RETVAL = purple_request_fields_get_integer(fields, id);
1897
        XSprePUSH; PUSHi((IV)RETVAL);
1898
    }
1899
    XSRETURN(1);
1900
}
1901

    
1902

    
1903
XS_EUPXS(XS_Purple__Request__Fields_get_required); /* prototype to pass -Wmissing-prototypes */
1904
XS_EUPXS(XS_Purple__Request__Fields_get_required)
1905
{
1906
    dVAR; dXSARGS;
1907
    if (items != 1)
1908
       croak_xs_usage(cv,  "fields");
1909
    PERL_UNUSED_VAR(ax); /* -Wall */
1910
    SP -= items;
1911
    {
1912
        Purple__Request__Fields        fields = purple_perl_ref_object(ST(0))
1913
;
1914
#line 640 "Request.xs"
1915
        GList *l;
1916
#line 1917 "Request.c"
1917
#line 642 "Request.xs"
1918
        for (l = purple_request_fields_get_required(fields); l != NULL; l = l->next) {
1919
                XPUSHs(sv_2mortal(purple_perl_bless_object(l->data, "Purple::Request::Field")));
1920
        }
1921
#line 1922 "Request.c"
1922
        PUTBACK;
1923
        return;
1924
    }
1925
}
1926

    
1927

    
1928
XS_EUPXS(XS_Purple__Request__Fields_get_string); /* prototype to pass -Wmissing-prototypes */
1929
XS_EUPXS(XS_Purple__Request__Fields_get_string)
1930
{
1931
    dVAR; dXSARGS;
1932
    if (items != 2)
1933
       croak_xs_usage(cv,  "fields, id");
1934
    {
1935
        Purple__Request__Fields        fields = purple_perl_ref_object(ST(0))
1936
;
1937
        const char *        id = (const char *)SvPV_nolen(ST(1))
1938
;
1939
        const char *        RETVAL;
1940
        dXSTARG;
1941

    
1942
        RETVAL = purple_request_fields_get_string(fields, id);
1943
        sv_setpv(TARG, RETVAL); XSprePUSH; PUSHTARG;
1944
    }
1945
    XSRETURN(1);
1946
}
1947

    
1948

    
1949
XS_EUPXS(XS_Purple__Request__Fields_is_field_required); /* prototype to pass -Wmissing-prototypes */
1950
XS_EUPXS(XS_Purple__Request__Fields_is_field_required)
1951
{
1952
    dVAR; dXSARGS;
1953
    if (items != 2)
1954
       croak_xs_usage(cv,  "fields, id");
1955
    {
1956
        Purple__Request__Fields        fields = purple_perl_ref_object(ST(0))
1957
;
1958
        const char *        id = (const char *)SvPV_nolen(ST(1))
1959
;
1960
        gboolean        RETVAL;
1961

    
1962
        RETVAL = purple_request_fields_is_field_required(fields, id);
1963
        ST(0) = sv_newmortal();
1964
        ST(0) = boolSV(RETVAL);
1965
    }
1966
    XSRETURN(1);
1967
}
1968

    
1969
#ifdef __cplusplus
1970
extern "C"
1971
#endif
1972
XS_EXTERNAL(boot_Purple__Request); /* prototype to pass -Wmissing-prototypes */
1973
XS_EXTERNAL(boot_Purple__Request)
1974
{
1975
    dVAR; dXSARGS;
1976
#if (PERL_REVISION == 5 && PERL_VERSION < 9)
1977
    char* file = __FILE__;
1978
#else
1979
    const char* file = __FILE__;
1980
#endif
1981

    
1982
    PERL_UNUSED_VAR(cv); /* -W */
1983
    PERL_UNUSED_VAR(items); /* -W */
1984
#ifdef XS_APIVERSION_BOOTCHECK
1985
    XS_APIVERSION_BOOTCHECK;
1986
#endif
1987
    XS_VERSION_BOOTCHECK;
1988

    
1989
        (void)newXSproto_portable("Purple::Request::input", XS_Purple__Request_input, file, "$$$$$$$$$$$$");
1990
        (void)newXSproto_portable("Purple::Request::file", XS_Purple__Request_file, file, "$$$$$$");
1991
        (void)newXSproto_portable("Purple::Request::fields", XS_Purple__Request_fields, file, "$$$$$$$$$");
1992
        (void)newXSproto_portable("Purple::Request::close", XS_Purple__Request_close, file, "$$");
1993
        (void)newXSproto_portable("Purple::Request::close_with_handle", XS_Purple__Request_close_with_handle, file, "$");
1994
        (void)newXSproto_portable("Purple::Request::Field::account_new", XS_Purple__Request__Field_account_new, file, "$$$;$");
1995
        (void)newXSproto_portable("Purple::Request::Field::account_get_default_value", XS_Purple__Request__Field_account_get_default_value, file, "$");
1996
        (void)newXSproto_portable("Purple::Request::Field::account_get_filter", XS_Purple__Request__Field_account_get_filter, file, "$");
1997
        (void)newXSproto_portable("Purple::Request::Field::account_get_show_all", XS_Purple__Request__Field_account_get_show_all, file, "$");
1998
        (void)newXSproto_portable("Purple::Request::Field::account_get_value", XS_Purple__Request__Field_account_get_value, file, "$");
1999
        (void)newXSproto_portable("Purple::Request::Field::account_set_default_value", XS_Purple__Request__Field_account_set_default_value, file, "$$");
2000
        (void)newXSproto_portable("Purple::Request::Field::account_set_show_all", XS_Purple__Request__Field_account_set_show_all, file, "$$");
2001
        (void)newXSproto_portable("Purple::Request::Field::account_set_value", XS_Purple__Request__Field_account_set_value, file, "$$");
2002
        (void)newXSproto_portable("Purple::Request::Field::bool_new", XS_Purple__Request__Field_bool_new, file, "$$$;$");
2003
        (void)newXSproto_portable("Purple::Request::Field::bool_get_default_value", XS_Purple__Request__Field_bool_get_default_value, file, "$");
2004
        (void)newXSproto_portable("Purple::Request::Field::bool_get_value", XS_Purple__Request__Field_bool_get_value, file, "$");
2005
        (void)newXSproto_portable("Purple::Request::Field::bool_set_default_value", XS_Purple__Request__Field_bool_set_default_value, file, "$$");
2006
        (void)newXSproto_portable("Purple::Request::Field::bool_set_value", XS_Purple__Request__Field_bool_set_value, file, "$$");
2007
        (void)newXSproto_portable("Purple::Request::Field::choice_new", XS_Purple__Request__Field_choice_new, file, "$$$;$");
2008
        (void)newXSproto_portable("Purple::Request::Field::choice_add", XS_Purple__Request__Field_choice_add, file, "$$");
2009
        (void)newXSproto_portable("Purple::Request::Field::choice_get_default_value", XS_Purple__Request__Field_choice_get_default_value, file, "$");
2010
        (void)newXSproto_portable("Purple::Request::Field::choice_get_labels", XS_Purple__Request__Field_choice_get_labels, file, "$");
2011
        (void)newXSproto_portable("Purple::Request::Field::choice_get_value", XS_Purple__Request__Field_choice_get_value, file, "$");
2012
        (void)newXSproto_portable("Purple::Request::Field::choice_set_default_value", XS_Purple__Request__Field_choice_set_default_value, file, "$$");
2013
        (void)newXSproto_portable("Purple::Request::Field::choice_set_value", XS_Purple__Request__Field_choice_set_value, file, "$$");
2014
        (void)newXSproto_portable("Purple::Request::Field::int_new", XS_Purple__Request__Field_int_new, file, "$$$;$");
2015
        (void)newXSproto_portable("Purple::Request::Field::int_get_default_value", XS_Purple__Request__Field_int_get_default_value, file, "$");
2016
        (void)newXSproto_portable("Purple::Request::Field::int_get_value", XS_Purple__Request__Field_int_get_value, file, "$");
2017
        (void)newXSproto_portable("Purple::Request::Field::int_set_default_value", XS_Purple__Request__Field_int_set_default_value, file, "$$");
2018
        (void)newXSproto_portable("Purple::Request::Field::int_set_value", XS_Purple__Request__Field_int_set_value, file, "$$");
2019
        (void)newXSproto_portable("Purple::Request::Field::is_required", XS_Purple__Request__Field_is_required, file, "$");
2020
        (void)newXSproto_portable("Purple::Request::Field::label_new", XS_Purple__Request__Field_label_new, file, "$$$");
2021
        (void)newXSproto_portable("Purple::Request::Field::list_new", XS_Purple__Request__Field_list_new, file, "$$$");
2022
        (void)newXSproto_portable("Purple::Request::Field::list_add", XS_Purple__Request__Field_list_add, file, "$$$");
2023
        (void)newXSproto_portable("Purple::Request::Field::list_add_icon", XS_Purple__Request__Field_list_add_icon, file, "$$$$");
2024
        (void)newXSproto_portable("Purple::Request::Field::list_add_selected", XS_Purple__Request__Field_list_add_selected, file, "$$");
2025
        (void)newXSproto_portable("Purple::Request::Field::list_clear_selected", XS_Purple__Request__Field_list_clear_selected, file, "$");
2026
        (void)newXSproto_portable("Purple::Request::Field::list_get_data", XS_Purple__Request__Field_list_get_data, file, "$$");
2027
        (void)newXSproto_portable("Purple::Request::Field::list_get_items", XS_Purple__Request__Field_list_get_items, file, "$");
2028
        (void)newXSproto_portable("Purple::Request::Field::list_get_multi_select", XS_Purple__Request__Field_list_get_multi_select, file, "$");
2029
        (void)newXSproto_portable("Purple::Request::Field::list_get_selected", XS_Purple__Request__Field_list_get_selected, file, "$");
2030
        (void)newXSproto_portable("Purple::Request::Field::list_is_selected", XS_Purple__Request__Field_list_is_selected, file, "$$");
2031
        (void)newXSproto_portable("Purple::Request::Field::list_set_multi_select", XS_Purple__Request__Field_list_set_multi_select, file, "$$");
2032
        (void)newXSproto_portable("Purple::Request::Field::new", XS_Purple__Request__Field_new, file, "$$$$");
2033
        (void)newXSproto_portable("Purple::Request::Field::set_label", XS_Purple__Request__Field_set_label, file, "$$");
2034
        (void)newXSproto_portable("Purple::Request::Field::set_required", XS_Purple__Request__Field_set_required, file, "$$");
2035
        (void)newXSproto_portable("Purple::Request::Field::set_type_hint", XS_Purple__Request__Field_set_type_hint, file, "$$");
2036
        (void)newXSproto_portable("Purple::Request::Field::set_visible", XS_Purple__Request__Field_set_visible, file, "$$");
2037
        (void)newXSproto_portable("Purple::Request::Field::string_new", XS_Purple__Request__Field_string_new, file, "$$$$$");
2038
        (void)newXSproto_portable("Purple::Request::Field::string_get_default_value", XS_Purple__Request__Field_string_get_default_value, file, "$");
2039
        (void)newXSproto_portable("Purple::Request::Field::string_get_value", XS_Purple__Request__Field_string_get_value, file, "$");
2040
        (void)newXSproto_portable("Purple::Request::Field::string_is_editable", XS_Purple__Request__Field_string_is_editable, file, "$");
2041
        (void)newXSproto_portable("Purple::Request::Field::string_is_masked", XS_Purple__Request__Field_string_is_masked, file, "$");
2042
        (void)newXSproto_portable("Purple::Request::Field::string_is_multiline", XS_Purple__Request__Field_string_is_multiline, file, "$");
2043
        (void)newXSproto_portable("Purple::Request::Field::string_set_default_value", XS_Purple__Request__Field_string_set_default_value, file, "$$");
2044
        (void)newXSproto_portable("Purple::Request::Field::string_set_editable", XS_Purple__Request__Field_string_set_editable, file, "$$");
2045
        (void)newXSproto_portable("Purple::Request::Field::string_set_masked", XS_Purple__Request__Field_string_set_masked, file, "$$");
2046
        (void)newXSproto_portable("Purple::Request::Field::string_set_value", XS_Purple__Request__Field_string_set_value, file, "$$");
2047
        (void)newXSproto_portable("Purple::Request::Field::Group::add_field", XS_Purple__Request__Field__Group_add_field, file, "$$");
2048
        (void)newXSproto_portable("Purple::Request::Field::Group::destroy", XS_Purple__Request__Field__Group_destroy, file, "$");
2049
        (void)newXSproto_portable("Purple::Request::Field::Group::get_fields", XS_Purple__Request__Field__Group_get_fields, file, "$");
2050
        (void)newXSproto_portable("Purple::Request::Field::Group::get_title", XS_Purple__Request__Field__Group_get_title, file, "$");
2051
        (void)newXSproto_portable("Purple::Request::Field::Group::new", XS_Purple__Request__Field__Group_new, file, "$$");
2052
        (void)newXSproto_portable("Purple::Request::Field::destroy", XS_Purple__Request__Field_destroy, file, "$");
2053
        (void)newXSproto_portable("Purple::Request::Field::get_id", XS_Purple__Request__Field_get_id, file, "$");
2054
        (void)newXSproto_portable("Purple::Request::Field::get_label", XS_Purple__Request__Field_get_label, file, "$");
2055
        (void)newXSproto_portable("Purple::Request::Field::get_type", XS_Purple__Request__Field_get_type, file, "$");
2056
        (void)newXSproto_portable("Purple::Request::Field::get_type_hint", XS_Purple__Request__Field_get_type_hint, file, "$");
2057
        (void)newXSproto_portable("Purple::Request::Field::is_visible", XS_Purple__Request__Field_is_visible, file, "$");
2058
        (void)newXSproto_portable("Purple::Request::Fields::new", XS_Purple__Request__Fields_new, file, "$");
2059
        (void)newXSproto_portable("Purple::Request::Fields::add_group", XS_Purple__Request__Fields_add_group, file, "$$");
2060
        (void)newXSproto_portable("Purple::Request::Fields::all_required_filled", XS_Purple__Request__Fields_all_required_filled, file, "$");
2061
        (void)newXSproto_portable("Purple::Request::Fields::destroy", XS_Purple__Request__Fields_destroy, file, "$");
2062
        (void)newXSproto_portable("Purple::Request::Fields::exists", XS_Purple__Request__Fields_exists, file, "$$");
2063
        (void)newXSproto_portable("Purple::Request::Fields::get_account", XS_Purple__Request__Fields_get_account, file, "$$");
2064
        (void)newXSproto_portable("Purple::Request::Fields::get_bool", XS_Purple__Request__Fields_get_bool, file, "$$");
2065
        (void)newXSproto_portable("Purple::Request::Fields::get_choice", XS_Purple__Request__Fields_get_choice, file, "$$");
2066
        (void)newXSproto_portable("Purple::Request::Fields::get_field", XS_Purple__Request__Fields_get_field, file, "$$");
2067
        (void)newXSproto_portable("Purple::Request::Fields::get_groups", XS_Purple__Request__Fields_get_groups, file, "$");
2068
        (void)newXSproto_portable("Purple::Request::Fields::get_integer", XS_Purple__Request__Fields_get_integer, file, "$$");
2069
        (void)newXSproto_portable("Purple::Request::Fields::get_required", XS_Purple__Request__Fields_get_required, file, "$");
2070
        (void)newXSproto_portable("Purple::Request::Fields::get_string", XS_Purple__Request__Fields_get_string, file, "$$");
2071
        (void)newXSproto_portable("Purple::Request::Fields::is_field_required", XS_Purple__Request__Fields_is_field_required, file, "$$");
2072

    
2073
    /* Initialisation Section */
2074

    
2075
#line 88 "Request.xs"
2076
{
2077
        HV *request_stash = gv_stashpv("Purple::RequestType", 1);
2078
        HV *request_field_stash = gv_stashpv("Purple::RequestFieldType", 1);
2079

    
2080
        static const constiv *civ, request_const_iv[] = {
2081
#define const_iv(name) {#name, (IV)PURPLE_REQUEST_##name}
2082
                const_iv(INPUT),
2083
                const_iv(CHOICE),
2084
                const_iv(ACTION),
2085
                const_iv(FIELDS),
2086
                const_iv(FILE),
2087
                const_iv(FOLDER),
2088
        };
2089
        static const constiv request_field_const_iv[] = {
2090
#undef const_iv
2091
#define const_iv(name) {#name, (IV)PURPLE_REQUEST_FIELD_##name}
2092
                const_iv(NONE),
2093
                const_iv(STRING),
2094
                const_iv(INTEGER),
2095
                const_iv(BOOLEAN),
2096
                const_iv(CHOICE),
2097
                const_iv(LIST),
2098
                const_iv(LABEL),
2099
                const_iv(IMAGE),
2100
                const_iv(ACCOUNT),
2101
        };
2102

    
2103
        for (civ = request_const_iv + sizeof(request_const_iv) / sizeof(request_const_iv[0]); civ-- > request_const_iv; )
2104
                newCONSTSUB(request_stash, (char *)civ->name, newSViv(civ->iv));
2105

    
2106
        for (civ = request_field_const_iv + sizeof(request_field_const_iv) / sizeof(request_field_const_iv[0]); civ-- > request_field_const_iv; )
2107
                newCONSTSUB(request_field_stash, (char *)civ->name, newSViv(civ->iv));
2108
}
2109

    
2110
#line 2111 "Request.c"
2111

    
2112
    /* End of Initialisation Section */
2113

    
2114
#if (PERL_REVISION == 5 && PERL_VERSION >= 9)
2115
  if (PL_unitcheckav)
2116
       call_list(PL_scopestack_ix, PL_unitcheckav);
2117
#endif
2118
    XSRETURN_YES;
2119
}
2120