Wrote the README_GIT file to be a proper tutorial on git, repo.or.cz and gtkD.
[gtkD.git] / gtkD / wrap / APILookupGLib.txt
blobb29fa413fabadaee8d78ad6fffbe15114410ccb6
2 # This file is part of gtkD.
3
4 # gtkD is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU Lesser General Public License as published by
6 # the Free Software Foundation; either version 2.1 of the License, or
7 # (at your option) any later version.
8
9 # gtkD is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 # GNU Lesser General Public License for more details.
13
14 # You should have received a copy of the GNU Lesser General Public License
15 # along with gtkD; if not, write to the Free Software
16 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
21 ###
22 #####
23 # Definitions for wrapping GLib
24 #####
25 ###
29 addTypedefs: start
30 /* The GLib Basic Types */
31 public alias int gint;
32 public alias uint guint;
33 public alias int gboolean;
34 public alias void* gpointer;
35 public alias void* gconstpointer;
36 public alias char gchar;
37 public alias char guchar;
38 public alias short gshort;
39 public alias ushort gushort;
40 public alias int glong;
41 public alias uint gulong;
42 public alias byte gint8;
43 public alias byte guint8;
44 public alias short gint16;
45 public alias ushort guint16;
46 public alias int gint32;
47 public alias long gint64;
48 public alias uint guint32;
49 public alias ulong guint64;
50 public alias float gfloat;
51 public alias double gdouble;
52 public alias uint gsize;
53 public alias int gssize;
54 public alias void* va_list;
55 public alias dchar unichar;
56 public alias wchar unichar2;
57 //public alias dchar gunichar;
58 //public alias wchar gunichar2;
59 public alias int time_t;
60 public alias uint XID;
62 addTypedefs: end
64 addAliases: start
65 addAliases: end
67 addEnums: start
68 addEnums: end
70 addStructs: start
71 addStructs: end
73 addTypes: start
74 addTypes: end
76 addFuncts: start
77 addFuncts: end
79 addUnions: start
80 addUnions: end
82 addConstants: start
84 const uint G_MAXUINT = 4294967295;
86 addConstants: end
89 # must start with wrap
91 wrap: glib
93 ###########################################################
94 ### GLib Fundamentals #####################################
95 ###########################################################
97 file: glib-Version-Information.html
98 class: Version
99 prefix: glib_
100 import: glib.Str
101 outFile: GLib
103 #file: glib-Basic-Types.html
104 #outFile: types
106 #file: glib-Limits-of-Basic-Types.html
107 #outFile: typeLimits
109 #file: glib-Standard-Macros.html
110 #class: 
111 #prefix: 
112 #outFile: 
114 #file: glib-Type-Conversion-Macros.html
115 #class: 
116 #prefix: 
117 #outFile: 
119 #file: glib-Byte-Order-Macros.html
120 #class: 
121 #prefix: 
122 #outFile: 
124 #file: glib-Numerical-Definitions.html
125 #class: 
126 #prefix: 
127 #outFile: 
129 #file: glib-Miscellaneous-Macros.html
130 #class: 
131 #prefix: 
132 #outFile: 
134 file: glib-Atomic-Operations.html
135 class: Atomic
136 prefix: g_atomic_
137 outFile: Atomic
139 ###########################################################
140 ### GLib Core Application Support #########################
141 ###########################################################
143 file: glib-The-Main-Event-Loop.html
145 struct: GMainLoop
146 class: MainLoop
147 prefix: g_main_loop_
148 noprefix: g_main_context_
149 noprefix: g_timeout_
150 noprefix: g_child_
151 noprefix: g_source_
152 import: glib.Dataset
153 structWrap: GDataset* Dataset
154 import: glib.MainContext
155 structWrap: GMainContext* MainContext
156 import: glib.Source
157 structWrap: GSource* Source
158 nocode: g_main_loop_ref
159 code: start
160         /**
161          * Increases the reference count on a GMainLoop object by one.
162          * loop:
163          *  a GMainLoop
164          * Returns:
165          *  loop
166          */
167         public MainLoop doref()
168         {
169                 // GMainLoop* g_main_loop_ref (GMainLoop *loop);
170                 return new MainLoop( g_main_loop_ref(gMainLoop) );
171         }
172 code: end       
173 outFile: MainLoop
175 struct: GMainContext
176 class: MainContext
177 prefix: g_main_context_
178 strictPrefix: Yes
179 import: glib.MainLoop
180 structWrap: GMainLLoop* MainLoop
181 import: glib.Source
182 structWrap: GSource* Source
183 import: gthread.Cond
184 structWrap: GCond* Cond
185 import: gthread.Mutex
186 structWrap: GMutex* Mutex
187 import: glib.ThreadPool
188 structWrap: GThreadPoll* ThreadPoll
189 import: glib.MainContext
190 structWrap: GMainContext* MainContext
191 #import: glib.SourceFuncs
192 #structWrap: GSourceFuncs* SourceFuncs
193 #import: glib.PollFD
194 #structWrap: GPollFD* PollFD
195 outFile: MainContext
197 class: Timeout
198 import: glib.MainLoop
199 structWrap: GMainLoop* MainLoop
200 import: glib.Dataset
201 structWrap: GDataset* Dataset
202 prefix: g_timeout_
203 strictPrefix: Yes
204 import: glib.Source
205 structWrap: GSource* Source
206 outFile: Timeout
208 class: Child
209 import: glib.MainLoop
210 structWrap: GMainLoop* MainLoop
211 import: glib.Dataset
212 structWrap: GDataset* Dataset
213 prefix: g_child_
214 strictPrefix: Yes
215 outFile: Child
217 struct: GSource
218 class: Source
219 import: glib.MainLoop
220 structWrap: GMainLoop* MainLoop
221 import: glib.Dataset
222 structWrap: GDataset* Dataset
223 import: glib.Date
224 structWrap: GDate* Date
225 prefix: g_source_
226 strictPrefix: Yes
227 #import: glib.SourceFuncs
228 #structWrap: GSourceFuncs* SourceFuncs
229 import: glib.Source
230 structWrap: GSource* Source
231 import: glib.MainContext
232 structWrap: GMainContext* MainContext
233 #import: glib.SourceCallbackFuncs
234 #structWrap: GSourceCallbackFuncs* SourceCallbackFuncs
235 #import: glib.PollFD
236 #structWrap: GPollFD* PollFD
237 #import: glib.TimeVal
238 #structWrap: GTimeVal* TimeVal
239 outFile: Source
242 file: glib-Threads.html
243 #struct: GThread
244 #class: Thread
245 #import: glib.ErrorG
246 #import: gthread.Mutex
247 #structWrap: GMutex* Mutex
248 #import: glib.Source
249 #structWrap: GSource* Source
250 #import: glib.Dataset
251 #structWrap: GDataset* Dataset
252 #import: glib.ListG
253 #structWrap: GList* ListG
254 #prefix: g_thread_
255 #noprefix: g_mutex_
256 #noprefix: g_static_rec_mutex_
257 #noprefix: g_static_rw_lock_
258 #noprefix: g_cond_
259 #noprefix: g_private_
260 #noprefix: g_static_private_
261 ##import: glib.ThreadFunctions
262 ##structWrap: GThreadFunctions* ThreadFunctions
263 #structWrap: GThread* Thread
264 ##import: glib.Error*
265 ##structWrap: GError** Error*
266 ##import: glib.StaticMutex
267 ##structWrap: GStaticMutex* StaticMutex
268 #outFile: Thread
270 #struct: GMutex
271 #class: Mutex
272 #prefix: g_mutex_
273 #strictPrefix: Yes
274 #outFile: Mutex
276 #struct: GStaticRecMutex
277 #class: StaticRecMutex
278 #prefix: g_static_rec_mutex_
279 #strictPrefix: Yes
280 #outFile: StaticRecMutex
282 #struct: GStaticRWLock
283 #class: RWLock
284 #prefix: g_static_rw_lock_
285 #strictPrefix: Yes
286 #outFile: RWLock
288 #struct: GCond
289 #class: Cond
290 #import: glib.Date
291 #structWrap: GDate* Date
292 #prefix: g_cond_
293 #strictPrefix: Yes
294 #import: gthread.Mutex
295 #structWrap: GMutex* Mutex
296 ##import: glib.TimeVal
297 ##structWrap: GTimeVal* TimeVal
298 #outFile: Cond
300 #struct: GPrivate
301 #class: Private
302 #import: glib.Dataset
303 #structWrap: GDataset* Dataset
304 #prefix: g_private_
305 #strictPrefix: Yes
306 #outFile: Private
308 #struct: GStaticPrivate
309 #class: StaticPrivate
310 #import: glib.Dataset
311 #structWrap: GDataset* Dataset
312 #prefix: g_static_private_
313 #strictPrefix: Yes
314 #outFile: StaticPrivate
324 file: glib-Thread-Pools.html
325 struct: GThreadPool
326 class: ThreadPool
327 import: glib.ErrorG
328 import: glib.ListG
329 structWrap: GList* ListG
330 prefix: g_thread_pool_
331 import: glib.MainLoop
332 outFile: ThreadPool
335 file: glib-Asynchronous-Queues.html
336 struct: GAsyncQueue
337 class: AsyncQueue
338 prefix: g_async_queue_
339 import: glib.ListG
340 import: glib.Date
341 import: glib.AsyncQueue
342 structWrap: GAsyncQueue* AsyncQueue
343 #import: glib.TimeVal
344 #structWrap: GTimeVal* TimeVal
345 outFile: AsyncQueue
347 file: glib-Dynamic-Loading-of-Modules.html
348 struct: GModule
349 class: Module
350 prefix: g_module_
351 import: glib.Module
352 structWrap: GModule* Module
353 import: glib.Str
354 outFile: Module
357 file: glib-Memory-Allocation.html
358 class: Memory
359 prefix: g_
360 #import: glib.MemVTable
361 #structWrap: GMemVTable* MemVTable
362 outFile: Memory
365 file: glib-IO-Channels.html
366 struct: GIOChannel
367 class: IOChannel
368 prefix: g_io_channel_
369 import: glib.ErrorG
370 import: glib.StringG
371 import: glib.Source
372 import: glib.Dataset
373 import: glib.Str
374 structWrap: GString* StringG
375 structWrap: GSource* Source
376 #import: glib.IOChannel
377 structWrap: GIOChannel* IOChannel
378 outFile: IOChannel
381 file: glib-Error-Reporting.html
382 struct: GError
383 class: ErrorG
384 import: glib.Quark
385 import: glib.Str
386 prefix: g_error_
387 outFile: ErrorG
390 file: glib-Warnings-and-Assertions.html
391 class: Messages
392 prefix: g_
393 import: glib.Str
394 outFile: Messages
396 file: glib-Message-Logging.html
397 class: MessageLog
398 prefix: g_
399 import: glib.Str
400 outFile: MessageLog
403 ###########################################################
404 ### GLib Utilities ########################################
405 ###########################################################
407 file: glib-String-Utility-Functions.html
408 class: Str
409 import: std.stdio
410 import: glib.StringG
411 structWrap: GString* StringG
412 import: std.c.string
413 prefix: g_
415 code: start
417 const static char[10] digits    = "0123456789";                 /// 0..9
419 /*************************************************
420  * Convert C-style 0 terminated string s to char[] string.
421  * copied from phobos
422  */
423 public static char[] toString(char *s)
425     return s ? s[0 .. strlen(s)] : cast(char[])null;
428 /*********************************
429  * Convert array of chars s[] to a C-style 0 terminated string.
430  * copied from phobos
431  */
432 public static char* toStringz(char[] s)
436 out (result)
438 //      if (result)
439 //      {
440 //              // TODO this one fails in some case???
441 //              assert(strlen(result) == s.length);
442 //              assert(memcmp(result, s, s.length) == 0);
443 //      }
445 body
447         char[] copy;
448         
449         if (s.length == 0)
450         {
451                 copy = "";
452         }
453         else
454         {
455                 // Need to make a copy
456                 copy = new char[s.length + 1];
457                 copy[0..s.length] = s;
458                 copy[s.length] = 0;
459         }
460         
461         return copy.ptr;
464         public static char** toStringzArray(char[][] args)
465         {
466                 if ( args is null )
467                 {
468                         return null;
469                 }
470                 char** argv = (new char*[args.length]).ptr;
471                 int argc = 0;
472                 foreach (char[] p; args)
473                 {
474                         argv[argc++] = cast(char*)(p~'\0');
475                 }
476                 argv[argc] = null;
477                 
478                 return argv;
479         }
481         public static char[][] toStringArray(char** args)
482         {
483                 if ( args is null )
484                 {
485                         return null;
486                 }
487                 char[][] argv;
488                 
489                 char* arg = args[0];
490                 int i=0;
491                 while( (arg) != null && i<10)
492                 {
493                         argv ~= toString(arg);
494                         ++i;
495                         arg = args[i];
496                 }
497                 
498                 return argv;
499         }
501         public static char[] toString(bool b)
502         {
503                 return b ? "true" : "false";
504         }
505         
506         public static char[] toString(char c)
507         {
508                 char[] result = new char[2];
509                 result[0] = c;
510                 result[1] = 0;
511                 return result[0 .. 1];
512         }
514         public static char[] toString(ubyte ub)  { return toString(cast(uint) ub); } /// ditto
515         public static char[] toString(ushort us) { return toString(cast(uint) us); } /// ditto
516         
517         public static char[] toString(uint u)
518         {   char[uint.sizeof * 3] buffer = void;
519                 int ndigits;
520                 char c;
521                 char[] result;
522         
523                 ndigits = 0;
524                 if (u < 10)
525                 // Avoid storage allocation for simple stuff
526                 result = digits[u .. u + 1];
527                 else
528                 {
529                 while (u)
530                 {
531                         c = (u % 10) + '0';
532                         u /= 10;
533                         ndigits++;
534                         buffer[buffer.length - ndigits] = c;
535                 }
536                 result = new char[ndigits];
537                 result[] = buffer[buffer.length - ndigits .. buffer.length];
538                 }
539                 return result;
540         }
542         public static char[] toString(ulong u)
543         {   char[ulong.sizeof * 3] buffer;
544                 int ndigits;
545                 char c;
546                 char[] result;
547         
548                 if (u < 0x1_0000_0000)
549                 return toString(cast(uint)u);
550                 ndigits = 0;
551                 while (u)
552                 {
553                 c = (u % 10) + '0';
554                 u /= 10;
555                 ndigits++;
556                 buffer[buffer.length - ndigits] = c;
557                 }
558                 result = new char[ndigits];
559                 result[] = buffer[buffer.length - ndigits .. buffer.length];
560                 return result;
561         }
563         public static char[] toString(byte b)  { return toString(cast(int) b); } /// ditto
564         public static char[] toString(short s) { return toString(cast(int) s); } /// ditto
565         
566         public static char[] toString(int i)
567         {   char[1 + int.sizeof * 3] buffer;
568                 char c;
569                 char[] result;
570         
571                 if (i >= 0)
572                 return toString(cast(uint)i);
573         
574                 uint u = -i;
575                 int ndigits = 1;
576                 while (u)
577                 {
578                 c = (u % 10) + '0';
579                 u /= 10;
580                 buffer[buffer.length - ndigits] = c;
581                 ndigits++;
582                 }
583                 buffer[buffer.length - ndigits] = '-';
584                 result = new char[ndigits];
585                 result[] = buffer[buffer.length - ndigits .. buffer.length];
586                 return result;
587         }
589 code: end
592 outFile: Str
594 file: glib-Character-Set-Conversion.html
595 class: CharacterSet
596 import: glib.ErrorG
597 prefix: g_
598 import: glib.Str
599 # these fail to compile because of a reference to a struct that size is not known
600 noprefix: g_convert_with_iconv
601 noprefix: g_iconv_open
602 noprefix: g_iconv
603 noprefix: g_iconv_close
604 outFile: CharacterSet
606 file: glib-Unicode-Manipulation.html
607 class: Unicode
608 import: glib.ErrorG
609 prefix: g_
610 import: glib.Str
611 outFile: Unicode
613 file: glib-I18N.html
614 class: Internationalization
615 prefix: g_
616 import: glib.Str
617 outFile: Internationalization
619 file: glib-Date-and-Time-Functions.html
620 struct: GDate
621 class: Date
622 prefix: g_date_
623 #import: glib.TimeVal
624 #structWrap: GTimeVal* TimeVal
625 #import: glib.Date
626 import: glib.Str
627 structWrap: GDate* Date
628 outFile: Date
630 file: glib-Random-Numbers.html
631 struct: GRand
632 class: RandG
633 prefix: g_
634 #import: glib.Rand
635 structWrap: GRand* RandG
636 outFile: RandG
638 #file: glib-Hook-Functions.html
639 #class: Hook
640 #prefix: g_hook_
641 ##import: glib.HookList
642 ##structWrap: GHookList* HookList
643 ##import: glib.Hook
644 #structWrap: GHook* Hook
645 #outFile: Hook
647 file: glib-Miscellaneous-Utility-Functions.html
648 class: Util
649 import: glib.ListG
650 structWrap: GList* ListG
651 prefix: g_
652 #import: glib.DebugKey
653 #structWrap: GDebugKey* DebugKey
654 import: glib.Str
656 outFile: Util
658 file: glib-Lexical-Scanner.html
659 struct: GScanner
660 class: ScannerG
661 import: glib.HashTable
662 structWrap: GHashTable* HashTable
663 prefix: g_scanner
664 #import: glib.Scanner
665 structWrap: GScanner* ScannerG
666 #import: glib.ScannerConfig
667 #structWrap: GScannerConfig* ScannerConfig
668 import: glib.Str
669 outFile: ScannerG
671 file: glib-Automatic-String-Completion.html
672 struct: GCompletion
673 class: StringCompletion
674 import: glib.ListG
675 structWrap: GList* ListG
676 prefix:g_completion_
677 import: glib.Str
678 outFile: StringCompletion
680 file: glib-Timers.html
681 struct: GTimer
682 class: Timer
683 prefix: g_timer
684 #import: glib.Timer
685 structWrap: GTimer* Timer
686 outFile: Timer
688 file: glib-Spawning-Processes.html
689 class: Spawn
690 import: glib.ErrorG
691 import: glib.MainLoop
692 structWrap: GMainLoop* MainLoop
693 prefix: g_spawn_
694 #import: glib.Pid
695 #structWrap: GPid* Pid
696 #import: glib.Error*
697 #structWrap: GError** Error*
698 import: glib.Str
699 import: std.thread
700 import: std.stdio
701 import: std.c.stdio
702 import: std.string
703 import: std.c.string
704 nocode: g_spawn_async_with_pipes
706 code: start
708         version(Tango) alias splitLines splitlines;
711         char[] workingDirectory = ".";
712         char[][] argv;
713         char[][] envp;
714         GSpawnFlags flags = SpawnFlags.SEARCH_PATH;
715         GSpawnChildSetupFunc childSetup; 
716         void* userData;
717         GPid childPid;
718         FILE* standardInput;
719         FILE* standardOutput;
720         FILE* standardError;
721         GError* error;
722         int stdIn;
723         int stdOut;
724         int stdErr;
726         // for commandLineSync
727         int exitStatus;
728         char* strOutput;
729         char* strError;
730         
731         alias bool delegate(Spawn) ChildWatch;
732         ChildWatch externalWatch;
733         
734         /**
735          * Creates a Spawn for execution.
736          */
737         public this(char[] program, char[][] envp=null)
738         {
739                 argv ~= program;
740                 this.envp = envp;
741         }
742         
743         /**
744          * Creates a Spawn for execution.
745          */
746         public this(char[][] program, char[][] envp=null)
747         {
748                 argv = program;
749                 this.envp = envp;
750         }
751         
752         /**
753          * Adds a delegate to be notified on the end of the child process.
754          * Params:
755          *      delegate(int =
756          *      dlg =
757          */
758         public void addChildWatch(ChildWatch dlg)
759         {
760                 externalWatch = dlg;
761         }
762         
763         /**
764          * Closes all open streams and child process.
765          */
766         public void close()
767         {
768                 if (stdIn != 0 )
769                 {
770                         fclose(standardInput);
771                         stdIn = 0;
772                 }
773                 if (stdOut != 0 )
774                 {
775                         fclose(standardOutput);
776                         stdOut = 0;
777                 }
778                 if (stdErr != 0 )
779                 {
780                         fclose(standardError);
781                         stdErr = 0;
782                 }
783                 if ( childPid != 0 )
784                 {
785                         closePid(childPid);
786                         childPid = 0;
787                 }
788         }
789         
790         /**
791          * Adds a parameter to the execution program
792          */
793         public void addParm(char[] parm)
794         {
795                 argv ~= parm;
796         }
798         /**
799          * Gets the last error message
800          */
801         public char[] getLastError()
802         {
803                 if ( error != null )
804                 {
805                         return Str.toString(error.message);
806                 }
807                 return "";
808         }
811         /**
812          * Executes the prepared process
813          */
814         public int execAsyncWithPipes(
815                 ChildWatch externalWatch = null,
816                 bool delegate(char[]) readOutput = null, 
817                 bool delegate(char[]) readError = null )
818         {
819                 int result = g_spawn_async_with_pipes(
820                 Str.toStringz(workingDirectory),
821                 Str.toStringzArray(argv),
822                 Str.toStringzArray(envp),
823                 flags,
824                 childSetup,
825                 userData,
826                 &childPid,
827                 &stdIn,
828                 &stdOut,
829                 &stdErr,
830                 &error
831                 );
832                 
833                 if ( result != 0 )
834                 {
835                         this.externalWatch = externalWatch;
836                         g_child_watch_add(childPid, cast(GChildWatchFunc)(&childWatchCallback), cast(void*)this);
837                         standardInput = fdopen(stdIn, "w");
838                         standardOutput = fdopen(stdOut, "r");
839                         standardError = fdopen(stdErr, "r");
840                         
841                         if ( readOutput !is null )
842                         {
843                                 (new ReadFile(standardOutput, readOutput)).start();
844                         }
845                         if ( readError !is null )
846                         {
847                                 (new ReadFile(standardError, readError)).start();
848                         }
849                 }
850                 
851                 return result;
852         }
853         
854         class ReadFile : Thread
855         {
856                 bool delegate(char[]) read;
857                 FILE* file;
858                 
859                 int lineCount;
860                 
861                 this(FILE* file, bool delegate (char[]) read )
862                 {
863                         this.file = file;
864                         this.read = read;
865                 }
866                 
867                 public int run()
868                 {
869                         char[] line = readLine(file);
870                         while( line !is null )
871                         {
872                                 ++lineCount;
873                                 //writefln("Spawn.ReadFile.run line (%s) ========== >>>%s<<<", lineCount, line);
874                                 //printf("Spawn.ReadFile.run line (%d) ========== >>>%.*s<<<", lineCount, line);
875                                 if ( read !is null )
876                                 {
877                                         read(line);
878                                 }
879                                 line = readLine(file);
880                         }
881                         return 0;               
882                 }
883         }
884         
885         private char[] readLine(FILE* stream, int max=4096)
886         {
887                 if ( feof(stream) )
888                 {
889                         if ( externalWatch !is null )
890                         {
891                                 externalWatch(this);
892                         }
893                         return null;
894                 }
895                 char[] line;
896                 line.length = max+1;
897                 char* lineP = fgets(line.ptr, max, stream);
898                 if ( lineP is null )
899                 {
900                         return "";
901                 }
902                 int l = strlen(line.ptr);
903                 if ( l > 0 ) --l;
904                 //printf("\nreadLine\n");
905                 //foreach ( char c ; line )
906                 //{
907                 //        printf("%c", c);
908                 //}
909                 //printf("\n\n");
910                 return line[0..l];              
911         }
912         
913         extern(C) static void childWatchCallback(int pid, int status, Spawn spawn)
914         {
915                 //writefln("Spawn.childWatchCallback %s %s", pid, status);
916                 spawn.exitStatus = status;
917                 if ( spawn.externalWatch !is null )
918                 {
919                         spawn.externalWatch(spawn);
920                 }
921                 spawn.close();
922         }
923         
925         public bool endOfOutput()
926         {
927                 if ( standardOutput is null ) return true;
928                 return feof(standardOutput) != 0;
929         }
930         
931         public bool endOfError()
932         {
933                 if ( standardError is null ) return true;
934                 return feof(standardError) != 0;
935         }
936         
937         char[] getOutputString()
938         {
939                 return Str.toString(strOutput);
940         }
941         
942         char[] getErrorString()
943         {
944                 return Str.toString(strError);
945         }
946         
947         int getExitStatus()
948         {
949                 return exitStatus;
950         }
952 // old version
953 //      public int commandLineSync()
954 //      {
955 //              char[] commandLine;
956 //              foreach ( int count, char[] arg; argv)
957 //              {
958 //                      if ( count > 0 )
959 //                      {
960 //                              commandLine ~= ' ';
961 //                      }
962 //                      commandLine ~= arg;
963 //              }
964 //              return g_spawn_command_line_sync(
965 //              
966 //                      Str.toStringz(commandLine), 
967 //                      &strOutput, 
968 //                      &strError, 
969 //                      &exitStatus, 
970 //                      &error);
971 //      }
972         
973         /**
974          * Executes a command synchronasly and 
975          * optionally calls delegates for sysout, syserr and end of job
976          * 
977          */
978         public int commandLineSync(
979                 ChildWatch externalWatch = null,
980                 bool delegate(char[]) readOutput = null,
981                 bool delegate(char[]) readError = null )
982         {
983                 char[] commandLine;
984                 foreach ( int count, char[] arg; argv)
985                 {
986                         if ( count > 0 )
987                         {
988                                 commandLine ~= ' ';
989                         }
990                         commandLine ~= arg;
991                 }
992                 int status = g_spawn_command_line_sync(
993                                 Str.toStringz(commandLine),
994                                 &strOutput,
995                                 &strError,
996                                 &exitStatus,
997                                 &error);
998                 if ( readOutput != null )
999                 {
1000                         foreach ( char[] line ; splitlines(Str.toString(strOutput)) )
1001                         {
1002                                 readOutput(line);
1003                         }
1004                 }
1005                 if ( readError != null )
1006                 {
1007                         foreach ( char[] line ; splitlines(Str.toString(strError)) )
1008                         {
1009                                 readError(line);
1010                         }
1011                 }
1012                 if ( externalWatch != null )
1013                 {
1014                         externalWatch(this);
1015                 }
1016                 return status;
1017         }
1018         
1020         
1022 code: end
1024 outFile: Spawn
1026 file: glib-File-Utilities.html
1027 class: FileUtils
1028 import: std.stdio
1029 import: glib.Str
1030 prefix: g_
1031 #import: glib.ErrorG
1032 #import: glib.Error*
1033 #structWrap: GError** Error*
1034 #import: glib.Dir
1035 #structWrap: GDir* Dir
1036 #import: glib.MappedFile
1037 #structWrap: GMappedFile* MappedFile
1038 outFile: FileUtils
1040 file: glib-Shell-related-Utilities.html
1041 class: ShellUtils
1042 import: glib.ErrorG
1043 prefix: g_shell_
1044 import: glib.Str
1045 outFile: ShellUtils
1047 file: glib-Commandline-option-parser.html
1049 struct: GOptionContext
1050 class: OptionContext
1051 import: glib.ErrorG
1052 prefix: g_option_context_
1053 noprefix: g_option_group_
1054 #import: glib.Error*
1055 #structWrap: GError** Error*
1056 #import: glib.OptionEntry
1057 #structWrap: GOptionEntry* OptionEntry
1058 import: glib.OptionGroup
1059 structWrap: GOptionGroup* OptionGroup
1060 import: glib.Str
1061 outFile: OptionContext
1063 struct: GOptionGroup
1064 class: OptionGroup
1065 import: glib.Dataset
1066 structWrap: GDataset* Dataset
1067 import: glib.OptionContext
1068 structWrap: GOptionContext* OptionContext
1069 prefix: g_option_group_
1070 strictPrefix: Yes
1071 #import: glib.OptionEntry
1072 #structWrap: GOptionEntry* OptionEntry
1073 import: glib.Str
1074 outFile: OptionGroup
1076 file: glib-Glob-style-pattern-matching.html
1077 struct: GPatternSpec
1078 class: Pattern
1079 prefix: g_pattern_spec_
1080 prefix: g_pattern_match_
1081 #import: glib.PatternSpec
1082 structWrap: GPatternSpec* Pattern
1083 import: glib.Str
1084 outFile: Pattern
1086 file: glib-Simple-XML-Subset-Parser.html
1087 struct: GMarkupParseContext
1088 class: SimpleXML
1089 import: glib.ErrorG
1090 import: glib.Dataset
1091 structWrap: GDataset* Dataset
1092 prefix: g_markup_parse_context_
1093 #import: glib.Error*
1094 #structWrap: GError** Error*
1095 #import: glib.MarkupParser
1096 #structWrap: GMarkupParser* MarkupParser
1097 import: glib.Str
1098 outFile: SimpleXML
1100 file: glib-Key-value-file-parser.html
1101 struct: GKeyFile
1102 class: KeyFile
1103 import: glib.ErrorG
1104 import: glib.Str
1105 prefix: g_key_file_
1106 outFile: GKeyFile
1108 file: glib-Windows-Compatibility-Functions.html
1109 class: WindowsUtils
1110 prefix: g_win32_
1111 import: glib.Str
1112 outFile: WindowsUtils
1115 ###########################################################
1116 ### GLib Data Types #######################################
1117 ###########################################################
1119 file: glib-Memory-Slices.html
1120 class: MemorySlice
1121 prefix: g_slice_
1122 outFile: MemorySlice
1124 file: glib-Memory-Chunks.html
1125 struct: GMemChunk
1126 class: MemoryChunk
1127 prefix: g_mem_chunk_
1128 import: glib.Str
1129 outFile: MemoryChunk
1131 file: glib-Doubly-Linked-Lists.html
1132 struct: GList
1133 class: ListG
1134 prefix: g_list_
1135 #import: glib.ListG
1136 structWrap: GList* ListG
1138 code: start
1139    
1140         void* data()
1141         {
1142                 int* pt =cast(int*)getStruct();
1143                 return cast(void *)(*pt);
1144         }
1145          
1148 code: end
1150 outFile: ListG
1152 file: glib-Singly-Linked-Lists.html
1153 struct: GSList
1154 class: ListSG
1155 import: glib.ListG
1156 prefix: g_slist_
1157 #import: glib.ListSG
1158 structWrap: GSList* ListSG
1159 outFile: ListSG
1161 file: glib-Double-ended-Queues.html
1162 struct: GQueue
1163 class: QueueG
1164 import: glib.ListG
1165 prefix: g_queue_
1166 #import: glib.QueueG
1167 structWrap: GQueue* QueueG
1168 import: glib.ListG
1169 structWrap: GList* ListG
1170 outFile: QueueG
1172 file: glib-Trash-Stacks.html
1173 struct: GTrashStack
1174 class: TrashStack
1175 prefix: g_trash_stack_
1176 #import: glib.TrashStack*
1177 #structWrap: GTrashStack** TrashStack*
1178 outFile: TrashStack
1180 file: glib-Hash-Tables.html
1181 struct: GHashTable
1182 class: HashTable
1183 import: glib.Dataset
1184 prefix: g_hash_table_
1185 #import: glib.HashTable
1186 structWrap: GHashTable* HashTable
1187 outFile: HashTable
1189 file: glib-Strings.html
1190 struct: GString
1191 class: StringG
1192 prefix: g_string_
1193 #import: glib.StringG
1194 structWrap: GString* StringG
1195 import: glib.Str
1196 outFile: StringG
1198 file: glib-String-Chunks.html
1199 struct: GStringChunk
1200 class: StringGChunk
1201 prefix: g_string_chunk_
1202 import: glib.Str
1203 outFile: StringGChunk
1205 file: glib-Arrays.html
1206 struct: GArray
1207 class: ArrayG
1208 import: glib.ListG
1209 prefix: g_array_
1210 #import: glib.Array
1211 structWrap: GArray* ArrayG
1212 import: glib.Str
1213 outFile: ArrayG
1215 file: glib-Pointer-Arrays.html
1216 struct: GPtrArray
1217 class: PtrArray
1218 import: glib.ListG
1219 structWrap: GList* ListG
1220 prefix: g_ptr_array_
1221 #import: glib.PtrArray
1222 structWrap: GPtrArray* PtrArray
1223 outFile: PtrArray
1225 file: glib-Byte-Arrays.html
1226 struct: GByteArray
1227 class: ByteArray
1228 import: glib.ListG
1229 structWrap: GList* ListG
1230 prefix: g_byte_array_
1231 outFile: ByteArray
1233 file: glib-Balanced-Binary-Trees.html
1234 struct: GTree
1235 class: BBTree
1236 import: glib.ListG
1237 import: glib.Dataset
1238 structWrap: GList* List*
1239 structWrap: GDataset* Dataset
1240 prefix: g_tree_
1241 outFile: BBTree
1243 file: glib-N-ary-Trees.html
1244 struct: GNode
1245 class: Node
1246 import: glib.BBTree
1247 structWrap: GTree* BBTree
1248 structWrap: GNode* Node
1249 prefix: g_node_
1250 outFile: Node
1252 file: glib-Quarks.html
1253 struct: GQuark
1254 class: Quark
1255 import: glib.ErrorG
1256 prefix: g_quark_
1257 import: glib.Str
1258 outFile: Quark
1260 file: glib-Keyed-Data-Lists.html
1261 struct: GData
1262 class: DataList
1263 prefix: g_datalist_
1264 import: glib.Quark
1265 import: glib.Dataset
1266 structWrap: GDataset* Dataset
1267 outFile: DataList
1269 file: glib-Datasets.html
1270 class: Dataset
1271 prefix: g_dataset_
1272 import: glib.Quark
1273 outFile: Dataset
1275 file: glib-Relations-and-Tuples.html
1276 struct: GRelation
1277 class: Relation
1278 import: glib.HashTable
1279 structWrap: GHashTable* HashTable
1280 prefix: g_relation_
1281 noprefix: g_tuples_
1282 import: glib.Tuples
1283 structWrap: GTuples* Tuples
1284 outFile: Relation
1286 struct: GTuples
1287 class: Tuples
1288 prefix: g_tuples_
1289 strictPrefix: Yes
1290 outFile: Tuples
1292 file: glib-Caches.html
1293 struct: GCache
1294 class: Cache
1295 import: glib.HashTable
1296 structWrap: GHashTable* HashTable
1297 prefix: g_cache_
1298 outFile: Cache
1300 file: glib-Memory-Allocators.html
1301 struct: GAllocator
1302 class: Allocator
1303 prefix: g_allocator_
1304 import: glib.Str
1305 outFile: Allocator
1307 ###########################################################
1308 ### GLib Tools ############################################
1309 ###########################################################