1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161
|
@c -*- mode: Noweb; noweb-doc-mode: texinfo-mode; noweb-code-mode: c-mode -*-
@node File f_basic.c,,,Top
@chapter File @file{f_basic.c}
@section File header
<<f_basic.c : *>>=
<<f_basic.c : copyright and license>>
/* DO NOT read or edit this file ! Use ../noweb/f_basic.nw instead */
<<f_basic.c : include directives>>
<<f_basic.c : f_open()>>
<<f_basic.c : f_close()>>
<<f_basic.c : f_save_close()>>
<<f_basic.c : f_save()>>
@
<<f_basic.c : copyright and license>>=
/* gEDA - GPL Electronic Design Automation
* libgeda - gEDA's library
* Copyright (C) 1998-2000 Ales V. Hvezda
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA
*/
@
<<f_basic.c : include directives>>=
#include <config.h>
#include <stdio.h>
#include <gtk/gtk.h>
#include <gdk/gdk.h>
#include <gdk/gdkx.h>
#include <guile/gh.h>
#include "defines.h"
#include "struct.h"
#include "globals.h"
#include "../include/prototype.h"
@
@section Function @code{f_open()}
@defun f_open w_current filename
@end defun
<<f_basic.c : f_open()>>=
/* Returns 0 on failure and 1 on success */
int
f_open(TOPLEVEL *w_current, char *filename)
{
int opened=FALSE;
/* has the head been freed yet? */
/* probably not hack PAGE */
set_window(w_current, w_current->init_left, w_current->init_right,
w_current->init_top, w_current->init_bottom);
w_current->page_current->object_tail = (OBJECT *)
o_read(w_current, w_current->page_current->object_tail,
filename);
if (w_current->page_current->object_tail != NULL) {
s_log_message("Opened schematic [%s]\n", filename);
opened = TRUE;
} else {
/* Failed to open page */
opened = FALSE;
}
w_current->page_current->object_tail = (OBJECT *)
return_tail(w_current->page_current->object_head);
/* make sure you init net_consolide to false (default) in all */
/* programs */
if (w_current->net_consolidate == TRUE) {
o_net_consolidate(w_current);
}
w_current->page_current->CHANGED=0; /* added 4/7/98 */
if (!opened) {
return (FALSE);
} else {
return (TRUE);
}
}
@ %def f_open
@section Function @code{f_close()}
@defun f_close w_current
@end defun
<<f_basic.c : f_close()>>=
void
f_close(TOPLEVEL *w_current)
{
}
@ %def f_close
@section Function @code{f_save_close()}
@defun f_save_close w_current filename
@end defun
<<f_basic.c : f_save_close()>>=
void
f_save_close(TOPLEVEL *w_current, char *filename)
{
o_save(w_current, filename);
s_page_free(w_current, w_current->page_current);
}
@ %def f_save_close
@section Function @code{f_save()}
@defun f_save w_current filename
@end defun
<<f_basic.c : f_save()>>=
void
f_save(TOPLEVEL *w_current, char *filename)
{
o_save(w_current, filename);
}
@ %def f_save
|