2 * This file is part of gtkD.
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.
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.
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
19 // generated automatically - do not change
20 // find conversion definition on APILookup.txt
21 // implement new conversion functionalities on the wrap.utils pakage
24 * Conversion parameters:
25 * inFile = glib-Trash-Stacks.html
27 * outFile = TrashStack
49 module glib
.TrashStack
;
55 import tango
.io
.Stdout
; // use the tango loging?
59 private import gtkc
.glibtypes
;
61 private import gtkc
.glib
;
70 * A GTrashStack is an efficient way to keep a stack of unused allocated
71 * memory chunks. Each memory chunk is required to be large enough to hold
72 * a gpointer. This allows the stack to be maintained without any space
73 * overhead, since the stack pointers can be stored inside the memory chunks.
74 * There is no function to create a GTrashStack. A NULL GTrashStack*
75 * is a perfectly valid empty stack.
77 public class TrashStack
80 /** the main Gtk struct */
81 protected GTrashStack
* gTrashStack
;
84 public GTrashStack
* getTrashStackStruct()
90 /** the main Gtk struct as a void* */
91 protected void* getStruct()
93 return cast(void*)gTrashStack
;
97 * Sets our main struct and passes it to the parent class
99 public this (GTrashStack
* gTrashStack
)
103 if ( gTrashStack
is null )
108 Stdout("struct gTrashStack is null on constructor").newline
;
112 printf("struct gTrashStack is null on constructor");
119 assert(gTrashStack
!is null, "struct gTrashStack is null on constructor");
121 this.gTrashStack
= gTrashStack
;
129 * Pushes a piece of memory onto a GTrashStack.
131 * a pointer to a GTrashStack.
133 * the piece of memory to push on the stack.
135 public static void push(GTrashStack
** stackP
, void* dataP
)
137 // void g_trash_stack_push (GTrashStack **stack_p, gpointer data_p);
138 g_trash_stack_push(stackP
, dataP
);
142 * Pops a piece of memory off a GTrashStack.
144 * a pointer to a GTrashStack.
146 * the element at the top of the stack.
148 public static void* pop(GTrashStack
** stackP
)
150 // gpointer g_trash_stack_pop (GTrashStack **stack_p);
151 return g_trash_stack_pop(stackP
);
155 * Returns the element at the top of a GTrashStack which may be NULL.
157 * a pointer to a GTrashStack.
159 * the element at the top of the stack.
161 public static void* peek(GTrashStack
** stackP
)
163 // gpointer g_trash_stack_peek (GTrashStack **stack_p);
164 return g_trash_stack_peek(stackP
);
168 * Returns the height of a GTrashStack.
169 * Note that execution of this function is of O(N) complexity
170 * where N denotes the number of items on the stack.
172 * a pointer to a GTrashStack.
174 * the height of the stack.
176 public static uint height(GTrashStack
** stackP
)
178 // guint g_trash_stack_height (GTrashStack **stack_p);
179 return g_trash_stack_height(stackP
);