~ubuntu-branches/ubuntu/vivid/vala/vivid

« back to all changes in this revision

Viewing changes to vala/valadatatype.c

  • Committer: Bazaar Package Importer
  • Author(s): Sebastian Dröge
  • Date: 2010-07-28 07:58:01 UTC
  • mfrom: (1.5.5 upstream) (7.3.14 experimental)
  • Revision ID: james.westby@ubuntu.com-20100728075801-18u9cg5hv5oety6m
Tags: 0.9.4-1
New upstream development release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
93
93
typedef struct _ValaSymbol ValaSymbol;
94
94
typedef struct _ValaSymbolClass ValaSymbolClass;
95
95
 
 
96
#define VALA_TYPE_VARIABLE (vala_variable_get_type ())
 
97
#define VALA_VARIABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), VALA_TYPE_VARIABLE, ValaVariable))
 
98
#define VALA_VARIABLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), VALA_TYPE_VARIABLE, ValaVariableClass))
 
99
#define VALA_IS_VARIABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), VALA_TYPE_VARIABLE))
 
100
#define VALA_IS_VARIABLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), VALA_TYPE_VARIABLE))
 
101
#define VALA_VARIABLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), VALA_TYPE_VARIABLE, ValaVariableClass))
 
102
 
 
103
typedef struct _ValaVariable ValaVariable;
 
104
typedef struct _ValaVariableClass ValaVariableClass;
 
105
 
96
106
#define VALA_TYPE_LOCAL_VARIABLE (vala_local_variable_get_type ())
97
107
#define VALA_LOCAL_VARIABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), VALA_TYPE_LOCAL_VARIABLE, ValaLocalVariable))
98
108
#define VALA_LOCAL_VARIABLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), VALA_TYPE_LOCAL_VARIABLE, ValaLocalVariableClass))
361
371
GType vala_data_type_get_type (void) G_GNUC_CONST;
362
372
GType vala_expression_get_type (void) G_GNUC_CONST;
363
373
GType vala_symbol_get_type (void) G_GNUC_CONST;
 
374
GType vala_variable_get_type (void) G_GNUC_CONST;
364
375
GType vala_local_variable_get_type (void) G_GNUC_CONST;
365
376
GType vala_attribute_get_type (void) G_GNUC_CONST;
366
377
gpointer vala_scope_ref (gpointer instance);
495
506
 
496
507
 
497
508
 
 
509
/**
 
510
 * Appends the specified type as generic type argument.
 
511
 *
 
512
 * @param arg a type reference
 
513
 */
498
514
void vala_data_type_add_type_argument (ValaDataType* self, ValaDataType* arg) {
499
515
        g_return_if_fail (self != NULL);
500
516
        g_return_if_fail (arg != NULL);
512
528
}
513
529
 
514
530
 
 
531
/**
 
532
 * Returns a copy of the list of generic type arguments.
 
533
 *
 
534
 * @return type argument list
 
535
 */
515
536
ValaList* vala_data_type_get_type_arguments (ValaDataType* self) {
516
537
        ValaList* result = NULL;
517
538
        g_return_val_if_fail (self != NULL, NULL);
540
561
}
541
562
 
542
563
 
 
564
/**
 
565
 * Removes all generic type arguments.
 
566
 */
543
567
void vala_data_type_remove_all_type_arguments (ValaDataType* self) {
544
568
        ValaList* _tmp0_;
545
569
        g_return_if_fail (self != NULL);
577
601
}
578
602
 
579
603
 
 
604
/**
 
605
 * Returns the name and qualifiers of this type as it is used in C code.
 
606
 *
 
607
 * @return the type string to be used in C code
 
608
 */
580
609
static char* vala_data_type_real_get_cname (ValaDataType* self) {
581
610
        char* result = NULL;
582
611
        g_return_val_if_fail (self != NULL, NULL);
609
638
}
610
639
 
611
640
 
 
641
/**
 
642
 * Returns the name and qualifiers of this type as it is used in C code
 
643
 * in a const declaration.
 
644
 *
 
645
 * @return the type string to be used in C code const declarations
 
646
 */
612
647
char* vala_data_type_get_const_cname (ValaDataType* self) {
613
648
        char* result = NULL;
614
649
        char* ptr;
641
676
}
642
677
 
643
678
 
 
679
/**
 
680
 * Returns the C name of this data type in lower case. Words are
 
681
 * separated by underscores.
 
682
 *
 
683
 * @param infix a string to be placed between namespace and data type
 
684
 *              name or null
 
685
 * @return      the lower case name to be used in C code
 
686
 */
644
687
static char* vala_data_type_real_get_lower_case_cname (ValaDataType* self, const char* infix) {
645
688
        char* result = NULL;
646
689
        g_return_val_if_fail (self != NULL, NULL);
777
820
}
778
821
 
779
822
 
 
823
/**
 
824
 * Creates a shallow copy of this type reference.
 
825
 *
 
826
 * @return copy of this type reference
 
827
 */
780
828
static ValaDataType* vala_data_type_real_copy (ValaDataType* self) {
781
829
        g_return_val_if_fail (self != NULL, NULL);
782
830
        g_critical ("Type `%s' does not implement abstract method `vala_data_type_copy'", g_type_name (G_TYPE_FROM_INSTANCE (self)));
789
837
}
790
838
 
791
839
 
 
840
/**
 
841
 * Checks two type references for equality. May only be used with
 
842
 * resolved type references.
 
843
 *
 
844
 * @param type2 a type reference
 
845
 * @return      true if this type reference is equal to type2, false
 
846
 *              otherwise
 
847
 */
792
848
static gboolean vala_data_type_real_equals (ValaDataType* self, ValaDataType* type2) {
793
849
        gboolean result = FALSE;
794
850
        gboolean _tmp0_ = FALSE;
841
897
}
842
898
 
843
899
 
 
900
/**
 
901
 * Checks whether this type reference is at least as strict as the
 
902
 * specified type reference type2.
 
903
 *
 
904
 * @param type2 a type reference
 
905
 * @return      true if this type reference is stricter or equal
 
906
 */
844
907
static gboolean vala_data_type_real_stricter (ValaDataType* self, ValaDataType* type2) {
845
908
        gboolean result = FALSE;
846
909
        gboolean _tmp0_ = FALSE;
1169
1232
}
1170
1233
 
1171
1234
 
 
1235
/**
 
1236
 * Returns whether instances of this type are invokable.
 
1237
 *
 
1238
 * @return true if invokable, false otherwise
 
1239
 */
1172
1240
static gboolean vala_data_type_real_is_invokable (ValaDataType* self) {
1173
1241
        gboolean result = FALSE;
1174
1242
        g_return_val_if_fail (self != NULL, FALSE);
1182
1250
}
1183
1251
 
1184
1252
 
 
1253
/**
 
1254
 * Returns the return type of this invokable.
 
1255
 *
 
1256
 * @return return type
 
1257
 */
1185
1258
static ValaDataType* vala_data_type_real_get_return_type (ValaDataType* self) {
1186
1259
        ValaDataType* result = NULL;
1187
1260
        g_return_val_if_fail (self != NULL, NULL);
1195
1268
}
1196
1269
 
1197
1270
 
 
1271
/**
 
1272
 * Returns copy of the list of invocation parameters.
 
1273
 *
 
1274
 * @return parameter list
 
1275
 */
1198
1276
static ValaList* vala_data_type_real_get_parameters (ValaDataType* self) {
1199
1277
        ValaList* result = NULL;
1200
1278
        g_return_val_if_fail (self != NULL, NULL);
1246
1324
}
1247
1325
 
1248
1326
 
 
1327
/**
 
1328
 * Returns a list of symbols that define this type.
 
1329
 *
 
1330
 * @return symbol list
 
1331
 */
1249
1332
static ValaList* vala_data_type_real_get_symbols (ValaDataType* self) {
1250
1333
        ValaList* result = NULL;
1251
1334
        ValaArrayList* symbols;
1296
1379
}
1297
1380
 
1298
1381
 
 
1382
/**
 
1383
 * Checks whether this data type references a real struct. A real struct
 
1384
 * is a struct which is not a simple (fundamental) type.
 
1385
 */
1299
1386
static gboolean vala_data_type_real_is_real_struct_type (ValaDataType* self) {
1300
1387
        gboolean result = FALSE;
1301
1388
        ValaTypeSymbol* _tmp0_;
1356
1443
}
1357
1444
 
1358
1445
 
 
1446
/**
 
1447
 * Returns whether the value needs to be disposed, i.e. whether
 
1448
 * allocated memory or other resources need to be released when
 
1449
 * the value is no longer needed.
 
1450
 */
1359
1451
static gboolean vala_data_type_real_is_disposable (ValaDataType* self) {
1360
1452
        gboolean result = FALSE;
1361
1453
        g_return_val_if_fail (self != NULL, FALSE);
1570
1662
}
1571
1663
 
1572
1664
 
 
1665
/**
 
1666
 * A reference to a data type. This is used to specify static types of
 
1667
 * expressions.
 
1668
 */
1573
1669
GType vala_data_type_get_type (void) {
1574
1670
        static volatile gsize vala_data_type_type_id__volatile = 0;
1575
1671
        if (g_once_init_enter (&vala_data_type_type_id__volatile)) {