missing NULL terminator in set_config_x
[geda-gaf.git] / utils / gschlas / s_util.c
blob976582de03a27dfbf7262310478756dafc977542
1 /* gEDA - GPL Electronic Design Automation
2 * gschlas - gEDA Load and Save
3 * Copyright (C) 2002-2010 Ales Hvezda
4 * Copyright (C) 2002-2020 gEDA Contributors (see ChangeLog for details)
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19 * MA 02111-1301 USA.
22 #include <config.h>
24 #include <stdio.h>
25 #include <sys/stat.h>
26 #ifdef HAVE_STDLIB_H
27 #include <stdlib.h>
28 #endif
29 #ifdef HAVE_ASSERT_H
30 #include <assert.h>
31 #endif
32 #ifdef HAVE_UNISTD_H
33 #include <unistd.h>
34 #endif
36 #include <libgeda/libgeda.h>
38 #include "../include/prototype.h"
40 /* If embed_mode is true, then embed all components in all pages, */
41 /* otherwise unembed all components in all pages */
42 void
43 s_util_embed(TOPLEVEL *pr_current, int embed_mode)
45 GList *p_iter, *o_iter;
47 for (p_iter = geda_list_get_glist (pr_current->pages);
48 p_iter != NULL;
49 p_iter = g_list_next (p_iter)) {
50 PAGE *p_current = p_iter->data;
52 /* Cast removes const qualifier from return value of
53 * s_page_objects() */
54 for (o_iter = (GList *) s_page_objects (p_current);
55 o_iter != NULL;
56 o_iter = g_list_next (o_iter)) {
58 OBJECT *o_current = o_iter->data;
60 if (o_current->type == OBJ_COMPLEX ||
61 o_current->type == OBJ_PICTURE) {
62 if (embed_mode ? o_embed(pr_current, o_current)
63 : o_unembed(pr_current, o_current)) {
64 PAGE *page = o_get_page (pr_current, o_current);
65 if (page != NULL)
66 page->CHANGED = 1;