1 /* gEDA - GPL Electronic Design Automation
2 * gschlas - gEDA Load and Save
3 * Copyright (C) 2002-2007 Ales Hvezda
4 * Copyright (C) 2002-2007 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., 675 Mass Ave, Cambridge, MA 02139, USA.
35 #include <libgeda/libgeda.h>
37 #include "../include/prototype.h"
39 #ifdef HAVE_LIBDMALLOC
43 /* If embed_mode is true, then embed all components in all pages, */
44 /* otherwise unembed all components in all pages */
46 s_util_embed(TOPLEVEL
*pr_current
, int embed_mode
)
51 p_current
= pr_current
->page_head
;
53 while (p_current
!= NULL
) {
55 o_current
= p_current
->object_head
;
57 if (p_current
->pid
!= -1) {
59 while (o_current
!= NULL
) {
61 if (o_current
->type
== OBJ_COMPLEX
||
62 o_current
->type
== OBJ_PICTURE
) {
63 if (embed_mode
== TRUE
) {
64 o_embed(pr_current
, o_current
);
66 o_unembed(pr_current
, o_current
);
70 o_current
= o_current
->next
;
74 p_current
= p_current
->next
;