File indexing completed on 2026-05-06 08:41:18
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020 #ifndef __G_MAIN_H__
0021 #define __G_MAIN_H__
0022
0023 #if !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION)
0024 #error "Only <glib.h> can be included directly."
0025 #endif
0026
0027 #include <glib/gpoll.h>
0028 #include <glib/gslist.h>
0029 #include <glib/gthread.h>
0030
0031 G_BEGIN_DECLS
0032
0033 typedef enum
0034 {
0035 G_IO_IN GLIB_SYSDEF_POLLIN,
0036 G_IO_OUT GLIB_SYSDEF_POLLOUT,
0037 G_IO_PRI GLIB_SYSDEF_POLLPRI,
0038 G_IO_ERR GLIB_SYSDEF_POLLERR,
0039 G_IO_HUP GLIB_SYSDEF_POLLHUP,
0040 G_IO_NVAL GLIB_SYSDEF_POLLNVAL
0041 } GIOCondition;
0042
0043
0044
0045
0046
0047
0048
0049
0050
0051
0052
0053
0054
0055
0056 GLIB_AVAILABLE_TYPE_IN_2_72
0057 typedef enum
0058 {
0059 G_MAIN_CONTEXT_FLAGS_NONE = 0,
0060 G_MAIN_CONTEXT_FLAGS_OWNERLESS_POLLING = 1
0061 } GMainContextFlags;
0062
0063
0064
0065
0066
0067
0068
0069
0070 typedef struct _GMainContext GMainContext;
0071
0072
0073
0074
0075
0076
0077
0078 typedef struct _GMainLoop GMainLoop;
0079
0080
0081
0082
0083
0084
0085
0086 typedef struct _GSource GSource;
0087 typedef struct _GSourcePrivate GSourcePrivate;
0088
0089
0090
0091
0092
0093
0094
0095
0096
0097
0098
0099 typedef struct _GSourceCallbackFuncs GSourceCallbackFuncs;
0100
0101
0102
0103
0104
0105
0106
0107
0108
0109
0110
0111
0112
0113
0114
0115
0116
0117
0118
0119
0120
0121
0122
0123
0124
0125
0126
0127
0128
0129
0130
0131
0132
0133
0134
0135
0136
0137
0138
0139
0140
0141
0142
0143
0144
0145
0146
0147
0148
0149
0150
0151
0152
0153
0154
0155
0156
0157
0158 typedef struct _GSourceFuncs GSourceFuncs;
0159
0160
0161
0162
0163
0164
0165
0166
0167
0168
0169
0170
0171
0172
0173
0174
0175
0176
0177
0178
0179
0180
0181
0182
0183
0184
0185
0186
0187
0188
0189
0190
0191
0192
0193
0194
0195
0196
0197
0198
0199
0200 typedef gboolean (*GSourceFunc) (gpointer user_data);
0201
0202
0203
0204
0205
0206
0207
0208
0209
0210
0211
0212
0213
0214 typedef void (* GSourceOnceFunc) (gpointer user_data);
0215
0216
0217
0218
0219
0220
0221
0222
0223
0224
0225
0226
0227
0228
0229
0230
0231
0232
0233 #define G_SOURCE_FUNC(f) ((GSourceFunc) (void (*)(void)) (f)) GLIB_AVAILABLE_MACRO_IN_2_58
0234
0235
0236
0237
0238
0239
0240
0241
0242
0243
0244
0245
0246
0247
0248
0249
0250 typedef void (*GChildWatchFunc) (GPid pid,
0251 gint wait_status,
0252 gpointer user_data);
0253
0254
0255
0256
0257
0258
0259
0260
0261
0262
0263
0264 GLIB_AVAILABLE_TYPE_IN_2_64
0265 typedef void (*GSourceDisposeFunc) (GSource *source);
0266
0267 struct _GSource
0268 {
0269
0270 gpointer callback_data;
0271 GSourceCallbackFuncs *callback_funcs;
0272
0273 const GSourceFuncs *source_funcs;
0274 guint ref_count;
0275
0276 GMainContext *context;
0277
0278 gint priority;
0279 guint flags;
0280 guint source_id;
0281
0282 GSList *poll_fds;
0283
0284 GSource *prev;
0285 GSource *next;
0286
0287 char *name;
0288
0289 GSourcePrivate *priv;
0290 };
0291
0292 struct _GSourceCallbackFuncs
0293 {
0294 void (*ref) (gpointer cb_data);
0295 void (*unref) (gpointer cb_data);
0296 void (*get) (gpointer cb_data,
0297 GSource *source,
0298 GSourceFunc *func,
0299 gpointer *data);
0300 };
0301
0302
0303
0304
0305
0306
0307
0308 typedef void (*GSourceDummyMarshal) (void);
0309
0310
0311
0312
0313
0314
0315
0316
0317
0318
0319
0320
0321
0322
0323
0324
0325
0326
0327
0328
0329
0330
0331
0332
0333
0334 typedef gboolean (*GSourceFuncsPrepareFunc) (GSource *source,
0335 gint *timeout_);
0336
0337
0338
0339
0340
0341
0342
0343
0344
0345
0346
0347
0348
0349
0350
0351
0352
0353
0354
0355 typedef gboolean (*GSourceFuncsCheckFunc) (GSource *source);
0356
0357
0358
0359
0360
0361
0362
0363
0364
0365
0366
0367
0368
0369
0370
0371
0372
0373
0374
0375
0376
0377
0378
0379
0380 typedef gboolean (*GSourceFuncsDispatchFunc) (GSource *source,
0381 GSourceFunc callback,
0382 gpointer user_data);
0383
0384
0385
0386
0387
0388
0389
0390
0391
0392
0393
0394
0395
0396
0397 typedef void (*GSourceFuncsFinalizeFunc) (GSource *source);
0398
0399 struct _GSourceFuncs
0400 {
0401 GSourceFuncsPrepareFunc prepare;
0402 GSourceFuncsCheckFunc check;
0403 GSourceFuncsDispatchFunc dispatch;
0404 GSourceFuncsFinalizeFunc finalize;
0405
0406
0407
0408 GSourceFunc closure_callback;
0409 GSourceDummyMarshal closure_marshal;
0410 };
0411
0412
0413
0414
0415
0416
0417
0418
0419
0420
0421 #define G_PRIORITY_HIGH -100
0422
0423
0424
0425
0426
0427
0428
0429
0430
0431
0432 #define G_PRIORITY_DEFAULT 0
0433
0434
0435
0436
0437
0438
0439
0440
0441
0442
0443
0444 #define G_PRIORITY_HIGH_IDLE 100
0445
0446
0447
0448
0449
0450
0451
0452
0453
0454 #define G_PRIORITY_DEFAULT_IDLE 200
0455
0456
0457
0458
0459
0460
0461
0462
0463 #define G_PRIORITY_LOW 300
0464
0465
0466
0467
0468
0469
0470
0471
0472
0473 #define G_SOURCE_REMOVE FALSE
0474
0475
0476
0477
0478
0479
0480
0481
0482
0483 #define G_SOURCE_CONTINUE TRUE
0484
0485
0486
0487 GLIB_AVAILABLE_IN_ALL
0488 GMainContext *g_main_context_new (void);
0489 G_GNUC_BEGIN_IGNORE_DEPRECATIONS
0490 GLIB_AVAILABLE_IN_2_72
0491 GMainContext *g_main_context_new_with_flags (GMainContextFlags flags);
0492 G_GNUC_END_IGNORE_DEPRECATIONS
0493 GLIB_AVAILABLE_IN_ALL
0494 GMainContext *g_main_context_ref (GMainContext *context);
0495 GLIB_AVAILABLE_IN_ALL
0496 void g_main_context_unref (GMainContext *context);
0497 GLIB_AVAILABLE_IN_ALL
0498 GMainContext *g_main_context_default (void);
0499
0500 GLIB_AVAILABLE_IN_ALL
0501 gboolean g_main_context_iteration (GMainContext *context,
0502 gboolean may_block);
0503 GLIB_AVAILABLE_IN_ALL
0504 gboolean g_main_context_pending (GMainContext *context);
0505
0506
0507
0508 GLIB_AVAILABLE_IN_ALL
0509 GSource *g_main_context_find_source_by_id (GMainContext *context,
0510 guint source_id);
0511 GLIB_AVAILABLE_IN_ALL
0512 GSource *g_main_context_find_source_by_user_data (GMainContext *context,
0513 gpointer user_data);
0514 GLIB_AVAILABLE_IN_ALL
0515 GSource *g_main_context_find_source_by_funcs_user_data (GMainContext *context,
0516 GSourceFuncs *funcs,
0517 gpointer user_data);
0518
0519
0520
0521 GLIB_AVAILABLE_IN_ALL
0522 void g_main_context_wakeup (GMainContext *context);
0523 GLIB_AVAILABLE_IN_ALL
0524 gboolean g_main_context_acquire (GMainContext *context);
0525 GLIB_AVAILABLE_IN_ALL
0526 void g_main_context_release (GMainContext *context);
0527 GLIB_AVAILABLE_IN_ALL
0528 gboolean g_main_context_is_owner (GMainContext *context);
0529 GLIB_DEPRECATED_IN_2_58_FOR(g_main_context_is_owner)
0530 gboolean g_main_context_wait (GMainContext *context,
0531 GCond *cond,
0532 GMutex *mutex);
0533
0534 GLIB_AVAILABLE_IN_ALL
0535 gboolean g_main_context_prepare (GMainContext *context,
0536 gint *priority);
0537 GLIB_AVAILABLE_IN_ALL
0538 gint g_main_context_query (GMainContext *context,
0539 gint max_priority,
0540 gint *timeout_,
0541 GPollFD *fds,
0542 gint n_fds);
0543 GLIB_AVAILABLE_IN_ALL
0544 gboolean g_main_context_check (GMainContext *context,
0545 gint max_priority,
0546 GPollFD *fds,
0547 gint n_fds);
0548 GLIB_AVAILABLE_IN_ALL
0549 void g_main_context_dispatch (GMainContext *context);
0550
0551 GLIB_AVAILABLE_IN_ALL
0552 void g_main_context_set_poll_func (GMainContext *context,
0553 GPollFunc func);
0554 GLIB_AVAILABLE_IN_ALL
0555 GPollFunc g_main_context_get_poll_func (GMainContext *context);
0556
0557
0558
0559 GLIB_AVAILABLE_IN_ALL
0560 void g_main_context_add_poll (GMainContext *context,
0561 GPollFD *fd,
0562 gint priority);
0563 GLIB_AVAILABLE_IN_ALL
0564 void g_main_context_remove_poll (GMainContext *context,
0565 GPollFD *fd);
0566
0567 GLIB_AVAILABLE_IN_ALL
0568 gint g_main_depth (void);
0569 GLIB_AVAILABLE_IN_ALL
0570 GSource *g_main_current_source (void);
0571
0572
0573
0574 GLIB_AVAILABLE_IN_ALL
0575 void g_main_context_push_thread_default (GMainContext *context);
0576 GLIB_AVAILABLE_IN_ALL
0577 void g_main_context_pop_thread_default (GMainContext *context);
0578 GLIB_AVAILABLE_IN_ALL
0579 GMainContext *g_main_context_get_thread_default (void);
0580 GLIB_AVAILABLE_IN_ALL
0581 GMainContext *g_main_context_ref_thread_default (void);
0582
0583
0584
0585
0586
0587
0588
0589
0590 typedef void GMainContextPusher GLIB_AVAILABLE_TYPE_IN_2_64;
0591
0592
0593
0594
0595
0596
0597
0598
0599
0600
0601
0602
0603
0604
0605
0606
0607
0608
0609
0610
0611
0612
0613
0614
0615
0616
0617
0618
0619
0620
0621
0622
0623
0624
0625
0626
0627
0628
0629
0630
0631
0632
0633
0634
0635
0636
0637 G_GNUC_BEGIN_IGNORE_DEPRECATIONS
0638 GLIB_AVAILABLE_STATIC_INLINE_IN_2_64
0639 static inline GMainContextPusher *g_main_context_pusher_new (GMainContext *main_context);
0640
0641 GLIB_AVAILABLE_STATIC_INLINE_IN_2_64
0642 static inline GMainContextPusher *
0643 g_main_context_pusher_new (GMainContext *main_context)
0644 {
0645 g_main_context_push_thread_default (main_context);
0646 return (GMainContextPusher *) main_context;
0647 }
0648 G_GNUC_END_IGNORE_DEPRECATIONS
0649
0650
0651
0652
0653
0654
0655
0656
0657
0658
0659
0660
0661
0662 G_GNUC_BEGIN_IGNORE_DEPRECATIONS
0663 GLIB_AVAILABLE_STATIC_INLINE_IN_2_64
0664 static inline void g_main_context_pusher_free (GMainContextPusher *pusher);
0665
0666 GLIB_AVAILABLE_STATIC_INLINE_IN_2_64
0667 static inline void
0668 g_main_context_pusher_free (GMainContextPusher *pusher)
0669 {
0670 g_main_context_pop_thread_default ((GMainContext *) pusher);
0671 }
0672 G_GNUC_END_IGNORE_DEPRECATIONS
0673
0674
0675
0676 GLIB_AVAILABLE_IN_ALL
0677 GMainLoop *g_main_loop_new (GMainContext *context,
0678 gboolean is_running);
0679 GLIB_AVAILABLE_IN_ALL
0680 void g_main_loop_run (GMainLoop *loop);
0681 GLIB_AVAILABLE_IN_ALL
0682 void g_main_loop_quit (GMainLoop *loop);
0683 GLIB_AVAILABLE_IN_ALL
0684 GMainLoop *g_main_loop_ref (GMainLoop *loop);
0685 GLIB_AVAILABLE_IN_ALL
0686 void g_main_loop_unref (GMainLoop *loop);
0687 GLIB_AVAILABLE_IN_ALL
0688 gboolean g_main_loop_is_running (GMainLoop *loop);
0689 GLIB_AVAILABLE_IN_ALL
0690 GMainContext *g_main_loop_get_context (GMainLoop *loop);
0691
0692
0693
0694 GLIB_AVAILABLE_IN_ALL
0695 GSource *g_source_new (GSourceFuncs *source_funcs,
0696 guint struct_size);
0697
0698 G_GNUC_BEGIN_IGNORE_DEPRECATIONS
0699 GLIB_AVAILABLE_IN_2_64
0700 void g_source_set_dispose_function (GSource *source,
0701 GSourceDisposeFunc dispose);
0702 G_GNUC_END_IGNORE_DEPRECATIONS
0703
0704 GLIB_AVAILABLE_IN_ALL
0705 GSource *g_source_ref (GSource *source);
0706 GLIB_AVAILABLE_IN_ALL
0707 void g_source_unref (GSource *source);
0708
0709 GLIB_AVAILABLE_IN_ALL
0710 guint g_source_attach (GSource *source,
0711 GMainContext *context);
0712 GLIB_AVAILABLE_IN_ALL
0713 void g_source_destroy (GSource *source);
0714
0715 GLIB_AVAILABLE_IN_ALL
0716 void g_source_set_priority (GSource *source,
0717 gint priority);
0718 GLIB_AVAILABLE_IN_ALL
0719 gint g_source_get_priority (GSource *source);
0720 GLIB_AVAILABLE_IN_ALL
0721 void g_source_set_can_recurse (GSource *source,
0722 gboolean can_recurse);
0723 GLIB_AVAILABLE_IN_ALL
0724 gboolean g_source_get_can_recurse (GSource *source);
0725 GLIB_AVAILABLE_IN_ALL
0726 guint g_source_get_id (GSource *source);
0727
0728 GLIB_AVAILABLE_IN_ALL
0729 GMainContext *g_source_get_context (GSource *source);
0730 GLIB_AVAILABLE_IN_2_86
0731 GMainContext *g_source_dup_context (GSource *source);
0732
0733 GLIB_AVAILABLE_IN_ALL
0734 void g_source_set_callback (GSource *source,
0735 GSourceFunc func,
0736 gpointer data,
0737 GDestroyNotify notify);
0738
0739 GLIB_AVAILABLE_IN_ALL
0740 void g_source_set_funcs (GSource *source,
0741 GSourceFuncs *funcs);
0742 GLIB_AVAILABLE_IN_ALL
0743 gboolean g_source_is_destroyed (GSource *source);
0744
0745 GLIB_AVAILABLE_IN_ALL
0746 void g_source_set_name (GSource *source,
0747 const char *name);
0748 GLIB_AVAILABLE_IN_2_70
0749 void g_source_set_static_name (GSource *source,
0750 const char *name);
0751 GLIB_AVAILABLE_IN_ALL
0752 const char * g_source_get_name (GSource *source);
0753 GLIB_AVAILABLE_IN_ALL
0754 void g_source_set_name_by_id (guint tag,
0755 const char *name);
0756
0757 GLIB_AVAILABLE_IN_2_36
0758 void g_source_set_ready_time (GSource *source,
0759 gint64 ready_time);
0760 GLIB_AVAILABLE_IN_2_36
0761 gint64 g_source_get_ready_time (GSource *source);
0762
0763 #ifdef G_OS_UNIX
0764 GLIB_AVAILABLE_IN_2_36
0765 gpointer g_source_add_unix_fd (GSource *source,
0766 gint fd,
0767 GIOCondition events);
0768 GLIB_AVAILABLE_IN_2_36
0769 void g_source_modify_unix_fd (GSource *source,
0770 gpointer tag,
0771 GIOCondition new_events);
0772 GLIB_AVAILABLE_IN_2_36
0773 void g_source_remove_unix_fd (GSource *source,
0774 gpointer tag);
0775 GLIB_AVAILABLE_IN_2_36
0776 GIOCondition g_source_query_unix_fd (GSource *source,
0777 gpointer tag);
0778 #endif
0779
0780
0781 GLIB_AVAILABLE_IN_ALL
0782 void g_source_set_callback_indirect (GSource *source,
0783 gpointer callback_data,
0784 GSourceCallbackFuncs *callback_funcs);
0785
0786 GLIB_AVAILABLE_IN_ALL
0787 void g_source_add_poll (GSource *source,
0788 GPollFD *fd);
0789 GLIB_AVAILABLE_IN_ALL
0790 void g_source_remove_poll (GSource *source,
0791 GPollFD *fd);
0792
0793 GLIB_AVAILABLE_IN_ALL
0794 void g_source_add_child_source (GSource *source,
0795 GSource *child_source);
0796 GLIB_AVAILABLE_IN_ALL
0797 void g_source_remove_child_source (GSource *source,
0798 GSource *child_source);
0799
0800 G_GNUC_BEGIN_IGNORE_DEPRECATIONS
0801 GLIB_DEPRECATED_IN_2_28_FOR(g_source_get_time)
0802 void g_source_get_current_time (GSource *source,
0803 GTimeVal *timeval);
0804 G_GNUC_END_IGNORE_DEPRECATIONS
0805
0806 GLIB_AVAILABLE_IN_ALL
0807 gint64 g_source_get_time (GSource *source);
0808
0809
0810
0811
0812
0813
0814
0815 GLIB_AVAILABLE_IN_ALL
0816 GSource *g_idle_source_new (void);
0817 GLIB_AVAILABLE_IN_ALL
0818 GSource *g_child_watch_source_new (GPid pid);
0819 GLIB_AVAILABLE_IN_ALL
0820 GSource *g_timeout_source_new (guint interval);
0821 GLIB_AVAILABLE_IN_ALL
0822 GSource *g_timeout_source_new_seconds (guint interval);
0823
0824
0825
0826 G_GNUC_BEGIN_IGNORE_DEPRECATIONS
0827 GLIB_DEPRECATED_IN_2_62_FOR(g_get_real_time)
0828 void g_get_current_time (GTimeVal *result);
0829 G_GNUC_END_IGNORE_DEPRECATIONS
0830
0831 GLIB_AVAILABLE_IN_ALL
0832 gint64 g_get_monotonic_time (void);
0833 GLIB_AVAILABLE_IN_ALL
0834 gint64 g_get_real_time (void);
0835
0836
0837
0838 GLIB_AVAILABLE_IN_ALL
0839 gboolean g_source_remove (guint tag);
0840 GLIB_AVAILABLE_IN_ALL
0841 gboolean g_source_remove_by_user_data (gpointer user_data);
0842 GLIB_AVAILABLE_IN_ALL
0843 gboolean g_source_remove_by_funcs_user_data (GSourceFuncs *funcs,
0844 gpointer user_data);
0845
0846
0847
0848
0849
0850
0851
0852
0853
0854
0855
0856
0857 typedef void (* GClearHandleFunc) (guint handle_id);
0858
0859 GLIB_AVAILABLE_IN_2_56
0860 void g_clear_handle_id (guint *tag_ptr,
0861 GClearHandleFunc clear_func);
0862
0863 #define g_clear_handle_id(tag_ptr, clear_func) \
0864 G_STMT_START { \
0865 G_STATIC_ASSERT (sizeof *(tag_ptr) == sizeof (guint)); \
0866 guint *_tag_ptr = (guint *) (tag_ptr); \
0867 guint _handle_id; \
0868 \
0869 _handle_id = *_tag_ptr; \
0870 if (_handle_id > 0) \
0871 { \
0872 *_tag_ptr = 0; \
0873 clear_func (_handle_id); \
0874 } \
0875 } G_STMT_END \
0876 GLIB_AVAILABLE_MACRO_IN_2_56
0877
0878
0879
0880
0881
0882
0883
0884
0885
0886
0887
0888
0889
0890
0891
0892
0893
0894
0895
0896
0897
0898
0899
0900
0901
0902
0903
0904
0905
0906
0907
0908
0909
0910
0911 GLIB_AVAILABLE_STATIC_INLINE_IN_2_84
0912 static inline unsigned int g_steal_handle_id (unsigned int *handle_pointer);
0913
0914 GLIB_AVAILABLE_STATIC_INLINE_IN_2_84
0915 static inline unsigned int
0916 g_steal_handle_id (unsigned int *handle_pointer)
0917 {
0918 unsigned int handle;
0919
0920 handle = *handle_pointer;
0921 *handle_pointer = 0;
0922
0923 return handle;
0924 }
0925
0926
0927 GLIB_AVAILABLE_IN_ALL
0928 guint g_timeout_add_full (gint priority,
0929 guint interval,
0930 GSourceFunc function,
0931 gpointer data,
0932 GDestroyNotify notify);
0933 GLIB_AVAILABLE_IN_ALL
0934 guint g_timeout_add (guint interval,
0935 GSourceFunc function,
0936 gpointer data);
0937 GLIB_AVAILABLE_IN_2_74
0938 guint g_timeout_add_once (guint interval,
0939 GSourceOnceFunc function,
0940 gpointer data);
0941 GLIB_AVAILABLE_IN_ALL
0942 guint g_timeout_add_seconds_full (gint priority,
0943 guint interval,
0944 GSourceFunc function,
0945 gpointer data,
0946 GDestroyNotify notify);
0947 GLIB_AVAILABLE_IN_ALL
0948 guint g_timeout_add_seconds (guint interval,
0949 GSourceFunc function,
0950 gpointer data);
0951 GLIB_AVAILABLE_IN_2_78
0952 guint g_timeout_add_seconds_once (guint interval,
0953 GSourceOnceFunc function,
0954 gpointer data);
0955 GLIB_AVAILABLE_IN_ALL
0956 guint g_child_watch_add_full (gint priority,
0957 GPid pid,
0958 GChildWatchFunc function,
0959 gpointer data,
0960 GDestroyNotify notify);
0961 GLIB_AVAILABLE_IN_ALL
0962 guint g_child_watch_add (GPid pid,
0963 GChildWatchFunc function,
0964 gpointer data);
0965 GLIB_AVAILABLE_IN_ALL
0966 guint g_idle_add (GSourceFunc function,
0967 gpointer data);
0968 GLIB_AVAILABLE_IN_ALL
0969 guint g_idle_add_full (gint priority,
0970 GSourceFunc function,
0971 gpointer data,
0972 GDestroyNotify notify);
0973 GLIB_AVAILABLE_IN_2_74
0974 guint g_idle_add_once (GSourceOnceFunc function,
0975 gpointer data);
0976 GLIB_AVAILABLE_IN_ALL
0977 gboolean g_idle_remove_by_data (gpointer data);
0978
0979 GLIB_AVAILABLE_IN_ALL
0980 void g_main_context_invoke_full (GMainContext *context,
0981 gint priority,
0982 GSourceFunc function,
0983 gpointer data,
0984 GDestroyNotify notify);
0985 GLIB_AVAILABLE_IN_ALL
0986 void g_main_context_invoke (GMainContext *context,
0987 GSourceFunc function,
0988 gpointer data);
0989
0990
0991
0992
0993
0994
0995
0996
0997
0998
0999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011 GLIB_AVAILABLE_STATIC_INLINE_IN_2_70
1012 static inline int g_steal_fd (int *fd_ptr);
1013
1014 GLIB_AVAILABLE_STATIC_INLINE_IN_2_70
1015 static inline int
1016 g_steal_fd (int *fd_ptr)
1017 {
1018 int fd = *fd_ptr;
1019 *fd_ptr = -1;
1020 return fd;
1021 }
1022
1023
1024 GLIB_VAR GSourceFuncs g_timeout_funcs;
1025 GLIB_VAR GSourceFuncs g_child_watch_funcs;
1026 GLIB_VAR GSourceFuncs g_idle_funcs;
1027 #ifdef G_OS_UNIX
1028 GLIB_VAR GSourceFuncs g_unix_signal_funcs;
1029 GLIB_VAR GSourceFuncs g_unix_fd_source_funcs;
1030 #endif
1031
1032 G_END_DECLS
1033
1034 #endif