File: libgeda.texi

package info (click to toggle)
libgeda 20050313-1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 5,636 kB
  • ctags: 1,505
  • sloc: ansic: 19,449; sh: 8,627; makefile: 197; perl: 59
file content (133 lines) | stat: -rw-r--r-- 3,012 bytes parent folder | download
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
@c -*- mode: Noweb; noweb-doc-mode: texinfo-mode; noweb-code-mode: c-mode -*-

@node File libgeda.c,,,Top
@chapter File @file{libgeda.c}

@section File header

@format
@anchor{libgeda.c - -root-}
@i{<<libgeda.c : *>>=}@t{
@i{<<libgeda.c : copyright and license -- @ref{libgeda.c - copyright and license}>>}

/* DO NOT read or edit this file ! Use ../noweb/libgeda.nw instead */

@i{<<libgeda.c : include directives -- @ref{libgeda.c - include directives}>>}
@i{<<libgeda.c : libgeda_init() -- @ref{libgeda.c - libgeda_init()}>>}

}
@end format




@format
@anchor{libgeda.c - copyright and license}
@i{<<libgeda.c : copyright and license>>=}@t{
/* gEDA - GPL Electronic Design Automation
 * libgeda - gEDA's library
 * Copyright (C) 1998, 1999, 2000 Kazu Hirata / Ales 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
 */

}
@end format




@format
@anchor{libgeda.c - include directives}
@i{<<libgeda.c : include directives>>=}@t{
#include <config.h>

#include <stdio.h>
#ifdef HAVE_STRING_H
#include <string.h>
#endif
#ifdef HAVE_STRARG_H
#include <stdarg.h>
#endif
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif

#include <gtk/gtk.h>
#include <libguile.h>

#include "defines.h"
#include "struct.h"
#include "globals.h"

#include "../include/prototype.h"

#ifdef HAVE_LIBDMALLOC
#include <dmalloc.h>
#endif

}
@end format




@section Function @code{libgeda_init()}

@defun libgeda_init 
libgeda_init is responsible for making sure that any runtime initialization
is done for all the libgeda routines.  It should be called before any
other libgeda functions are called.  
@end defun

@format
@anchor{libgeda.c - libgeda_init()}
@i{<<libgeda.c : libgeda_init()>>=}@t{
void libgeda_init(void)
@{
  char *new_data=NULL;
  char *geda_data = getenv("GEDADATA");

  /* This stuff reverted on 2.17.2005 by SDB in response to W. Hoch. */
  if (geda_data == NULL) @{
    new_data = g_strdup_printf("GEDADATA=%s", GEDADATADIR);
    putenv(new_data);
    /*free(new_data); putenv takes over the memory? */

    /* We'll use this someday. . . . . */
    /* g_setenv ("GEDADATA", GEDADATADIR, FALSE); */ /* requires glib-2.4.* */
  @}

  s_toplevel_init ();
  s_clib_init();
  s_slib_init();
  s_menu_init();
  s_attrib_init();
  s_color_init();

  o_text_init(); 

  g_register_libgeda_funcs();
@}

@display
@r{Defines :
.
}
@end display
}
@end format