libxputty 0.1
Loading...
Searching...
No Matches
xchildlist_private.c
Go to the documentation of this file.
1/*
2 * 0BSD
3 *
4 * BSD Zero Clause License
5 *
6 * Copyright (c) 2019 Hermann Meyer
7 *
8 * Permission to use, copy, modify, and/or distribute this software for any
9 * purpose with or without fee is hereby granted.
10
11 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
12 * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
13 * AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
14 * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
15 * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
16 * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
17 * PERFORMANCE OF THIS SOFTWARE.
18 *
19 */
20
21#include "xchildlist_private.h"
22
24 childlist->childs = (Widget_t**)realloc(childlist->childs, sizeof(Widget_t*) * (4+childlist->cap));
25 assert(childlist->childs != NULL);
26 childlist->cap +=4;
27 childlist->size = sizeof(childlist);
28 int i = childlist->elem+1;
29 for(;i<childlist->cap;i++) {
30 childlist->childs[i] = NULL;
31 }
32}
Childlist_t - struct to hold a Widget_t child list Xputty main holds a list of any Widget_t created...
Definition xchildlist.h:49
Widget_t ** childs
Definition xchildlist.h:51
size_t size
Definition xchildlist.h:53
Widget_t - struct to hold the basic Widget_t info.
Definition xwidget.h:457
void _childlist_add_elem(Childlist_t *childlist)
_childlist_add_elem - internal use to reallocate the childlist array to new size You didn't need to...