alternative to assert
[gtkD.git] / gtkD / wrap / APILookupGLib.txt
blobee5f7b32b337fd32d361c8fe2546d459013c2e12
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;
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 doref()
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: 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.c.stdio
701 import: std.string
702 import: std.c.string
703 nocode: g_spawn_async_with_pipes
705 code: start
707         version(Tango) alias splitLines splitlines;
710         char[] workingDirectory = ".";
711         char[][] argv;
712         char[][] envp;
713         GSpawnFlags flags = SpawnFlags.SEARCH_PATH;
714         GSpawnChildSetupFunc childSetup; 
715         void* userData;
716         GPid childPid;
717         FILE* standardInput;
718         FILE* standardOutput;
719         FILE* standardError;
720         GError* error;
721         int stdIn;
722         int stdOut;
723         int stdErr;
725         // for commandLineSync
726         int exitStatus;
727         char* strOutput;
728         char* strError;
729         
730         alias bool delegate(Spawn) ChildWatch;
731         ChildWatch externalWatch;
732         
733         /**
734          * Creates a Spawn for execution.
735          */
736         public this(char[] program, char[][] envp=null)
737         {
738                 argv ~= program;
739                 this.envp = envp;
740         }
741         
742         /**
743          * Creates a Spawn for execution.
744          */
745         public this(char[][] program, char[][] envp=null)
746         {
747                 argv = program;
748                 this.envp = envp;
749         }
750         
751         /**
752          * Adds a delegate to be notified on the end of the child process.
753          * Params:
754          *      delegate(int =
755          *      dlg =
756          */
757         public void addChildWatch(ChildWatch dlg)
758         {
759                 externalWatch = dlg;
760         }
761         
762         /**
763          * Closes all open streams and child process.
764          */
765         public void close()
766         {
767                 if (stdIn != 0 )
768                 {
769                         fclose(standardInput);
770                         stdIn = 0;
771                 }
772                 if (stdOut != 0 )
773                 {
774                         fclose(standardOutput);
775                         stdOut = 0;
776                 }
777                 if (stdErr != 0 )
778                 {
779                         fclose(standardError);
780                         stdErr = 0;
781                 }
782                 if ( childPid != 0 )
783                 {
784                         closePid(childPid);
785                         childPid = 0;
786                 }
787         }
788         
789         /**
790          * Adds a parameter to the execution program
791          */
792         public void addParm(char[] parm)
793         {
794                 argv ~= parm;
795         }
797         /**
798          * Gets the last error message
799          */
800         public char[] getLastError()
801         {
802                 if ( error != null )
803                 {
804                         return Str.toString(error.message);
805                 }
806                 return "";
807         }
810         /**
811          * Executes the prepared process
812          */
813         public int execAsyncWithPipes(
814                 ChildWatch externalWatch = null,
815                 bool delegate(char[]) readOutput = null, 
816                 bool delegate(char[]) readError = null )
817         {
818                 int result = g_spawn_async_with_pipes(
819                 Str.toStringz(workingDirectory),
820                 Str.toStringzArray(argv),
821                 Str.toStringzArray(envp),
822                 flags,
823                 childSetup,
824                 userData,
825                 &childPid,
826                 &stdIn,
827                 &stdOut,
828                 &stdErr,
829                 &error
830                 );
831                 
832                 if ( result != 0 )
833                 {
834                         this.externalWatch = externalWatch;
835                         g_child_watch_add(childPid, cast(GChildWatchFunc)(&childWatchCallback), cast(void*)this);
836                         standardInput = fdopen(stdIn, "w");
837                         standardOutput = fdopen(stdOut, "r");
838                         standardError = fdopen(stdErr, "r");
839                         
840                         if ( readOutput !is null )
841                         {
842                                 (new ReadFile(standardOutput, readOutput)).start();
843                         }
844                         if ( readError !is null )
845                         {
846                                 (new ReadFile(standardError, readError)).start();
847                         }
848                 }
849                 
850                 return result;
851         }
852         
853         class ReadFile : Thread
854         {
855                 bool delegate(char[]) read;
856                 FILE* file;
857                 
858                 int lineCount;
859                 
860                 this(FILE* file, bool delegate (char[]) read )
861                 {
862                         this.file = file;
863                         this.read = read;
864                 }
865                 
866                 public int run()
867                 {
868                         char[] line = readLine(file);
869                         while( line !is null )
870                         {
871                                 ++lineCount;
872                                 //writefln("Spawn.ReadFile.run line (%s) ========== >>>%s<<<", lineCount, line);
873                                 //printf("Spawn.ReadFile.run line (%d) ========== >>>%.*s<<<", lineCount, line);
874                                 if ( read !is null )
875                                 {
876                                         read(line);
877                                 }
878                                 line = readLine(file);
879                         }
880                         return 0;               
881                 }
882         }
883         
884         private char[] readLine(FILE* stream, int max=4096)
885         {
886                 if ( feof(stream) )
887                 {
888                         if ( externalWatch !is null )
889                         {
890                                 externalWatch(this);
891                         }
892                         return null;
893                 }
894                 char[] line;
895                 line.length = max+1;
896                 char* lineP = fgets(line.ptr, max, stream);
897                 if ( lineP is null )
898                 {
899                         return "";
900                 }
901                 int l = strlen(line.ptr);
902                 if ( l > 0 ) --l;
903                 //printf("\nreadLine\n");
904                 //foreach ( char c ; line )
905                 //{
906                 //        printf("%c", c);
907                 //}
908                 //printf("\n\n");
909                 return line[0..l];              
910         }
911         
912         extern(C) static void childWatchCallback(int pid, int status, Spawn spawn)
913         {
914                 //writefln("Spawn.childWatchCallback %s %s", pid, status);
915                 spawn.exitStatus = status;
916                 if ( spawn.externalWatch !is null )
917                 {
918                         spawn.externalWatch(spawn);
919                 }
920                 spawn.close();
921         }
922         
924         public bool endOfOutput()
925         {
926                 if ( standardOutput is null ) return true;
927                 return feof(standardOutput) != 0;
928         }
929         
930         public bool endOfError()
931         {
932                 if ( standardError is null ) return true;
933                 return feof(standardError) != 0;
934         }
935         
936         char[] getOutputString()
937         {
938                 return Str.toString(strOutput);
939         }
940         
941         char[] getErrorString()
942         {
943                 return Str.toString(strError);
944         }
945         
946         int getExitStatus()
947         {
948                 return exitStatus;
949         }
951 // old version
952 //      public int commandLineSync()
953 //      {
954 //              char[] commandLine;
955 //              foreach ( int count, char[] arg; argv)
956 //              {
957 //                      if ( count > 0 )
958 //                      {
959 //                              commandLine ~= ' ';
960 //                      }
961 //                      commandLine ~= arg;
962 //              }
963 //              return g_spawn_command_line_sync(
964 //              
965 //                      Str.toStringz(commandLine), 
966 //                      &strOutput, 
967 //                      &strError, 
968 //                      &exitStatus, 
969 //                      &error);
970 //      }
971         
972         /**
973          * Executes a command synchronasly and 
974          * optionally calls delegates for sysout, syserr and end of job
975          * 
976          */
977         public int commandLineSync(
978                 ChildWatch externalWatch = null,
979                 bool delegate(char[]) readOutput = null,
980                 bool delegate(char[]) readError = null )
981         {
982                 char[] commandLine;
983                 foreach ( int count, char[] arg; argv)
984                 {
985                         if ( count > 0 )
986                         {
987                                 commandLine ~= ' ';
988                         }
989                         commandLine ~= arg;
990                 }
991                 int status = g_spawn_command_line_sync(
992                                 Str.toStringz(commandLine),
993                                 &strOutput,
994                                 &strError,
995                                 &exitStatus,
996                                 &error);
997                 if ( readOutput != null )
998                 {
999                         foreach ( char[] line ; splitlines(Str.toString(strOutput)) )
1000                         {
1001                                 readOutput(line);
1002                         }
1003                 }
1004                 if ( readError != null )
1005                 {
1006                         foreach ( char[] line ; splitlines(Str.toString(strError)) )
1007                         {
1008                                 readError(line);
1009                         }
1010                 }
1011                 if ( externalWatch != null )
1012                 {
1013                         externalWatch(this);
1014                 }
1015                 return status;
1016         }
1017         
1019         
1021 code: end
1023 outFile: Spawn
1025 file: glib-File-Utilities.html
1026 class: FileUtils
1027 import: std.stdio
1028 import: glib.Str
1029 prefix: g_
1030 #import: glib.ErrorG
1031 #import: glib.Error*
1032 #structWrap: GError** Error*
1033 #import: glib.Dir
1034 #structWrap: GDir* Dir
1035 #import: glib.MappedFile
1036 #structWrap: GMappedFile* MappedFile
1037 outFile: FileUtils
1039 file: glib-Shell-related-Utilities.html
1040 class: ShellUtils
1041 import: glib.ErrorG
1042 prefix: g_shell_
1043 import: glib.Str
1044 outFile: ShellUtils
1046 file: glib-Commandline-option-parser.html
1048 struct: GOptionContext
1049 class: OptionContext
1050 import: glib.ErrorG
1051 prefix: g_option_context_
1052 noprefix: g_option_group_
1053 #import: glib.Error*
1054 #structWrap: GError** Error*
1055 #import: glib.OptionEntry
1056 #structWrap: GOptionEntry* OptionEntry
1057 import: glib.OptionGroup
1058 structWrap: GOptionGroup* OptionGroup
1059 import: glib.Str
1060 outFile: OptionContext
1062 struct: GOptionGroup
1063 class: OptionGroup
1064 import: glib.Dataset
1065 structWrap: GDataset* Dataset
1066 import: glib.OptionContext
1067 structWrap: GOptionContext* OptionContext
1068 prefix: g_option_group_
1069 strictPrefix: Yes
1070 #import: glib.OptionEntry
1071 #structWrap: GOptionEntry* OptionEntry
1072 import: glib.Str
1073 outFile: OptionGroup
1075 file: glib-Glob-style-pattern-matching.html
1076 struct: GPatternSpec
1077 class: Pattern
1078 prefix: g_pattern_spec_
1079 prefix: g_pattern_match_
1080 #import: glib.PatternSpec
1081 structWrap: GPatternSpec* Pattern
1082 import: glib.Str
1083 outFile: Pattern
1085 file: glib-Simple-XML-Subset-Parser.html
1086 struct: GMarkupParseContext
1087 class: SimpleXML
1088 import: glib.ErrorG
1089 import: glib.Dataset
1090 structWrap: GDataset* Dataset
1091 prefix: g_markup_parse_context_
1092 #import: glib.Error*
1093 #structWrap: GError** Error*
1094 #import: glib.MarkupParser
1095 #structWrap: GMarkupParser* MarkupParser
1096 import: glib.Str
1097 outFile: SimpleXML
1099 file: glib-Key-value-file-parser.html
1100 struct: GKeyFile
1101 class: KeyFile
1102 import: glib.ErrorG
1103 import: glib.Str
1104 prefix: g_key_file_
1105 outFile: GKeyFile
1107 file: glib-Windows-Compatibility-Functions.html
1108 class: WindowsUtils
1109 prefix: g_win32_
1110 import: glib.Str
1111 outFile: WindowsUtils
1114 ###########################################################
1115 ### GLib Data Types #######################################
1116 ###########################################################
1118 file: glib-Memory-Slices.html
1119 class: MemorySlice
1120 prefix: g_slice_
1121 outFile: MemorySlice
1123 file: glib-Memory-Chunks.html
1124 struct: GMemChunk
1125 class: MemoryChunk
1126 prefix: g_mem_chunk_
1127 import: glib.Str
1128 outFile: MemoryChunk
1130 file: glib-Doubly-Linked-Lists.html
1131 struct: GList
1132 class: ListG
1133 prefix: g_list_
1134 #import: glib.ListG
1135 structWrap: GList* ListG
1137 code: start
1138    
1139         void* data()
1140         {
1141                 int* pt =cast(int*)getStruct();
1142                 return cast(void *)(*pt);
1143         }
1144          
1147 code: end
1149 outFile: ListG
1151 file: glib-Singly-Linked-Lists.html
1152 struct: GSList
1153 class: ListSG
1154 import: glib.ListG
1155 prefix: g_slist_
1156 #import: glib.ListSG
1157 structWrap: GSList* ListSG
1158 outFile: ListSG
1160 file: glib-Double-ended-Queues.html
1161 struct: GQueue
1162 class: QueueG
1163 import: glib.ListG
1164 prefix: g_queue_
1165 #import: glib.QueueG
1166 structWrap: GQueue* QueueG
1167 import: glib.ListG
1168 structWrap: GList* ListG
1169 outFile: QueueG
1171 file: glib-Trash-Stacks.html
1172 struct: GTrashStack
1173 class: TrashStack
1174 prefix: g_trash_stack_
1175 #import: glib.TrashStack*
1176 #structWrap: GTrashStack** TrashStack*
1177 outFile: TrashStack
1179 file: glib-Hash-Tables.html
1180 struct: GHashTable
1181 class: HashTable
1182 import: glib.Dataset
1183 prefix: g_hash_table_
1184 #import: glib.HashTable
1185 structWrap: GHashTable* HashTable
1186 outFile: HashTable
1188 file: glib-Strings.html
1189 struct: GString
1190 class: StringG
1191 prefix: g_string_
1192 #import: glib.StringG
1193 structWrap: GString* StringG
1194 import: glib.Str
1195 outFile: StringG
1197 file: glib-String-Chunks.html
1198 struct: GStringChunk
1199 class: StringGChunk
1200 prefix: g_string_chunk_
1201 import: glib.Str
1202 outFile: StringGChunk
1204 file: glib-Arrays.html
1205 struct: GArray
1206 class: ArrayG
1207 import: glib.ListG
1208 prefix: g_array_
1209 #import: glib.Array
1210 structWrap: GArray* ArrayG
1211 import: glib.Str
1212 outFile: ArrayG
1214 file: glib-Pointer-Arrays.html
1215 struct: GPtrArray
1216 class: PtrArray
1217 import: glib.ListG
1218 structWrap: GList* ListG
1219 prefix: g_ptr_array_
1220 #import: glib.PtrArray
1221 structWrap: GPtrArray* PtrArray
1222 outFile: PtrArray
1224 file: glib-Byte-Arrays.html
1225 struct: GByteArray
1226 class: ByteArray
1227 import: glib.ListG
1228 structWrap: GList* ListG
1229 prefix: g_byte_array_
1230 outFile: ByteArray
1232 file: glib-Balanced-Binary-Trees.html
1233 struct: GTree
1234 class: BBTree
1235 import: glib.ListG
1236 import: glib.Dataset
1237 structWrap: GList* List*
1238 structWrap: GDataset* Dataset
1239 prefix: g_tree_
1240 outFile: BBTree
1242 file: glib-N-ary-Trees.html
1243 struct: GNode
1244 class: Node
1245 import: glib.BBTree
1246 structWrap: GTree* BBTree
1247 structWrap: GNode* Node
1248 prefix: g_node_
1249 outFile: Node
1251 file: glib-Quarks.html
1252 struct: GQuark
1253 class: Quark
1254 import: glib.ErrorG
1255 prefix: g_quark_
1256 import: glib.Str
1257 outFile: Quark
1259 file: glib-Keyed-Data-Lists.html
1260 struct: GData
1261 class: DataList
1262 prefix: g_datalist_
1263 import: glib.Quark
1264 import: glib.Dataset
1265 structWrap: GDataset* Dataset
1266 outFile: DataList
1268 file: glib-Datasets.html
1269 class: Dataset
1270 prefix: g_dataset_
1271 import: glib.Quark
1272 outFile: Dataset
1274 file: glib-Relations-and-Tuples.html
1275 struct: GRelation
1276 class: Relation
1277 import: glib.HashTable
1278 structWrap: GHashTable* HashTable
1279 prefix: g_relation_
1280 noprefix: g_tuples_
1281 import: glib.Tuples
1282 structWrap: GTuples* Tuples
1283 outFile: Relation
1285 struct: GTuples
1286 class: Tuples
1287 prefix: g_tuples_
1288 strictPrefix: Yes
1289 outFile: Tuples
1291 file: glib-Caches.html
1292 struct: GCache
1293 class: Cache
1294 import: glib.HashTable
1295 structWrap: GHashTable* HashTable
1296 prefix: g_cache_
1297 outFile: Cache
1299 file: glib-Memory-Allocators.html
1300 struct: GAllocator
1301 class: Allocator
1302 prefix: g_allocator_
1303 import: glib.Str
1304 outFile: Allocator
1306 ###########################################################
1307 ### GLib Tools ############################################
1308 ###########################################################