alternative to assert
[gtkD.git] / wrap / APILookupGLib.txt
blob9c66fff5e5355682e3e70201b87d9784ddddcf69
2 # This file is part of duit.
3
4 # duit 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 # duit 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 duit; 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;
61 addTypedefs: end
63 addAliases: start
64 addAliases: end
66 addEnums: start
67 addEnums: end
69 addStructs: start
70 addStructs: end
72 addTypes: start
73 addTypes: end
75 addFuncts: start
76 addFuncts: end
78 addUnions: start
79 addUnions: end
81 addConstants: start
83 const uint G_MAXUINT = 4294967295;
85 addConstants: end
88 # must start with wrap
90 wrap: glib
92 ###########################################################
93 ### GLib Fundamentals #####################################
94 ###########################################################
96 file: glib-Version-Information.html
97 class: Version
98 prefix: glib_
99 import: glib.Str
100 outFile: GLib
102 #file: glib-Basic-Types.html
103 #outFile: types
105 #file: glib-Limits-of-Basic-Types.html
106 #outFile: typeLimits
108 #file: glib-Standard-Macros.html
109 #class: 
110 #prefix: 
111 #outFile: 
113 #file: glib-Type-Conversion-Macros.html
114 #class: 
115 #prefix: 
116 #outFile: 
118 #file: glib-Byte-Order-Macros.html
119 #class: 
120 #prefix: 
121 #outFile: 
123 #file: glib-Numerical-Definitions.html
124 #class: 
125 #prefix: 
126 #outFile: 
128 #file: glib-Miscellaneous-Macros.html
129 #class: 
130 #prefix: 
131 #outFile: 
133 file: glib-Atomic-Operations.html
134 class: Atomic
135 prefix: g_atomic_
136 outFile: Atomic
138 ###########################################################
139 ### GLib Core Application Support #########################
140 ###########################################################
142 file: glib-The-Main-Event-Loop.html
144 struct: GMainLoop
145 class: MainLoop
146 prefix: g_main_loop_
147 noprefix: g_main_context_
148 noprefix: g_timeout_
149 noprefix: g_child_
150 noprefix: g_source_
151 import: glib.Dataset
152 structWrap: GDataset* Dataset
153 import: glib.MainContext
154 structWrap: GMainContext* MainContext
155 import: glib.Source
156 structWrap: GSource* Source
157 nocode: g_main_loop_ref
158 code: start
159         /**
160          * Increases the reference count on a GMainLoop object by one.
161          * loop:
162          *  a GMainLoop
163          * Returns:
164          *  loop
165          */
166         public MainLoop ref()
167         {
168                 // GMainLoop* g_main_loop_ref (GMainLoop *loop);
169                 return new MainLoop( g_main_loop_ref(gMainLoop) );
170         }
171 code: end       
172 outFile: MainLoop
174 struct: GMainContext
175 class: MainContext
176 prefix: g_main_context_
177 strictPrefix: Yes
178 import: glib.MainLoop
179 structWrap: GMainLLoop* MainLoop
180 import: glib.Source
181 structWrap: GSource* Source
182 import: gthread.Cond
183 structWrap: GCond* Cond
184 import: gthread.Mutex
185 structWrap: GMutex* Mutex
186 import: glib.ThreadPool
187 structWrap: GThreadPoll* ThreadPoll
188 import: glib.MainContext
189 structWrap: GMainContext* MainContext
190 #import: glib.SourceFuncs
191 #structWrap: GSourceFuncs* SourceFuncs
192 #import: glib.PollFD
193 #structWrap: GPollFD* PollFD
194 outFile: MainContext
196 class: Timeout
197 import: glib.MainLoop
198 structWrap: GMainLoop* MainLoop
199 import: glib.Dataset
200 structWrap: GDataset* Dataset
201 prefix: g_timeout_
202 strictPrefix: Yes
203 import: glib.Source
204 structWrap: GSource* Source
205 outFile: Timeout
207 class: Child
208 import: glib.MainLoop
209 structWrap: GMainLoop* MainLoop
210 import: glib.Dataset
211 structWrap: GDataset* Dataset
212 prefix: g_child_
213 strictPrefix: Yes
214 outFile: Child
216 struct: GSource
217 class: Source
218 import: glib.MainLoop
219 structWrap: GMainLoop* MainLoop
220 import: glib.Dataset
221 structWrap: GDataset* Dataset
222 import: glib.Date
223 structWrap: GDate* Date
224 prefix: g_source_
225 strictPrefix: Yes
226 #import: glib.SourceFuncs
227 #structWrap: GSourceFuncs* SourceFuncs
228 import: glib.Source
229 structWrap: GSource* Source
230 import: glib.MainContext
231 structWrap: GMainContext* MainContext
232 #import: glib.SourceCallbackFuncs
233 #structWrap: GSourceCallbackFuncs* SourceCallbackFuncs
234 #import: glib.PollFD
235 #structWrap: GPollFD* PollFD
236 #import: glib.TimeVal
237 #structWrap: GTimeVal* TimeVal
238 outFile: Source
241 file: /home/ruimt/data/down/GTK/API/glib/glib-Threads.html
242 #struct: GThread
243 #class: Thread
244 #import: glib.ErrorG
245 #import: gthread.Mutex
246 #structWrap: GMutex* Mutex
247 #import: glib.Source
248 #structWrap: GSource* Source
249 #import: glib.Dataset
250 #structWrap: GDataset* Dataset
251 #import: glib.ListG
252 #structWrap: GList* ListG
253 #prefix: g_thread_
254 #noprefix: g_mutex_
255 #noprefix: g_static_rec_mutex_
256 #noprefix: g_static_rw_lock_
257 #noprefix: g_cond_
258 #noprefix: g_private_
259 #noprefix: g_static_private_
260 ##import: glib.ThreadFunctions
261 ##structWrap: GThreadFunctions* ThreadFunctions
262 #structWrap: GThread* Thread
263 ##import: glib.Error*
264 ##structWrap: GError** Error*
265 ##import: glib.StaticMutex
266 ##structWrap: GStaticMutex* StaticMutex
267 #outFile: Thread
269 #struct: GMutex
270 #class: Mutex
271 #prefix: g_mutex_
272 #strictPrefix: Yes
273 #outFile: Mutex
275 #struct: GStaticRecMutex
276 #class: StaticRecMutex
277 #prefix: g_static_rec_mutex_
278 #strictPrefix: Yes
279 #outFile: StaticRecMutex
281 #struct: GStaticRWLock
282 #class: RWLock
283 #prefix: g_static_rw_lock_
284 #strictPrefix: Yes
285 #outFile: RWLock
287 #struct: GCond
288 #class: Cond
289 #import: glib.Date
290 #structWrap: GDate* Date
291 #prefix: g_cond_
292 #strictPrefix: Yes
293 #import: gthread.Mutex
294 #structWrap: GMutex* Mutex
295 ##import: glib.TimeVal
296 ##structWrap: GTimeVal* TimeVal
297 #outFile: Cond
299 #struct: GPrivate
300 #class: Private
301 #import: glib.Dataset
302 #structWrap: GDataset* Dataset
303 #prefix: g_private_
304 #strictPrefix: Yes
305 #outFile: Private
307 #struct: GStaticPrivate
308 #class: StaticPrivate
309 #import: glib.Dataset
310 #structWrap: GDataset* Dataset
311 #prefix: g_static_private_
312 #strictPrefix: Yes
313 #outFile: StaticPrivate
323 file: glib-Thread-Pools.html
324 struct: GThreadPool
325 class: ThreadPool
326 import: glib.ErrorG
327 import: glib.ListG
328 structWrap: GList* ListG
329 prefix: g_thread_pool_
330 import: glib.MainLoop
331 outFile: ThreadPool
334 file: glib-Asynchronous-Queues.html
335 struct: GAsyncQueue
336 class: AsyncQueue
337 prefix: g_async_queue_
338 import: glib.ListG
339 import: glib.Date
340 import: glib.AsyncQueue
341 structWrap: GAsyncQueue* AsyncQueue
342 #import: glib.TimeVal
343 #structWrap: GTimeVal* TimeVal
344 outFile: AsyncQueue
346 file: glib-Dynamic-Loading-of-Modules.html
347 struct: GModule
348 class: Module
349 prefix: g_module_
350 import: glib.Module
351 structWrap: GModule* Module
352 import: glib.Str
353 outFile: Module
356 file: glib-Memory-Allocation.html
357 class: Memory
358 prefix: g_
359 #import: glib.MemVTable
360 #structWrap: GMemVTable* MemVTable
361 outFile: Memory
364 file: glib-IO-Channels.html
365 struct: GIOChannel
366 class: IOChannel
367 prefix: g_io_channel_
368 import: glib.ErrorG
369 import: glib.StringG
370 import: glib.Source
371 import: glib.Dataset
372 import: glib.Str
373 structWrap: GString* StringG
374 structWrap: GSource* Source
375 #import: glib.IOChannel
376 structWrap: GIOChannel* IOChannel
377 outFile: IOChannel
380 file: glib-Error-Reporting.html
381 struct: GError
382 class: ErrorG
383 import: glib.Quark
384 import: glib.Str
385 prefix: g_error_
386 outFile: ErrorG
389 file: glib-Warnings-and-Assertions.html
390 class: Messages
391 prefix: g_
392 import: glib.Str
393 outFile: Messages
395 file: glib-Message-Logging.html
396 class: MessageLog
397 prefix: g_
398 import: glib.Str
399 outFile: MessageLog
402 ###########################################################
403 ### GLib Utilities ########################################
404 ###########################################################
406 file: glib-String-Utility-Functions.html
407 class: Str
408 import: std.stdio
409 import: glib.StringG
410 structWrap: GString* StringG
411 import: std.c.string
412 prefix: g_
414 code: start
416 const static char[10] digits    = "0123456789";                 /// 0..9
418 /*************************************************
419  * Convert C-style 0 terminated string s to char[] string.
420  * copied from phobos
421  */
422 public static char[] toString(char *s)
424     return s ? s[0 .. strlen(s)] : cast(char[])null;
427 /*********************************
428  * Convert array of chars s[] to a C-style 0 terminated string.
429  * copied from phobos
430  */
431 public static char* toStringz(char[] s)
435 out (result)
437 //      if (result)
438 //      {
439 //              // TODO this one fails in some case???
440 //              assert(strlen(result) == s.length);
441 //              assert(memcmp(result, s, s.length) == 0);
442 //      }
444 body
446         char[] copy;
447         
448         if (s.length == 0)
449         {
450                 copy = "";
451         }
452         else
453         {
454                 // Need to make a copy
455                 copy = new char[s.length + 1];
456                 copy[0..s.length] = s;
457                 copy[s.length] = 0;
458         }
459         
460         return copy.ptr;
463         public static char** toStringzArray(char[][] args)
464         {
465                 if ( args is null )
466                 {
467                         return null;
468                 }
469                 char** argv = (new char*[args.length]).ptr;
470                 int argc = 0;
471                 foreach (char[] p; args)
472                 {
473                         argv[argc++] = cast(char*)(p~'\0');
474                 }
475                 argv[argc] = null;
476                 
477                 return argv;
478         }
480         public static char[][] toStringArray(char** args)
481         {
482                 if ( args is null )
483                 {
484                         return null;
485                 }
486                 char[][] argv;
487                 
488                 char* arg = args[0];
489                 int i=0;
490                 while( (arg) != null && i<10)
491                 {
492                         argv ~= toString(arg);
493                         ++i;
494                         arg = args[i];
495                 }
496                 
497                 return argv;
498         }
500         public static char[] toString(bool b)
501         {
502                 return b ? "true" : "false";
503         }
504         
505         public static char[] toString(char c)
506         {
507                 char[] result = new char[2];
508                 result[0] = c;
509                 result[1] = 0;
510                 return result[0 .. 1];
511         }
513         public static char[] toString(ubyte ub)  { return toString(cast(uint) ub); } /// ditto
514         public static char[] toString(ushort us) { return toString(cast(uint) us); } /// ditto
515         
516         public static char[] toString(uint u)
517         {   char[uint.sizeof * 3] buffer = void;
518                 int ndigits;
519                 char c;
520                 char[] result;
521         
522                 ndigits = 0;
523                 if (u < 10)
524                 // Avoid storage allocation for simple stuff
525                 result = digits[u .. u + 1];
526                 else
527                 {
528                 while (u)
529                 {
530                         c = (u % 10) + '0';
531                         u /= 10;
532                         ndigits++;
533                         buffer[buffer.length - ndigits] = c;
534                 }
535                 result = new char[ndigits];
536                 result[] = buffer[buffer.length - ndigits .. buffer.length];
537                 }
538                 return result;
539         }
541         public static char[] toString(ulong u)
542         {   char[ulong.sizeof * 3] buffer;
543                 int ndigits;
544                 char c;
545                 char[] result;
546         
547                 if (u < 0x1_0000_0000)
548                 return toString(cast(uint)u);
549                 ndigits = 0;
550                 while (u)
551                 {
552                 c = (u % 10) + '0';
553                 u /= 10;
554                 ndigits++;
555                 buffer[buffer.length - ndigits] = c;
556                 }
557                 result = new char[ndigits];
558                 result[] = buffer[buffer.length - ndigits .. buffer.length];
559                 return result;
560         }
562         public static char[] toString(byte b)  { return toString(cast(int) b); } /// ditto
563         public static char[] toString(short s) { return toString(cast(int) s); } /// ditto
564         
565         public static char[] toString(int i)
566         {   char[1 + int.sizeof * 3] buffer;
567                 char c;
568                 char[] result;
569         
570                 if (i >= 0)
571                 return toString(cast(uint)i);
572         
573                 uint u = -i;
574                 int ndigits = 1;
575                 while (u)
576                 {
577                 c = (u % 10) + '0';
578                 u /= 10;
579                 buffer[buffer.length - ndigits] = c;
580                 ndigits++;
581                 }
582                 buffer[buffer.length - ndigits] = '-';
583                 result = new char[ndigits];
584                 result[] = buffer[buffer.length - ndigits .. buffer.length];
585                 return result;
586         }
588 code: end
591 outFile: Str
593 file: glib-Character-Set-Conversion.html
594 class: CharacterSet
595 import: glib.ErrorG
596 prefix: g_
597 import: glib.Str
598 # these fail to compile because of a reference to a struct that size is not known
599 noprefix: g_convert_with_iconv
600 noprefix: g_iconv_open
601 noprefix: g_iconv
602 noprefix: g_iconv_close
603 outFile: CharacterSet
605 file: glib-Unicode-Manipulation.html
606 class: Unicode
607 import: glib.ErrorG
608 prefix: g_
609 import: glib.Str
610 outFile: Unicode
612 file: glib-I18N.html
613 class: Internationalization
614 prefix: g_
615 import: glib.Str
616 outFile: Internationalization
618 file: glib-Date-and-Time-Functions.html
619 struct: GDate
620 class: Date
621 prefix: g_date_
622 #import: glib.TimeVal
623 #structWrap: GTimeVal* TimeVal
624 #import: glib.Date
625 import: glib.Str
626 structWrap: GDate* Date
627 outFile: Date
629 file: glib-Random-Numbers.html
630 struct: GRand
631 class: RandG
632 prefix: g_
633 #import: glib.Rand
634 structWrap: GRand* RandG
635 outFile: RandG
637 #file: glib-Hook-Functions.html
638 #class: Hook
639 #prefix: g_hook_
640 ##import: glib.HookList
641 ##structWrap: GHookList* HookList
642 ##import: glib.Hook
643 #structWrap: GHook* Hook
644 #outFile: Hook
646 file: glib-Miscellaneous-Utility-Functions.html
647 class: Util
648 import: glib.ListG
649 structWrap: GList* ListG
650 prefix: g_
651 #import: glib.DebugKey
652 #structWrap: GDebugKey* DebugKey
653 import: glib.Str
655 outFile: Util
657 file: glib-Lexical-Scanner.html
658 struct: GScanner
659 class: ScannerG
660 import: glib.HashTable
661 structWrap: GHashTable* HashTable
662 prefix: g_scanner
663 #import: glib.Scanner
664 structWrap: GScanner* ScannerG
665 #import: glib.ScannerConfig
666 #structWrap: GScannerConfig* ScannerConfig
667 import: glib.Str
668 outFile: ScannerG
670 file: glib-Automatic-String-Completion.html
671 struct: GCompletion
672 class: StringCompletion
673 import: glib.ListG
674 structWrap: GList* ListG
675 prefix:g_completion_
676 import: glib.Str
677 outFile: StringCompletion
679 file: glib-Timers.html
680 struct: GTimer
681 class: Timer
682 prefix: g_timer
683 #import: glib.Timer
684 structWrap: GTimer* Timer
685 outFile: Timer
687 file: glib-Spawning-Processes.html
688 class: Spawn
689 import: glib.ErrorG
690 import: glib.MainLoop
691 structWrap: GMainLoop* MainLoop
692 prefix: g_spawn_
693 #import: glib.Pid
694 #structWrap: GPid* Pid
695 #import: glib.Error*
696 #structWrap: GError** Error*
697 import: glib.Str
698 import: std.thread
699 import: std.stdio
700 import: std.string;
701 import: std.c.string;
702 nocode: g_spawn_async_with_pipes
704 code: start
706         char[] workingDirectory = ".";
707         char[][] argv;
708         char[][] envp;
709         GSpawnFlags flags = SpawnFlags.SEARCH_PATH;
710         GSpawnChildSetupFunc childSetup; 
711         void* userData;
712         GPid childPid;
713         FILE* standardInput;
714         FILE* standardOutput;
715         FILE* standardError;
716         GError* error;
717         int stdIn;
718         int stdOut;
719         int stdErr;
721         // for commandLineSync
722         int exitStatus;
723         char* strOutput;
724         char* strError;
725         
726         alias bool delegate(Spawn) ChildWatch;
727         ChildWatch externalWatch;
728         
729         /**
730          * Creates a Spawn for execution.
731          */
732         public this(char[] program, char[][] envp=null)
733         {
734                 argv ~= program;
735                 this.envp = envp;
736         }
737         
738         /**
739          * Creates a Spawn for execution.
740          */
741         public this(char[][] program, char[][] envp=null)
742         {
743                 argv = program;
744                 this.envp = envp;
745         }
746         
747         /**
748          * Adds a delegate to be notified on the end of the child process.
749          * Params:
750          *      delegate(int =
751          *      dlg =
752          */
753         public void addChildWatch(ChildWatch dlg)
754         {
755                 externalWatch = dlg;
756         }
757         
758         /**
759          * Closes all open streams and child process.
760          */
761         public void close()
762         {
763                 if (stdIn != 0 )
764                 {
765                         fclose(standardInput);
766                         stdIn = 0;
767                 }
768                 if (stdOut != 0 )
769                 {
770                         fclose(standardOutput);
771                         stdOut = 0;
772                 }
773                 if (stdErr != 0 )
774                 {
775                         fclose(standardError);
776                         stdErr = 0;
777                 }
778                 if ( childPid != 0 )
779                 {
780                         closePid(childPid);
781                         childPid = 0;
782                 }
783         }
784         
785         /**
786          * Adds a parameter to the execution program
787          */
788         public void addParm(char[] parm)
789         {
790                 argv ~= parm;
791         }
793         /**
794          * Gets the last error message
795          */
796         public char[] getLastError()
797         {
798                 if ( error != null )
799                 {
800                         return Str.toString(error.message);
801                 }
802                 return "";
803         }
806         /**
807          * Executes the prepared process
808          */
809         public int execAsyncWithPipes(
810                 ChildWatch externalWatch = null,
811                 bool delegate(char[]) readOutput = null, 
812                 bool delegate(char[]) readError = null )
813         {
814                 int result = g_spawn_async_with_pipes(
815                 Str.toStringz(workingDirectory),
816                 Str.toStringzArray(argv),
817                 Str.toStringzArray(envp),
818                 flags,
819                 childSetup,
820                 userData,
821                 &childPid,
822                 &stdIn,
823                 &stdOut,
824                 &stdErr,
825                 &error
826                 );
827                 
828                 if ( result != 0 )
829                 {
830                         this.externalWatch = externalWatch;
831                         g_child_watch_add(childPid, cast(GChildWatchFunc)(&childWatchCallback), this);
832                         standardInput = fdopen(stdIn, "w");
833                         standardOutput = fdopen(stdOut, "r");
834                         standardError = fdopen(stdErr, "r");
835                         
836                         if ( readOutput !is null )
837                         {
838                                 (new ReadFile(standardOutput, readOutput)).start();
839                         }
840                         if ( readError !is null )
841                         {
842                                 (new ReadFile(standardError, readError)).start();
843                         }
844                 }
845                 
846                 return result;
847         }
848         
849         class ReadFile : Thread
850         {
851                 bool delegate(char[]) read;
852                 FILE* file;
853                 
854                 int lineCount;
855                 
856                 this(FILE* file, bool delegate (char[]) read )
857                 {
858                         this.file = file;
859                         this.read = read;
860                 }
861                 
862                 public int run()
863                 {
864                         char[] line = readLine(file);
865                         while( line !is null )
866                         {
867                                 ++lineCount;
868                                 //writefln("Spawn.ReadFile.run line (%s) ========== >>>%s<<<", lineCount, line);
869                                 //printf("Spawn.ReadFile.run line (%d) ========== >>>%.*s<<<", lineCount, line);
870                                 if ( read !is null )
871                                 {
872                                         read(line);
873                                 }
874                                 line = readLine(file);
875                         }
876                         return 0;               
877                 }
878         }
879         
880         private char[] readLine(FILE* stream, int max=4096)
881         {
882                 if ( feof(stream) )
883                 {
884                         if ( externalWatch !is null )
885                         {
886                                 externalWatch(this);
887                         }
888                         return null;
889                 }
890                 char[] line;
891                 line.length = max+1;
892                 char* lineP = fgets(line.ptr, max, stream);
893                 if ( lineP is null )
894                 {
895                         return "";
896                 }
897                 int l = strlen(line.ptr);
898                 if ( l > 0 ) --l;
899                 //printf("\nreadLine\n");
900                 //foreach ( char c ; line )
901                 //{
902                 //        printf("%c", c);
903                 //}
904                 //printf("\n\n");
905                 return line[0..l];              
906         }
907         
908         extern(C) static void childWatchCallback(int pid, int status, Spawn spawn)
909         {
910                 //writefln("Spawn.childWatchCallback %s %s", pid, status);
911                 spawn.exitStatus = status;
912                 if ( spawn.externalWatch !is null )
913                 {
914                         spawn.externalWatch(spawn);
915                 }
916                 spawn.close();
917         }
918         
920         public bool endOfOutput()
921         {
922                 if ( standardOutput is null ) return true;
923                 return feof(standardOutput) != 0;
924         }
925         
926         public bool endOfError()
927         {
928                 if ( standardError is null ) return true;
929                 return feof(standardError) != 0;
930         }
931         
932         char[] getOutputString()
933         {
934                 return Str.toString(strOutput);
935         }
936         
937         char[] getErrorString()
938         {
939                 return Str.toString(strError);
940         }
941         
942         int getExitStatus()
943         {
944                 return exitStatus;
945         }
947 // old version
948 //      public int commandLineSync()
949 //      {
950 //              char[] commandLine;
951 //              foreach ( int count, char[] arg; argv)
952 //              {
953 //                      if ( count > 0 )
954 //                      {
955 //                              commandLine ~= ' ';
956 //                      }
957 //                      commandLine ~= arg;
958 //              }
959 //              return g_spawn_command_line_sync(
960 //              
961 //                      Str.toStringz(commandLine), 
962 //                      &strOutput, 
963 //                      &strError, 
964 //                      &exitStatus, 
965 //                      &error);
966 //      }
967         
968         /**
969          * Executes a command synchronasly and 
970          * optionally calls delegates for sysout, syserr and end of job
971          * 
972          */
973         public int commandLineSync(
974                 ChildWatch externalWatch = null,
975                 bool delegate(char[]) readOutput = null,
976                 bool delegate(char[]) readError = null )
977         {
978                 char[] commandLine;
979                 foreach ( int count, char[] arg; argv)
980                 {
981                         if ( count > 0 )
982                         {
983                                 commandLine ~= ' ';
984                         }
985                         commandLine ~= arg;
986                 }
987                 int status = g_spawn_command_line_sync(
988                                 Str.toStringz(commandLine),
989                                 &strOutput,
990                                 &strError,
991                                 &exitStatus,
992                                 &error);
993                 if ( readOutput != null )
994                 {
995                         foreach ( char[] line ; splitlines(Str.toString(strOutput)) )
996                         {
997                                 readOutput(line);
998                         }
999                 }
1000                 if ( readError != null )
1001                 {
1002                         foreach ( char[] line ; splitlines(Str.toString(strError)) )
1003                         {
1004                                 readError(line);
1005                         }
1006                 }
1007                 if ( externalWatch != null )
1008                 {
1009                         externalWatch(this);
1010                 }
1011                 return status;
1012         }
1013         
1015         
1017 code: end
1019 outFile: Spawn
1021 file: glib-File-Utilities.html
1022 class: FileUtils
1023 import: std.stdio
1024 import: glib.Str
1025 prefix: g_
1026 #import: glib.ErrorG
1027 #import: glib.Error*
1028 #structWrap: GError** Error*
1029 #import: glib.Dir
1030 #structWrap: GDir* Dir
1031 #import: glib.MappedFile
1032 #structWrap: GMappedFile* MappedFile
1033 outFile: FileUtils
1035 file: glib-Shell-related-Utilities.html
1036 class: ShellUtils
1037 import: glib.ErrorG
1038 prefix: g_shell_
1039 import: glib.Str
1040 outFile: ShellUtils
1042 file: glib-Commandline-option-parser.html
1044 struct: GOptionContext
1045 class: OptionContext
1046 import: glib.ErrorG
1047 prefix: g_option_context_
1048 noprefix: g_option_group_
1049 #import: glib.Error*
1050 #structWrap: GError** Error*
1051 #import: glib.OptionEntry
1052 #structWrap: GOptionEntry* OptionEntry
1053 import: glib.OptionGroup
1054 structWrap: GOptionGroup* OptionGroup
1055 import: glib.Str
1056 outFile: OptionContext
1058 struct: GOptionGroup
1059 class: OptionGroup
1060 import: glib.Dataset
1061 structWrap: GDataset* Dataset
1062 import: glib.OptionContext
1063 structWrap: GOptionContext* OptionContext
1064 prefix: g_option_group_
1065 strictPrefix: Yes
1066 #import: glib.OptionEntry
1067 #structWrap: GOptionEntry* OptionEntry
1068 import: glib.Str
1069 outFile: OptionGroup
1071 file: glib-Glob-style-pattern-matching.html
1072 struct: GPatternSpec
1073 class: Pattern
1074 prefix: g_pattern_spec_
1075 prefix: g_pattern_match_
1076 #import: glib.PatternSpec
1077 structWrap: GPatternSpec* Pattern
1078 import: glib.Str
1079 outFile: Pattern
1081 file: glib-Simple-XML-Subset-Parser.html
1082 struct: GMarkupParseContext
1083 class: SimpleXML
1084 import: glib.ErrorG
1085 import: glib.Dataset
1086 structWrap: GDataset* Dataset
1087 prefix: g_markup_parse_context_
1088 #import: glib.Error*
1089 #structWrap: GError** Error*
1090 #import: glib.MarkupParser
1091 #structWrap: GMarkupParser* MarkupParser
1092 import: glib.Str
1093 outFile: SimpleXML
1095 file: glib-Key-value-file-parser.html
1096 struct: GKeyFile
1097 class: KeyFile
1098 import: glib.ErrorG
1099 import: glib.Str
1100 prefix: g_key_file_
1101 outFile: GKeyFile
1103 file: glib-Windows-Compatibility-Functions.html
1104 class: WindowsUtils
1105 prefix: g_win32_
1106 import: glib.Str
1107 outFile: WindowsUtils
1110 ###########################################################
1111 ### GLib Data Types #######################################
1112 ###########################################################
1114 file: glib-Memory-Slices.html
1115 class: MemorySlice
1116 prefix: g_slice_
1117 outFile: MemorySlice
1119 file: glib-Memory-Chunks.html
1120 struct: GMemChunk
1121 class: MemoryChunk
1122 prefix: g_mem_chunk_
1123 import: glib.Str
1124 outFile: MemoryChunk
1126 file: glib-Doubly-Linked-Lists.html
1127 struct: GList
1128 class: ListG
1129 prefix: g_list_
1130 #import: glib.ListG
1131 structWrap: GList* ListG
1132 outFile: ListG
1134 file: glib-Singly-Linked-Lists.html
1135 struct: GSList
1136 class: ListSG
1137 import: glib.ListG
1138 prefix: g_slist_
1139 #import: glib.ListSG
1140 structWrap: GSList* ListSG
1141 outFile: ListSG
1143 file: glib-Double-ended-Queues.html
1144 struct: GQueue
1145 class: QueueG
1146 import: glib.ListG
1147 prefix: g_queue_
1148 #import: glib.QueueG
1149 structWrap: GQueue* QueueG
1150 import: glib.ListG
1151 structWrap: GList* ListG
1152 outFile: QueueG
1154 file: glib-Trash-Stacks.html
1155 struct: GTrashStack
1156 class: TrashStack
1157 prefix: g_trash_stack_
1158 #import: glib.TrashStack*
1159 #structWrap: GTrashStack** TrashStack*
1160 outFile: TrashStack
1162 file: glib-Hash-Tables.html
1163 struct: GHashTable
1164 class: HashTable
1165 import: glib.Dataset
1166 prefix: g_hash_table_
1167 #import: glib.HashTable
1168 structWrap: GHashTable* HashTable
1169 outFile: HashTable
1171 file: glib-Strings.html
1172 struct: GString
1173 class: StringG
1174 prefix: g_string_
1175 #import: glib.StringG
1176 structWrap: GString* StringG
1177 import: glib.Str
1178 outFile: StringG
1180 file: glib-String-Chunks.html
1181 struct: GStringChunk
1182 class: StringGChunk
1183 prefix: g_string_chunk_
1184 import: glib.Str
1185 outFile: StringGChunk
1187 file: glib-Arrays.html
1188 struct: GArray
1189 class: ArrayG
1190 import: glib.ListG
1191 prefix: g_array_
1192 #import: glib.Array
1193 structWrap: GArray* ArrayG
1194 import: glib.Str
1195 outFile: ArrayG
1197 file: glib-Pointer-Arrays.html
1198 struct: GPtrArray
1199 class: PtrArray
1200 import: glib.ListG
1201 structWrap: GList* ListG
1202 prefix: g_ptr_array_
1203 #import: glib.PtrArray
1204 structWrap: GPtrArray* PtrArray
1205 outFile: PtrArray
1207 file: glib-Byte-Arrays.html
1208 struct: GByteArray
1209 class: ByteArray
1210 import: glib.ListG
1211 structWrap: GList* ListG
1212 prefix: g_byte_array_
1213 outFile: ByteArray
1215 file: glib-Balanced-Binary-Trees.html
1216 struct: GTree
1217 class: BBTree
1218 import: glib.ListG
1219 import: glib.Dataset
1220 structWrap: GList* List*
1221 structWrap: GDataset* Dataset
1222 prefix: g_tree_
1223 outFile: BBTree
1225 file: glib-N-ary-Trees.html
1226 struct: GNode
1227 class: Node
1228 import: glib.BBTree
1229 structWrap: GTree* BBTree
1230 structWrap: GNode* Node
1231 prefix: g_node_
1232 outFile: Node
1234 file: glib-Quarks.html
1235 struct: GQuark
1236 class: Quark
1237 import: glib.ErrorG
1238 prefix: g_quark_
1239 import: glib.Str
1240 outFile: Quark
1242 file: glib-Keyed-Data-Lists.html
1243 struct: GData
1244 class: DataList
1245 prefix: g_datalist_
1246 import: glib.Quark
1247 import: glib.Dataset
1248 structWrap: GDataset* Dataset
1249 outFile: DataList
1251 file: glib-Datasets.html
1252 class: Dataset
1253 prefix: g_dataset_
1254 import: glib.Quark
1255 outFile: Dataset
1257 file: glib-Relations-and-Tuples.html
1258 struct: GRelation
1259 class: Relation
1260 import: glib.HashTable
1261 structWrap: GHashTable* HashTable
1262 prefix: g_relation_
1263 noprefix: g_tuples_
1264 import: glib.Tuples
1265 structWrap: GTuples* Tuples
1266 outFile: Relation
1268 struct: GTuples
1269 class: Tuples
1270 prefix: g_tuples_
1271 strictPrefix: Yes
1272 outFile: Tuples
1274 file: glib-Caches.html
1275 struct: GCache
1276 class: Cache
1277 import: glib.HashTable
1278 structWrap: GHashTable* HashTable
1279 prefix: g_cache_
1280 outFile: Cache
1282 file: glib-Memory-Allocators.html
1283 struct: GAllocator
1284 class: Allocator
1285 prefix: g_allocator_
1286 import: glib.Str
1287 outFile: Allocator
1289 ###########################################################
1290 ### GLib Tools ############################################
1291 ###########################################################