Hi folks!
I tried to compile a c++ graph library from one of my former
professors on a SUN SPARC-5 running Solaris 2.4.
This resuluted in a bug report (internal compiler error) and me using CC :-(.
Now everything changed: THE NEW VERSION gcc2.7.0!!
First thing:
Using " and ' in a comment started with // results in an
"Unterminated string or character constant"
if you hand it in a .c file to gcc without telling anything about
C++. Precompiler output appended (1st one).
Second thing:
I get another "Internal compiler error". Precompiler output is appendend
to this mail (2nd one).
Suggestion:
I'd like to suggest that you ftp this package for yourself.
That way you may be able to track down other bugs as well and would
eliminate the cycle "you release a new version---I file a bug report".
Normally there's no problem with this. BUT I'm still unable to compile
the package and have to use a mix gcc/CC which leads to some funny
problems of its own.
ftp://ftphost.uni-koblenz.de/outgoing/GraLab/GraLab-3b.tar.gz
----------
X-Sun-Data-Type: default
X-Sun-Data-Description: default
X-Sun-Data-Name: CommentsWithGCC
X-Sun-Charset: us-ascii
X-Sun-Content-Lines: 4465
# 1 "grfall.c"
# 1 "/home/arthur/benz/Packages/GraLab3/src/include/graph.h" 1
# 27 "/home/arthur/benz/Packages/GraLab3/src/include/graph.h"
# 1 "/home/arthur/benz/Packages/OpenStep/lib/gcc-lib/sparc-sun-solaris2.4/2.7.0/include/stdlib.h" 1 3
#pragma ident "@(#)stdlib.h 1.24 94/03/28 SMI"
# 1 "/usr/include/sys/feature_tests.h" 1 3
#pragma ident "@(#)feature_tests.h 1.6 93/07/09 SMI"
# 13 "/home/arthur/benz/Packages/OpenStep/lib/gcc-lib/sparc-sun-solaris2.4/2.7.0/include/stdlib.h" 2 3
typedef struct {
int quot;
int rem;
} div_t;
typedef struct {
long quot;
long rem;
} ldiv_t;
typedef struct {
long long quot;
long long rem;
} lldiv_t;
typedef unsigned int size_t;
typedef long uid_t;
typedef long int wchar_t;
extern unsigned char __ctype[];
extern double atof(const char *);
extern int atoi(const char *);
extern long int atol(const char *);
extern double strtod(const char *, char **);
extern long int strtol(const char *, char **, int);
extern unsigned long int strtoul(const char *, char **, int);
extern int rand(void);
extern void srand(unsigned int);
extern void *calloc(size_t, size_t);
extern void free(void *);
extern void *malloc(size_t);
extern void *realloc(void *, size_t);
extern void abort(void);
extern int atexit(void (*)(void));
extern void exit(int);
extern char *getenv(const char *);
extern int system(const char *);
extern void *bsearch(const void *, const void *, size_t, size_t,
int (*)(const void *, const void *));
extern void qsort(void *, size_t, size_t,
int (*)(const void *, const void *));
extern int abs(int);
extern div_t div(int, int);
extern long int labs(long);
extern ldiv_t ldiv(long, long);
extern int mbtowc(wchar_t *, const char *, size_t);
extern int mblen(const char *, size_t);
extern int wctomb(char *, wchar_t);
extern size_t mbstowcs(wchar_t *, const char *, size_t);
extern size_t wcstombs(char *, const wchar_t *, size_t);
extern double drand48(void);
extern double erand48(unsigned short *);
extern long jrand48(unsigned short *);
extern void lcong48(unsigned short *);
extern long lrand48(void);
extern long mrand48(void);
extern long nrand48(unsigned short *);
extern unsigned short *seed48(unsigned short *);
extern void srand48(long);
extern int putenv(const char *);
extern void setkey(const char *);
extern long a64l(const char *);
extern int dup2(int, int);
extern char *ecvt(double, int, int *, int *);
extern char *fcvt(double, int, int *, int *);
extern char *qecvt(long double, int, int *, int *);
extern char *qfcvt(long double, int, int *, int *);
extern char *qgcvt(long double, int, char *);
extern char *getcwd(char *, size_t);
extern char *getlogin(void);
extern int getopt(int, char *const *, const char *);
extern int getsubopt(char **, char *const *, char **);
extern char *optarg;
extern int optind, opterr, optopt;
extern char *getpass(const char *);
extern int getpw(uid_t, char *);
extern char *gcvt(double, int, char *);
extern int isatty(int);
extern char *l64a(long);
extern void *memalign(size_t, size_t);
extern char *mktemp(char *);
extern char *realpath(char *, char *);
extern void swab(const char *, char *, int);
extern char *ttyname(int);
extern int ttyslot(void);
extern void *valloc(size_t);
extern char *ptsname(int);
extern int grantpt(int);
extern int unlockpt(int);
extern long long atoll(const char *);
extern long long llabs(long long);
extern lldiv_t lldiv(long long, long long);
extern char *lltostr(long long, char *);
extern long long strtoll(const char *, char **, int);
extern unsigned long long strtoull(const char *, char **, int);
extern char *ulltostr(unsigned long long, char *);
# 275 "/home/arthur/benz/Packages/OpenStep/lib/gcc-lib/sparc-sun-solaris2.4/2.7.0/include/stdlib.h" 3
# 28 "/home/arthur/benz/Packages/GraLab3/src/include/graph.h" 2
# 1 "/home/arthur/benz/Packages/OpenStep/lib/g++-include/string.h" 1
// -*- C++ -*- forwarding header.
// This file is part of the GNU ANSI C++ Library.
# 1 "/home/arthur/benz/Packages/OpenStep/lib/g++-include/cstring" 1
// -*- C++ -*- forwarding header.
// This file is part of the GNU ANSI C++ Library.
# 1 "/home/arthur/benz/Packages/OpenStep/lib/g++-include/std/cstring.h" 1
// The -*- C++ -*- null-terminated string header.
// This file is part of the GNU ANSI C++ Library.
// The ANSI C prototypes for these functions have a const argument type and
// non-const return type, so we can't use them.
# 1 "/home/arthur/benz/Packages/OpenStep/lib/gcc-lib/sparc-sun-solaris2.4/2.7.0/include/string.h" 1 3
#pragma ident "@(#)string.h 1.15 93/12/15 SMI"
extern void *memcpy(void *, const void *, size_t);
extern void *memmove(void *, const void *, size_t);
extern char *strcpy(char *, const char *);
extern char *strncpy(char *, const char *, size_t);
extern char *strcat(char *, const char *);
extern char *strncat(char *, const char *, size_t);
extern int memcmp(const void *, const void *, size_t);
extern int strcmp(const char *, const char *);
extern int strcoll(const char *, const char *);
extern int strncmp(const char *, const char *, size_t);
extern size_t strxfrm(char *, const char *, size_t);
extern void * __hide_memchr (const void *, int, size_t);
extern char * __hide_strchr (const char *, int);
extern size_t strcspn(const char *, const char *);
#pragma int_to_unsigned strcspn
extern char * __hide_strpbrk (const char *, const char *);
extern char * __hide_strrchr (const char *, int);
extern size_t strspn(const char *, const char *);
#pragma int_to_unsigned strspn
extern char * __hide_strstr (const char *, const char *);
extern char *strtok(char *, const char *);
extern void *memset(void *, int, size_t);
extern char *strerror(int);
extern size_t strlen(const char *);
#pragma int_to_unsigned strlen
extern void *memccpy(void *, const void *, int, size_t);
extern char *strdup(const char *);
extern char *strsignal(int);
extern int ffs(const int);
extern int strcasecmp(const char *, const char *);
extern int strncasecmp(const char *, const char *, size_t);
# 117 "/home/arthur/benz/Packages/OpenStep/lib/gcc-lib/sparc-sun-solaris2.4/2.7.0/include/string.h" 3
# 16 "/home/arthur/benz/Packages/OpenStep/lib/g++-include/std/cstring.h" 2
# 1 "/home/arthur/benz/Packages/OpenStep/lib/g++-include/std/cstddef.h" 1
// The -*- C++ -*- wrapper for the C standard definitions header.
// This file is part of the GNU ANSI C++ Library.
# 1 "/home/arthur/benz/Packages/OpenStep/lib/gcc-lib/sparc-sun-solaris2.4/2.7.0/include/stddef.h" 1 3
# 59 "/home/arthur/benz/Packages/OpenStep/lib/gcc-lib/sparc-sun-solaris2.4/2.7.0/include/stddef.h" 3
typedef int ptrdiff_t;
# 180 "/home/arthur/benz/Packages/OpenStep/lib/gcc-lib/sparc-sun-solaris2.4/2.7.0/include/stddef.h" 3
# 252 "/home/arthur/benz/Packages/OpenStep/lib/gcc-lib/sparc-sun-solaris2.4/2.7.0/include/stddef.h" 3
# 286 "/home/arthur/benz/Packages/OpenStep/lib/gcc-lib/sparc-sun-solaris2.4/2.7.0/include/stddef.h" 3
# 6 "/home/arthur/benz/Packages/OpenStep/lib/g++-include/std/cstddef.h" 2
# 24 "/home/arthur/benz/Packages/OpenStep/lib/g++-include/std/cstring.h" 2
extern "C" const char *strchr (const char *, int);
inline char *
strchr (char *s, int c)
{
return (char*) strchr ((const char *) s, c);
}
extern "C" const char *strpbrk (const char *, const char *);
inline char *
strpbrk (char *s1, const char *s2)
{
return (char *) strpbrk ((const char *) s1, s2);
}
extern "C" const char *strrchr (const char *, int);
inline char *
strrchr (char *s, int c)
{
return (char *) strrchr ((const char *) s, c);
}
extern "C" const char *strstr (const char *, const char *);
inline char *
strstr (char *s1, const char *s2)
{
return (char *) strstr ((const char *) s1, s2);
}
extern "C" const void *memchr (const void *, int, size_t);
inline void *
memchr (void *s, int c, size_t n)
{
return (void *) memchr ((const void *) s, c, n);
}
# 5 "/home/arthur/benz/Packages/OpenStep/lib/g++-include/cstring" 2
# 5 "/home/arthur/benz/Packages/OpenStep/lib/g++-include/string.h" 2
# 16 "/home/arthur/benz/Packages/OpenStep/lib/g++-include/string.h"
# 29 "/home/arthur/benz/Packages/GraLab3/src/include/graph.h" 2
# 1 "/home/arthur/benz/Packages/OpenStep/lib/g++-include/iostream.h" 1
# 1 "/home/arthur/benz/Packages/OpenStep/lib/g++-include/streambuf.h" 1
extern "C" {
# 1 "/home/arthur/benz/Packages/OpenStep/lib/g++-include/libio.h" 1
# 1 "/home/arthur/benz/Packages/OpenStep/lib/g++-include/_G_config.h" 1
typedef long _G_clock_t;
typedef unsigned long _G_dev_t;
typedef long _G_fpos_t;
typedef long _G_gid_t;
typedef unsigned long _G_ino_t;
typedef unsigned long _G_mode_t;
typedef unsigned long _G_nlink_t;
typedef long _G_off_t;
typedef long _G_pid_t;
typedef int _G_ptrdiff_t;
typedef int _G_sigset_t;
typedef unsigned int _G_size_t;
typedef long _G_time_t;
typedef long _G_uid_t;
typedef long int _G_wchar_t;
typedef int _G_ssize_t;
typedef long _G_wint_t;
typedef void * _G_va_list;
typedef int _G_int8_t __attribute__ ((mode (QI)));
typedef unsigned int _G_uint8_t __attribute__ ((mode (QI)));
typedef int _G_int16_t __attribute__ ((mode (HI)));
typedef unsigned int _G_uint16_t __attribute__ ((mode (HI)));
typedef int _G_int32_t __attribute__ ((mode (SI)));
typedef unsigned int _G_uint32_t __attribute__ ((mode (SI)));
typedef int _G_int64_t __attribute__ ((mode (DI)));
typedef unsigned int _G_uint64_t __attribute__ ((mode (DI)));
# 30 "/home/arthur/benz/Packages/OpenStep/lib/g++-include/libio.h" 2
# 51 "/home/arthur/benz/Packages/OpenStep/lib/g++-include/libio.h"
struct _IO_jump_t; struct _IO_FILE;
struct _IO_marker {
struct _IO_marker *_next;
struct _IO_FILE *_sbuf;
int _pos;
# 160 "/home/arthur/benz/Packages/OpenStep/lib/g++-include/libio.h"
};
struct _IO_FILE {
int _flags;
char* _IO_read_ptr;
char* _IO_read_end;
char* _IO_read_base;
char* _IO_write_base;
char* _IO_write_ptr;
char* _IO_write_end;
char* _IO_buf_base;
char* _IO_buf_end;
char *_IO_save_base;
char *_IO_backup_base;
char *_IO_save_end;
struct _IO_marker *_markers;
struct _IO_FILE *_chain;
int _fileno;
int _blksize;
_G_off_t _offset;
unsigned short _cur_column;
char _unused;
char _shortbuf[1];
};
typedef struct _IO_FILE _IO_FILE;
struct _IO_FILE_plus;
extern struct _IO_FILE_plus _IO_stdin_, _IO_stdout_, _IO_stderr_;
extern int __underflow (_IO_FILE*) ;
extern int __uflow (_IO_FILE*) ;
extern int __overflow (_IO_FILE*, int) ;
extern int _IO_vfscanf (_IO_FILE*, const char*, _G_va_list , int*) ;
extern int _IO_vfprintf (_IO_FILE*, const char*, _G_va_list ) ;
extern _G_ssize_t _IO_padn (_IO_FILE *, int, _G_ssize_t ) ;
extern _G_size_t _IO_sgetn (_IO_FILE *, void*, _G_size_t ) ;
extern void _IO_free_backup_area (_IO_FILE*) ;
# 36 "/home/arthur/benz/Packages/OpenStep/lib/g++-include/streambuf.h" 2
}
//#include <_G_config.h>
class istream;
class ostream; class streambuf;
// In case some header files defines these as macros.
typedef _G_off_t streamoff;
typedef _G_fpos_t streampos;
typedef _G_ssize_t streamsize;
typedef unsigned long __fmtflags;
typedef unsigned char __iostate;
struct _ios_fields
{ // The data members of an ios.
streambuf *_strbuf;
ostream* _tie;
int _width;
__fmtflags _flags;
short _fill;
__iostate _state;
__iostate _exceptions;
int _precision;
void *_arrays;
};
# 114 "/home/arthur/benz/Packages/OpenStep/lib/g++-include/streambuf.h"
class ios : public _ios_fields {
ios& operator=(ios&);
public:
typedef __fmtflags fmtflags;
typedef int iostate;
typedef int openmode;
typedef int streamsize;
enum io_state {
goodbit = 0 ,
eofbit = 1 ,
failbit = 2 ,
badbit = 4 };
enum open_mode {
in = 1 ,
out = 2 ,
ate = 4 ,
app = 8 ,
trunc = 16 ,
nocreate = 32 ,
noreplace = 64 ,
bin = 128 };
enum seek_dir { beg, cur, end};
// ANSI: typedef enum seek_dir seekdir; etc
// NOTE: If adding flags here, before to update ios::bitalloc().
enum { skipws= 01 ,
left= 02 , right= 04 , internal= 010 ,
dec= 020 , oct= 040 , hex= 0100 ,
showbase= 0200 , showpoint= 0400 ,
uppercase= 01000 , showpos= 02000 ,
scientific= 04000 , fixed= 010000 ,
unitbuf= 020000 , stdio= 040000
};
enum { // Masks.
basefield=dec+oct+hex,
floatfield = scientific+fixed,
adjustfield = left+right+internal
};
# 165 "/home/arthur/benz/Packages/OpenStep/lib/g++-include/streambuf.h"
ostream* tie() const { return _tie; }
ostream* tie(ostream* val) { ostream* save=_tie; _tie=val; return save; }
// Methods to change the format state.
short fill() const { return (short )_fill; }
short fill(short newf)
{short oldf = (short )_fill; _fill = (char)newf; return oldf;}
fmtflags flags() const { return _flags; }
fmtflags flags(fmtflags new_val) {
fmtflags old_val = _flags; _flags = new_val; return old_val; }
int precision() const { return _precision; }
int precision(int newp) {
unsigned short oldp = _precision; _precision = (unsigned short)newp;
return oldp; }
fmtflags setf(fmtflags val) {
fmtflags oldbits = _flags;
_flags |= val; return oldbits; }
fmtflags setf(fmtflags val, fmtflags mask) {
fmtflags oldbits = _flags;
_flags = (_flags & ~mask) | (val & mask); return oldbits; }
fmtflags unsetf(fmtflags mask) {
fmtflags oldbits = _flags;
_flags &= ~mask; return oldbits; }
int width() const { return _width; }
int width(int val) { int save = _width; _width = val; return save; }
void _throw_failure() const { }
void clear(iostate state = 0) {
_state = _strbuf ? state : state|badbit;
if (_state & _exceptions) _throw_failure(); }
void set(iostate flag) { _state |= flag;
if (_state & _exceptions) _throw_failure(); }
void setstate(iostate flag) { _state |= flag; // ANSI
if (_state & _exceptions) _throw_failure(); }
int good() const { return _state == 0; }
int eof() const { return _state & ios::eofbit; }
int fail() const { return _state & (ios::badbit|ios::failbit); }
int bad() const { return _state & ios::badbit; }
iostate rdstate() const { return _state; }
operator void*() const { return fail() ? (void*)0 : (void*)(-1); }
int operator!() const { return fail(); }
iostate exceptions() const { return _exceptions; }
void exceptions(iostate enable) {
_exceptions = enable;
if (_state & _exceptions) _throw_failure(); }
streambuf* rdbuf() const { return _strbuf; }
streambuf* rdbuf(streambuf *_s) {
streambuf *_old = _strbuf; _strbuf = _s; clear (); return _old; }
static int sync_with_stdio(int on);
static void sync_with_stdio() { sync_with_stdio(1); }
static fmtflags bitalloc();
static int xalloc();
void*& pword(int);
void* pword(int) const;
long& iword(int);
long iword(int) const;
// Used to initialize standard streams. Not needed in this implementation.
class Init {
public:
Init () { }
};
protected:
ios(streambuf* sb = 0, ostream* tie_to = 0);
virtual ~ios();
void init(streambuf* sb, ostream* tie = 0);
};
typedef ios::seek_dir _seek_dir;
// Magic numbers and bits for the _flags field.
// The magic numbers use the high-order bits of _flags;
// the remaining bits are abailable for variable flags.
// Note: The magic numbers must all be negative if stdio
// emulation is desired.
// A streammarker remembers a position in a buffer.
// You are guaranteed to be able to seek back to it if it is saving().
class streammarker : private _IO_marker {
friend class streambuf;
void set_offset(int offset) { _pos = offset; }
public:
streammarker(streambuf *sb);
~streammarker();
int saving() { return 1; }
int delta(streammarker&);
int delta();
};
struct streambuf : public _IO_FILE { // protected??
friend class ios;
friend class istream;
friend class ostream;
friend class streammarker;
const void *&_vtable() { return *(const void**)((_IO_FILE*)this + 1); }
protected:
static streambuf* _list_all;
_IO_FILE*& xchain() { return _chain; }
void _un_link();
void _link_in();
char* gptr() const
{ return _flags & 0x100 ? _IO_save_base : _IO_read_ptr; }
char* pptr() const { return _IO_write_ptr; }
char* egptr() const
{ return _flags & 0x100 ? _IO_save_end : _IO_read_end; }
char* epptr() const { return _IO_write_end; }
char* pbase() const { return _IO_write_base; }
char* eback() const
{ return _flags & 0x100 ? _IO_save_base : _IO_read_base;}
char* base() const { return _IO_buf_base; }
char* ebuf() const { return _IO_buf_end; }
int blen() const { return _IO_buf_end - _IO_buf_base; }
void xput_char(char c) { *_IO_write_ptr++ = c; }
int xflags() { return _flags ; }
int xflags(int f) {int fl = _flags ; _flags = f; return fl;}
void xsetflags(int f) { _flags |= f; }
void xsetflags(int f, int mask)
{ _flags = (_flags & ~mask) | (f & mask); }
void gbump(int n)
{ _flags & 0x100 ? (_IO_save_base+=n):(_IO_read_ptr+=n);}
void pbump(int n) { _IO_write_ptr += n; }
void setb(char* b, char* eb, int a=0);
void setp(char* p, char* ep)
{ _IO_write_base=_IO_write_ptr=p; _IO_write_end=ep; }
void setg(char* eb, char* g, char *eg) {
if (_flags & 0x100 ) _IO_free_backup_area(this);
_IO_read_base = eb; _IO_read_ptr = g; _IO_read_end = eg; }
char *shortbuf() { return _shortbuf; }
int in_backup() { return _flags & 0x100 ; }
// The start of the main get area: FIXME: wrong for write-mode filebuf?
char *Gbase() { return in_backup() ? _IO_save_base : _IO_read_base; }
// The end of the main get area:
char *eGptr() { return in_backup() ? _IO_save_end : _IO_read_end; }
// The start of the backup area:
char *Bbase() { return in_backup() ? _IO_read_base : _IO_save_base; }
char *Bptr() { return _IO_backup_base; }
// The end of the backup area:
char *eBptr() { return in_backup() ? _IO_read_end : _IO_save_end; }
char *Nbase() { return _IO_save_base; }
char *eNptr() { return _IO_save_end; }
int have_backup() { return _IO_save_base != ((void *)0) ; }
int have_markers() { return _markers != ((void *)0) ; }
void free_backup_area();
void unsave_markers(); // Make all streammarkers !saving().
int put_mode() { return _flags & 0x800 ; }
int switch_to_get_mode();
streambuf(int flags=0);
public:
static int flush_all();
static void flush_all_linebuffered(); // Flush all line buffered files.
virtual ~streambuf();
virtual int overflow(int c = (-1) ); // Leave public for now
virtual int underflow(); // Leave public for now
virtual int uflow(); // Leave public for now
virtual int pbackfail(int c);
// virtual int showmany ();
virtual streamsize xsputn(const char* s, streamsize n);
virtual streamsize xsgetn(char* s, streamsize n);
virtual streampos seekoff(streamoff, _seek_dir, int mode=ios::in|ios::out);
virtual streampos seekpos(streampos pos, int mode = ios::in|ios::out);
streampos sseekoff(streamoff, _seek_dir, int mode=ios::in|ios::out);
streampos sseekpos(streampos pos, int mode = ios::in|ios::out);
virtual streambuf* setbuf(char* p, int len);
virtual int sync();
virtual int doallocate();
int seekmark(streammarker& mark, int delta = 0);
int sputbackc(char c);
int sungetc();
int unbuffered() { return _flags & 2 ? 1 : 0; }
int linebuffered() { return _flags & 0x200 ? 1 : 0; }
void unbuffered(int i)
{ if (i) _flags |= 2 ; else _flags &= ~2 ; }
void linebuffered(int i)
{ if (i) _flags |= 0x200 ; else _flags &= ~0x200 ; }
int allocate() { // For AT&T compatibility
if (base() || unbuffered()) return 0;
else return doallocate(); }
// Allocate a buffer if needed; use _shortbuf if appropriate.
void allocbuf() { if (base() == ((void *)0) ) doallocbuf(); }
void doallocbuf();
int in_avail() { return _IO_read_end - _IO_read_ptr; }
int out_waiting() { return _IO_write_ptr - _IO_write_base; }
streamsize sputn(const char* s, streamsize n) { return xsputn(s, n); }
streamsize padn(char pad, streamsize n) { return _IO_padn(this, pad, n); }
streamsize sgetn(char* s, streamsize n) { return _IO_sgetn(this, s, n); }
int ignore(int);
int get_column();
int set_column(int);
long sgetline(char* buf, _G_size_t n, char delim, int putback_delim);
int sputc(int c) { return ((( this )->_IO_write_ptr >= ( this )->_IO_write_end) ? __overflow( this , (unsigned char)( c )) : (unsigned char)(*( this )->_IO_write_ptr++ = ( c ))) ; }
int sbumpc() { return (( this )->_IO_read_ptr >= ( this )->_IO_read_end ? __uflow( this ) : *(unsigned char*)( this )->_IO_read_ptr++) ; }
int sgetc() { return (( this )->_IO_read_ptr >= ( this )->_IO_read_end && __underflow( this ) == (-1) ? (-1) : *(unsigned char*)( this )->_IO_read_ptr) ; }
int snextc() {
if (_IO_read_ptr >= _IO_read_end && __underflow(this) == (-1) )
return (-1) ;
else return _IO_read_ptr++, sgetc(); }
void stossc() { if (_IO_read_ptr < _IO_read_end) _IO_read_ptr++; }
int vscan(char const *fmt0, _G_va_list ap, ios* stream = ((void *)0) );
int scan(char const *fmt0 ...);
int vform(char const *fmt0, _G_va_list ap);
int form(char const *fmt0 ...);
virtual streamsize sys_read(char* buf, streamsize size);
virtual streamsize sys_write(const char*, streamsize);
virtual streampos sys_seek(streamoff, _seek_dir);
virtual int sys_close();
virtual int sys_stat(void*); // Actually, a (struct stat*)
};
// A backupbuf is a streambuf with full backup and savepoints on reading.
// All standard streambufs in the GNU iostream library are backupbufs.
class filebuf : public streambuf {
protected:
void init();
public:
static const int openprot; // Non-ANSI AT&T-ism: Default open protection.
filebuf();
filebuf(int fd);
filebuf(int fd, char* p, int len);
~filebuf();
filebuf* attach(int fd);
filebuf* open(const char *filename, const char *mode);
filebuf* open(const char *filename, ios::openmode mode, int prot = 0664);
virtual int underflow();
virtual int overflow(int c = (-1) );
int is_open() const { return _fileno >= 0; }
int fd() const { return is_open() ? _fileno : (-1) ; }
filebuf* close();
virtual int doallocate();
virtual streampos seekoff(streamoff, _seek_dir, int mode=ios::in|ios::out);
virtual streambuf* setbuf(char* p, int len);
streamsize xsputn(const char* s, streamsize n);
streamsize xsgetn(char* s, streamsize n);
virtual int sync();
protected: // See documentation in filebuf.C.
// virtual int pbackfail(int c);
int is_reading() { return eback() != egptr(); }
char* cur_ptr() { return is_reading() ? gptr() : pptr(); }
char* file_ptr() { return eGptr(); }
// Low-level operations (Usually invoke system calls.)
virtual streamsize sys_read(char* buf, streamsize size);
virtual streampos sys_seek(streamoff, _seek_dir);
virtual streamsize sys_write(const char*, streamsize);
virtual int sys_stat(void*); // Actually, a (struct stat*)
virtual int sys_close();
};
inline void ios::init(streambuf* sb, ostream* tie_to) {
_state = sb ? ios::goodbit : ios::badbit; _exceptions=0;
_strbuf=sb; _tie = tie_to; _width=0; _fill=' ';
_flags=ios::skipws|ios::dec;
_precision=6; _arrays = 0; }
inline ios::ios(streambuf* sb, ostream* tie_to) { init(sb, tie_to); }
inline ios::~ios() {
if (_arrays) delete [] _arrays;
}
# 31 "/home/arthur/benz/Packages/OpenStep/lib/g++-include/iostream.h" 2
class istream; class ostream;
typedef ios& (*__manip)(ios&);
typedef istream& (*__imanip)(istream&);
typedef ostream& (*__omanip)(ostream&);
extern istream& ws(istream& ins);
extern ostream& flush(ostream& outs);
extern ostream& endl(ostream& outs);
extern ostream& ends(ostream& outs);
class ostream : virtual public ios
{
// NOTE: If fields are changed, you must fix _fake_ostream in stdstreams.C!
void do_osfx();
public:
ostream() { }
ostream(streambuf* sb, ostream* tied= ((void *)0) );
int opfx() {
if (!good()) return 0; else { if (_tie) _tie->flush(); return 1;} }
void osfx() { if (flags() & (ios::unitbuf|ios::stdio))
do_osfx(); }
ostream& flush();
ostream& put(char c) { _strbuf->sputc(c); return *this; }
ostream& write(const char *s, streamsize n);
ostream& write(const unsigned char *s, streamsize n)
{ return write((const char*)s, n);}
ostream& write(const signed char *s, streamsize n)
{ return write((const char*)s, n);}
ostream& write(const void *s, streamsize n)
{ return write((const char*)s, n);}
ostream& seekp(streampos);
ostream& seekp(streamoff, _seek_dir);
streampos tellp();
ostream& form(const char *format ...);
ostream& vform(const char *format, _G_va_list args);
ostream& operator<<(char c);
ostream& operator<<(unsigned char c) { return (*this) << (char)c; }
ostream& operator<<(signed char c) { return (*this) << (char)c; }
ostream& operator<<(const char *s);
ostream& operator<<(const unsigned char *s)
{ return (*this) << (const char*)s; }
ostream& operator<<(const signed char *s)
{ return (*this) << (const char*)s; }
ostream& operator<<(const void *p);
ostream& operator<<(int n);
ostream& operator<<(unsigned int n);
ostream& operator<<(long n);
ostream& operator<<(unsigned long n);
ostream& operator<<(long long n);
ostream& operator<<(unsigned long long n);
ostream& operator<<(short n) {return operator<<((int)n);}
ostream& operator<<(unsigned short n) {return operator<<((unsigned int)n);}
ostream& operator<<(bool b) { return operator<<((int)b); }
ostream& operator<<(double n);
ostream& operator<<(float n) { return operator<<((double)n); }
ostream& operator<<(long double n) { return operator<<((double)n); }
ostream& operator<<(__omanip func) { return (*func)(*this); }
ostream& operator<<(__manip func) {(*func)(*this); return *this;}
ostream& operator<<(streambuf*);
};
class istream : virtual public ios
{
// NOTE: If fields are changed, you must fix _fake_istream in stdstreams.C!
protected:
_G_size_t _gcount;
int _skip_ws();
public:
istream() { _gcount = 0; }
istream(streambuf* sb, ostream*tied= ((void *)0) );
istream& get(char* ptr, int len, char delim = '\n');
istream& get(unsigned char* ptr, int len, char delim = '\n')
{ return get((char*)ptr, len, delim); }
istream& get(char& c);
istream& get(unsigned char& c) { return get((char&)c); }
istream& getline(char* ptr, int len, char delim = '\n');
istream& getline(unsigned char* ptr, int len, char delim = '\n')
{ return getline((char*)ptr, len, delim); }
istream& get(signed char& c) { return get((char&)c); }
istream& get(signed char* ptr, int len, char delim = '\n')
{ return get((char*)ptr, len, delim); }
istream& getline(signed char* ptr, int len, char delim = '\n')
{ return getline((char*)ptr, len, delim); }
istream& read(char *ptr, streamsize n);
istream& read(unsigned char *ptr, streamsize n)
{ return read((char*)ptr, n); }
istream& read(signed char *ptr, streamsize n)
{ return read((char*)ptr, n); }
istream& read(void *ptr, streamsize n)
{ return read((char*)ptr, n); }
istream& get(streambuf& sb, char delim = '\n');
istream& gets(char **s, char delim = '\n');
int ipfx(int need) {
if (!good()) { set(ios::failbit); return 0; }
else {
if (_tie && (need == 0 || rdbuf()->in_avail() < need)) _tie->flush();
if (!need && (flags() & ios::skipws)) return _skip_ws();
else return 1;
}
}
int ipfx0() { // Optimized version of ipfx(0).
if (!good()) { set(ios::failbit); return 0; }
else {
if (_tie) _tie->flush();
if (flags() & ios::skipws) return _skip_ws();
else return 1;
}
}
int ipfx1() { // Optimized version of ipfx(1).
if (!good()) { set(ios::failbit); return 0; }
else {
if (_tie && rdbuf()->in_avail() == 0) _tie->flush();
return 1;
}
}
void isfx() { }
int get() { if (!ipfx1()) return (-1) ;
else { int ch = _strbuf->sbumpc();
if (ch == (-1) ) set(ios::eofbit);
return ch;
} }
int peek();
_G_size_t gcount() { return _gcount; }
istream& ignore(int n=1, int delim = (-1) );
istream& seekg(streampos);
istream& seekg(streamoff, _seek_dir);
streampos tellg();
istream& putback(char ch) {
if (good() && _strbuf->sputbackc(ch) == (-1) ) clear(ios::badbit);
return *this;}
istream& unget() {
if (good() && _strbuf->sungetc() == (-1) ) clear(ios::badbit);
return *this;}
istream& scan(const char *format ...);
istream& vscan(const char *format, _G_va_list args);
istream& operator>>(char*);
istream& operator>>(unsigned char* p) { return operator>>((char*)p); }
istream& operator>>(signed char*p) { return operator>>((char*)p); }
istream& operator>>(char& c);
istream& operator>>(unsigned char& c) {return operator>>((char&)c);}
istream& operator>>(signed char& c) {return operator>>((char&)c);}
istream& operator>>(int&);
istream& operator>>(long&);
istream& operator>>(long long&);
istream& operator>>(unsigned long long&);
istream& operator>>(short&);
istream& operator>>(unsigned int&);
istream& operator>>(unsigned long&);
istream& operator>>(unsigned short&);
istream& operator>>(bool&);
istream& operator>>(float&);
istream& operator>>(double&);
istream& operator>>(long double&);
istream& operator>>( __manip func) {(*func)(*this); return *this;}
istream& operator>>(__imanip func) { return (*func)(*this); }
istream& operator>>(streambuf*);
};
class iostream : public istream, public ostream
{
public:
iostream() { }
iostream(streambuf* sb, ostream*tied= ((void *)0) );
};
class _IO_istream_withassign : public istream {
public:
_IO_istream_withassign& operator=(istream&);
};
class _IO_ostream_withassign : public ostream {
public:
_IO_ostream_withassign& operator=(ostream&);
};
extern _IO_istream_withassign cin;
// clog->rdbuf() == cerr->rdbuf()
extern _IO_ostream_withassign cout, cerr, clog;
struct Iostream_init { } ; // Compatibility hack for AT&T library.
inline ios& dec(ios& i)
{ i.setf(ios::dec, ios::dec|ios::hex|ios::oct); return i; }
inline ios& hex(ios& i)
{ i.setf(ios::hex, ios::dec|ios::hex|ios::oct); return i; }
inline ios& oct(ios& i)
{ i.setf(ios::oct, ios::dec|ios::hex|ios::oct); return i; }
# 30 "/home/arthur/benz/Packages/GraLab3/src/include/graph.h" 2
# 1 "/home/arthur/benz/Packages/OpenStep/lib/gcc-lib/sparc-sun-solaris2.4/2.7.0/include/stdarg.h" 1 3
# 1 "/home/arthur/benz/Packages/OpenStep/lib/gcc-lib/sparc-sun-solaris2.4/2.7.0/include/va-sparc.h" 1 3
# 19 "/home/arthur/benz/Packages/OpenStep/lib/gcc-lib/sparc-sun-solaris2.4/2.7.0/include/va-sparc.h" 3
typedef void * __gnuc_va_list;
# 50 "/home/arthur/benz/Packages/OpenStep/lib/gcc-lib/sparc-sun-solaris2.4/2.7.0/include/va-sparc.h" 3
# 88 "/home/arthur/benz/Packages/OpenStep/lib/gcc-lib/sparc-sun-solaris2.4/2.7.0/include/va-sparc.h" 3
void va_end (__gnuc_va_list);
enum __va_type_classes {
__no_type_class = -1,
__void_type_class,
__integer_type_class,
__char_type_class,
__enumeral_type_class,
__boolean_type_class,
__pointer_type_class,
__reference_type_class,
__offset_type_class,
__real_type_class,
__complex_type_class,
__function_type_class,
__method_type_class,
__record_type_class,
__union_type_class,
__array_type_class,
__string_type_class,
__set_type_class,
__file_type_class,
__lang_type_class
};
# 175 "/home/arthur/benz/Packages/OpenStep/lib/gcc-lib/sparc-sun-solaris2.4/2.7.0/include/va-sparc.h" 3
# 198 "/home/arthur/benz/Packages/OpenStep/lib/gcc-lib/sparc-sun-solaris2.4/2.7.0/include/va-sparc.h" 3
# 30 "/home/arthur/benz/Packages/OpenStep/lib/gcc-lib/sparc-sun-solaris2.4/2.7.0/include/stdarg.h" 2 3
# 96 "/home/arthur/benz/Packages/OpenStep/lib/gcc-lib/sparc-sun-solaris2.4/2.7.0/include/stdarg.h" 3
typedef __gnuc_va_list va_list;
# 165 "/home/arthur/benz/Packages/OpenStep/lib/gcc-lib/sparc-sun-solaris2.4/2.7.0/include/stdarg.h" 3
# 31 "/home/arthur/benz/Packages/GraLab3/src/include/graph.h" 2
# 1 "/home/arthur/benz/Packages/OpenStep/lib/gcc-lib/sparc-sun-solaris2.4/2.7.0/include/stdio.h" 1 3
#pragma ident "@(#)stdio.h 1.34 94/06/07 SMI"
typedef long fpos_t;
typedef struct
{
int _cnt;
unsigned char *_ptr;
unsigned char *_base;
unsigned char _flag;
unsigned char _file;
} FILE;
extern FILE __iob[20 ];
extern FILE *_lastbuf;
extern unsigned char *_bufendtab[];
extern unsigned char _sibuf[], _sobuf[];
extern int remove(const char *);
extern int rename(const char *, const char *);
extern FILE *tmpfile(void);
extern char *tmpnam(char *);
extern int fclose(FILE *);
extern int fflush(FILE *);
extern FILE *fopen(const char *, const char *);
extern FILE *freopen(const char *, const char *, FILE *);
extern void setbuf(FILE *, char *);
extern int setvbuf(FILE *, char *, int, size_t);
extern int fprintf(FILE *, const char *, ...);
extern int fscanf(FILE *, const char *, ...);
extern int printf(const char *, ...);
extern int scanf(const char *, ...);
extern int sprintf(char *, const char *, ...);
extern int sscanf(const char *, const char *, ...);
extern int vfprintf(FILE *, const char *, void *);
extern int vprintf(const char *, void *);
extern int vsprintf(char *, const char *, void *);
extern int fgetc(FILE *);
extern char *fgets(char *, int, FILE *);
extern int fputc(int, FILE *);
extern int fputs(const char *, FILE *);
extern int getc(FILE *);
extern int getchar(void);
extern char *gets(char *);
extern int putc(int, FILE *);
extern int putchar(int);
extern int puts(const char *);
extern int ungetc(int, FILE *);
extern size_t fread(void *, size_t, size_t, FILE *);
#pragma int_to_unsigned fread
extern size_t fwrite(const void *, size_t, size_t, FILE *);
#pragma int_to_unsigned fwrite
extern int fgetpos(FILE *, fpos_t *);
extern int fseek(FILE *, long, int);
extern int fsetpos(FILE *, const fpos_t *);
extern long ftell(FILE *);
extern void rewind(FILE *);
extern void clearerr(FILE *);
extern int feof(FILE *);
extern int ferror(FILE *);
extern void perror(const char *);
extern int __filbuf(FILE *);
extern int __flsbuf(int, FILE *);
# 244 "/home/arthur/benz/Packages/OpenStep/lib/gcc-lib/sparc-sun-solaris2.4/2.7.0/include/stdio.h" 3
extern FILE *fdopen(int, const char *);
extern char *ctermid(char *);
extern int fileno(FILE *);
extern FILE *popen(const char *, const char *);
extern char *cuserid(char *);
extern char *tempnam(const char *, const char *);
extern int getopt(int, char *const *, const char *);
extern int getsubopt(char **, char *const *, char **);
extern char *optarg;
extern int optind, opterr, optopt;
extern int getw(FILE *);
extern int putw(int, FILE *);
extern int pclose(FILE *);
# 341 "/home/arthur/benz/Packages/OpenStep/lib/gcc-lib/sparc-sun-solaris2.4/2.7.0/include/stdio.h" 3
# 32 "/home/arthur/benz/Packages/GraLab3/src/include/graph.h" 2
# 1 "/home/arthur/benz/Packages/GraLab3/src/include/graphconfig.h" 1
// graphconfig.h
// default values for undefined environment variables
# 35 "/home/arthur/benz/Packages/GraLab3/src/include/graph.h" 2
# 1 "/home/arthur/benz/Packages/GraLab3/src/include/undo.h" 1
class G_undoStack;
// class for high level items
typedef void (*G_action)(void *);
class G_undoStack
{
struct item
{
enum itemType { assignInt, assignUInt, assignPointer,
undoAction, clearAction, action,
marker }
type;
union {
int vInt;
unsigned vUInt;
void * vPointer;
} value;
union {
int *pI;
unsigned *pUI;
void **pP;
G_action action;
} address;
};
private:
unsigned sz, count;
int status; // 0== ok, 1== overflow
item * itemTable;
void overflow(const char *funcName);
public:
G_undoStack(unsigned size=1000);
// size = Anzahl der Elemente, die auf den
// Stapel passen
~G_undoStack();
// ruft _clear auf und gibt den
// vom Stapel belegten Platz wieder frei
void undo(unsigned markerValue);
// verwirft alle Aenderungen seit
// Schreiben der Markierung mit dem Wert
// markerValue, dazu werden die durch
// Zuweisungen ueberschriebenen Werte wieder
// restauriert und ggf. durch pushUndoAction,
// und pushAction gespeicherte Aktionen
// ausgefuehrt
// anschliessend enthaelt der Stapel noch
// die vor dem Schreiben der Markierung
// protokollierten Aenderungen
void _clear();
inline void clear();
// bestaetigt alle Aenderungen, entfernt
// dazu alle Elemente vom Stapel
// und fuehrt ggf. durch pushClearAction,
// und pushAction gespeicherte Aktionen
// aus
inline void pushAssignInt(int *addr);
// protokolliert eine int-Zuweisung an
// Adresse addr, der alte Wert wird gesichert
inline void pushAssignUInt(unsigned *addr);
// protokolliert eine unsigned int-Zuweisung
inline void pushAssignPointer(void **addr);
// protokolliert eine pointer-Zuweisung
inline void pushUndoAction(G_action action, void *param);
// speichert eine Aktion, die im Falle
// eines undo durchgefuehrt werden soll
inline void pushClearAction(G_action action, void *param);
// speichert eine Aktion, die im Falle
// eines clear durchgefuehrt werden soll
inline void pushAction(G_action action, void *param);
// speichert eine Aktion, die immer
// ausgefuehrt werden soll
// gedacht zur Freigabe groesserer Parameter-
// pakete fuer push(Undo|Clear)Action
// Bsp.:
// pParams= new paraStruct;
// pParams->parameterX=12;
// pParams->parameterY=3.1415927
// uS.pushAction(free, pParams);
// uS.pushUndoAction(actionXYZ, pParams);
inline void mark(unsigned markerValue);
// schreibt eine Markierung mit dem Wert
// markerValue
inline int isOk();
// testet auf Ueberlauf des Stapels
// nach einem Stapelueberlauf kann
// kein undo ausgefuehrt werden, durch
// clear kann der Stapel aber weiter verwendet
// werden
unsigned getAvailable() { return status ? 0 : sz-count; };
int isMarked(unsigned markerValue);
// testet, ob eine Markierung mit dem Wert
// markerValue auf dem Stapel existiert
};
inline void G_undoStack::clear()
{
_clear();
status=0;
}
inline int G_undoStack::isOk()
{
return status==0;
}
inline void G_undoStack::pushAssignInt(int *lhs)
{
if (count==sz)
overflow("pushAssignInt");
if (!status)
{
itemTable[count].value.vInt=*(itemTable[count].address.pI=lhs);
itemTable[count].type=item::assignInt;
++count;
}
}
inline void G_undoStack::pushAssignUInt(unsigned *lhs)
{
if (count==sz)
overflow("pushAssignInt");
if (!status)
{
itemTable[count].value.vUInt=*(itemTable[count].address.pUI=lhs);
itemTable[count].type=item::assignUInt;
++count;
}
}
inline void G_undoStack::pushAssignPointer(void **lhs)
{
if (count==sz)
overflow("pushAssignPointer");
if (!status)
{
itemTable[count].value.vPointer=*(itemTable[count].address.pP=lhs);
itemTable[count].type=item::assignPointer;
++count;
}
}
inline void G_undoStack::pushUndoAction(G_action action, void *param)
{
if (count==sz)
overflow("pushUndoAction");
if (!status)
{
itemTable[count].value.vPointer=param;
itemTable[count].address.action=action;
itemTable[count].type=item::undoAction;
++count;
}
}
inline void G_undoStack::pushClearAction(G_action action, void *param)
{
if (count==sz)
overflow("pushClearAction");
if (!status)
{
itemTable[count].value.vPointer=param;
itemTable[count].address.action=action;
itemTable[count].type=item::clearAction;
++count;
}
}
inline void G_undoStack::pushAction(G_action action, void *param)
{
if (count==sz)
overflow("pushAction");
if (!status)
{
itemTable[count].value.vPointer=param;
itemTable[count].address.action=action;
itemTable[count].type=item::action;
++count;
}
}
inline void G_undoStack::mark(unsigned markerValue)
{
if (count==sz)
overflow("mark");
if (!status)
{
itemTable[count].value.vUInt=markerValue;
itemTable[count].type=item::marker;
++count;
}
}
# 266 "/home/arthur/benz/Packages/GraLab3/src/include/undo.h"
# 37 "/home/arthur/benz/Packages/GraLab3/src/include/graph.h" 2
# 1 "/home/arthur/benz/Packages/GraLab3/src/include/message.h" 1
class G_msg {
private:
static int initialized;
static char msgStr[100], errStr[100], fErrStr[100], infStr[100],
conFndStr[100], actTakStr[100], reaProStr[100];
static char msgPath[600];
static void print(int sev, int nr, const char *mod, const char *fun, va_list va_ptr);
static int seekMsgEntry(FILE *fp, int nr);
public:
static int errorCount, maxErrorCount;
static void warning (int nr, const char *modName, const char *funcName, ...),
error (int nr, const char *modName, const char *funcName, ...),
fatalError (int nr, const char *modName, const char *funcName, ...);
static void setHeaders(const char *fileName="msgems");
static void addDirectory(const char *directoryName);
};
# 41 "/home/arthur/benz/Packages/GraLab3/src/include/graph.h" 2
# 1 "/home/arthur/benz/Packages/GraLab3/src/include/checking.h" 1
// debugging gralab
# 42 "/home/arthur/benz/Packages/GraLab3/src/include/graph.h" 2
# 1 "/home/arthur/benz/Packages/GraLab3/src/include/trace.h" 1
class G_trace
{
private:
static G_trace *entry[100 ];
static int numEntry;
static int globFlag;
static int level;
public:
static ostream *out;
static void enter() { ++level; };
static void leave() { if (level) --level; };
static void indent();
static int set(char *pattern, int flag);
static void set(int flag) { globFlag=flag; };
static void setFile(const char *fileName);
private:
int flag;
char *name;
public:
int reg();
G_trace(char *n)
{ name=strdup(n); flag=0; reg(); };
int check() { return flag && globFlag; };
};
# 64 "/home/arthur/benz/Packages/GraLab3/src/include/trace.h"
# 43 "/home/arthur/benz/Packages/GraLab3/src/include/graph.h" 2
# 1 "/home/arthur/benz/Packages/GraLab3/src/include/fns.h" 1
int G_getEnvVar(const char *varId, int def);
unsigned G_getEnvVar(const char *varId, unsigned def);
void G_getEnvVar(const char *varId, char *dest, const char *def, int maxLength);
FILE *G_flopen(const char *libs, const char *file, const char *flags);
int G_scan(istream &iS, const char *string);
# 46 "/home/arthur/benz/Packages/GraLab3/src/include/graph.h" 2
# 1 "/home/arthur/benz/Packages/OpenStep/lib/gcc-lib/sparc-sun-solaris2.4/2.7.0/include/math.h" 1 3
#pragma ident "@(#)math.h 2.3 93/09/07"
typedef union _h_val {
unsigned long _i[2];
double _d;
} _h_val;
extern const _h_val __huge_val;
extern int signgam;
enum version {libm_ieee = -1, c_issue_4, ansi_1, strict_ansi};
extern const enum version _lib_version;
struct exception {
int type;
char *name;
double arg1;
double arg2;
double retval;
};
extern double acos (double) ;
extern double asin (double) ;
extern double atan (double) ;
extern double atan2 (double, double) ;
extern double cos (double) ;
extern double sin (double) ;
extern double tan (double) ;
extern double cosh (double) ;
extern double sinh (double) ;
extern double tanh (double) ;
extern double exp (double) ;
extern double frexp (double, int *) ;
extern double ldexp (double, int) ;
extern double log (double) ;
extern double log10 (double) ;
extern double modf (double, double *) ;
extern double pow (double, double) ;
extern double sqrt (double) ;
extern double ceil (double) ;
extern double fabs (double) ;
extern double floor (double) ;
extern double fmod (double, double) ;
extern double erf (double) ;
extern double erfc (double) ;
extern double gamma (double) ;
extern double hypot (double, double) ;
extern int isnan (double) ;
extern double j0 (double) ;
extern double j1 (double) ;
extern double jn (int, double) ;
extern double lgamma (double) ;
extern double y0 (double) ;
extern double y1 (double) ;
extern double yn (int, double) ;
extern double acosh (double) ;
extern double asinh (double) ;
extern double atanh (double) ;
extern double cbrt (double) ;
extern double logb (double) ;
extern double nextafter (double, double) ;
extern double remainder (double, double) ;
extern double scalb (double, double) ;
extern int matherr (struct exception *) ;
extern double significand (double) ;
extern double copysign (double, double) ;
extern int ilogb (double) ;
extern double rint (double) ;
extern double scalbn (double, int) ;
extern double expm1 (double) ;
extern double log1p (double) ;
extern float modff (float, float *) ;
# 1 "/home/arthur/benz/Packages/OpenStep/lib/gcc-lib/sparc-sun-solaris2.4/2.7.0/include/floatingpoint.h" 1 3
#pragma ident "@(#)floatingpoint.h 2.3 93/09/07 SunPro"
# 1 "/home/arthur/benz/Packages/OpenStep/lib/gcc-lib/sparc-sun-solaris2.4/2.7.0/include/sys/ieeefp.h" 1 3
#pragma ident "@(#)ieeefp.h 2.3 93/09/07 SunPro"
enum fp_direction_type {
fp_nearest = 0,
fp_tozero = 1,
fp_positive = 2,
fp_negative = 3
};
enum fp_precision_type {
fp_extended = 0,
fp_single = 1,
fp_double = 2,
fp_precision_3 = 3
};
enum fp_exception_type {
fp_inexact = 0,
fp_division = 1,
fp_underflow = 2,
fp_overflow = 3,
fp_invalid = 4
};
# 64 "/home/arthur/benz/Packages/OpenStep/lib/gcc-lib/sparc-sun-solaris2.4/2.7.0/include/sys/ieeefp.h" 3
enum fp_class_type {
fp_zero = 0,
fp_subnormal = 1,
fp_normal = 2,
fp_infinity = 3,
fp_quiet = 4,
fp_signaling = 5
};
# 35 "/home/arthur/benz/Packages/OpenStep/lib/gcc-lib/sparc-sun-solaris2.4/2.7.0/include/floatingpoint.h" 2 3
typedef int sigfpe_code_type;
typedef void (*sigfpe_handler_type)();
extern sigfpe_handler_type sigfpe (sigfpe_code_type, sigfpe_handler_type) ;
typedef float single;
typedef unsigned extended[3];
typedef long double quadruple;
typedef unsigned fp_exception_field_type;
typedef char decimal_string[512 ];
typedef struct {
enum fp_class_type fpclass;
int sign;
int exponent;
decimal_string ds;
int more;
int ndigits;
} decimal_record;
enum decimal_form {
fixed_form,
floating_form
};
typedef struct {
enum fp_direction_type rd;
enum decimal_form df;
int ndigits;
} decimal_mode;
enum decimal_string_form {
invalid_form,
whitespace_form,
fixed_int_form,
fixed_intdot_form,
fixed_dotfrac_form,
fixed_intdotfrac_form,
floating_int_form,
floating_intdot_form,
floating_dotfrac_form,
floating_intdotfrac_form,
inf_form,
infinity_form,
nan_form,
nanstring_form
};
extern void single_to_decimal (single *, decimal_mode *, decimal_record *,
fp_exception_field_type *) ;
extern void double_to_decimal (double *, decimal_mode *, decimal_record *,
fp_exception_field_type *) ;
extern void extended_to_decimal (extended *, decimal_mode *,
decimal_record *, fp_exception_field_type *) ;
extern void quadruple_to_decimal (quadruple *, decimal_mode *,
decimal_record *, fp_exception_field_type *) ;
extern void decimal_to_single (single *, decimal_mode *, decimal_record *,
fp_exception_field_type *) ;
extern void decimal_to_double (double *, decimal_mode *, decimal_record *,
fp_exception_field_type *) ;
extern void decimal_to_extended (extended *, decimal_mode *,
decimal_record *, fp_exception_field_type *) ;
extern void decimal_to_quadruple (quadruple *, decimal_mode *,
decimal_record *, fp_exception_field_type *) ;
extern void string_to_decimal (char **, int, int, decimal_record *,
enum decimal_string_form *, char **) ;
extern void func_to_decimal (char **, int, int, decimal_record *,
enum decimal_string_form *, char **,
int (*)(void), int *, int (*)(int)) ;
extern void file_to_decimal (char **, int, int, decimal_record *,
enum decimal_string_form *, char **,
FILE *, int *) ;
extern char *seconvert (single *, int, int *, int *, char *) ;
extern char *sfconvert (single *, int, int *, int *, char *) ;
extern char *sgconvert (single *, int, int, char *) ;
extern char *econvert (double, int, int *, int *, char *) ;
extern char *fconvert (double, int, int *, int *, char *) ;
extern char *gconvert (double, int, int, char *) ;
extern char *qeconvert (quadruple *, int, int *, int *, char *) ;
extern char *qfconvert (quadruple *, int, int *, int *, char *) ;
extern char *qgconvert (quadruple *, int, int, char *) ;
extern char *ecvt (double, int, int *, int *) ;
extern char *fcvt (double, int, int *, int *) ;
extern char *gcvt (double, int, char *) ;
extern double atof (const char *) ;
extern double strtod (const char *, char **) ;
# 206 "/home/arthur/benz/Packages/OpenStep/lib/gcc-lib/sparc-sun-solaris2.4/2.7.0/include/math.h" 2 3
# 50 "/home/arthur/benz/Packages/GraLab3/src/include/graph.h" 2
# 1 "/home/arthur/benz/Packages/GraLab3/src/include/type.h" 1
# 1 "/home/arthur/benz/Packages/GraLab3/src/include/atrschem.h" 1
typedef unsigned G_attrNo; // Attributnummern haben diesen Typ
extern const G_attrNo G_AttrNoNull; // Nummer fuer kein Attributschema
extern const G_attrNo G_AttrNoUnknown;// Kennzeichnet ein unbekanntes Attributschema
class G_attribute; // Oberklasse der Attributschemata
typedef G_attribute *(*G_restoreFunctionT)(istream &, unsigned);
// Typ der Lesemethoden von
// Attributschemata
class G_graph;
class G_attrSchema // Objekte dieser Klasse
// repraesentieren Attributschemata
{
private:
const char * idString; // Identifikationsstring
G_attrNo attrNo; // Nummer des Attributsschemas
G_restoreFunctionT
restoreFunc; // Zeiger auf Lesefunktion dieses
// Schemas
static G_attrNo attrCount, attrMax;
static G_attrSchema ** attrTable;
static void init(); // Initialisierung der Tabelle
void regSchema(); // Registrierung eines Schemas
// Vergabe der Schemanummer
public:
G_attrSchema(const char *idStr,
G_restoreFunctionT restore);
// Konstruktor, traegt Schema unter
// der Bezeichnung idStr mit der
// Lesemethode restore ein
inline G_attrNo getAttrNo() const;
// liefert Attributnummer des Schemas,
// oder G_AttrNull, falls noch nicht
// registriert
inline const char * getAttrId() const;
// liefert die Bezeichnung des Schemas
static G_attrNo getAttrNo(const char *idString);
// liefert Attributnummer des Schemas
// mit Bezeichnung idString,
// G_AttrNoUnknown
// falls nicht bekannt.
inline static const G_attrSchema &
getSchema(G_attrNo aNo);
// liefert das Schema mit der Nummer
// aNo
static G_attribute * restore(G_attrNo, istream &iS, unsigned length);
};
inline G_attrNo G_attrSchema::getAttrNo() const
{
return attrNo;
};
inline const char *G_attrSchema::getAttrId() const
{
return idString;
};
inline const G_attrSchema &G_attrSchema::getSchema(G_attrNo aNo)
{
return *attrTable[aNo];
}
# 26 "/home/arthur/benz/Packages/GraLab3/src/include/type.h" 2
typedef unsigned G_typeNo; // Typnummern haben diesen Typ
extern const G_typeNo G_NotUsed; // kein Typ, sondern Kennzeichnung eines
// ungenutzten Knotens oder Kante
extern const G_typeNo G_TypeNoNull; // fuer untypisierte Knoten oder
// Kanten
extern const G_typeNo G_TypeUnusable; // kennzeichnet Fehler bei Aufruf
// des G_type Konstruktors
class G_graph;
class G_type;
class G_typeSystem
{
friend G_type;
private:
G_typeSystem(const G_typeSystem &);
// kein Copy-Konstruktor
G_typeSystem & operator=(const G_typeSystem &);
// keine Zuweisung
protected:
G_typeNo typeCount, typeM;
// Anzahl der Typen, Groesse der Tabelle
G_type ** typeTable; // Tabelle mit Zeigern auf alle Typen
unsigned * subTypeTable; // Tabelle der (isA)* Relation
unsigned subTypeTableLine;
// Laenge einer Zeile in subTypeTable
// in unsigned int
void init(unsigned tMax);
G_typeNo newType(G_type &type);
// traegt Type type in das Typsystem ein
// setzt Bit is-a(type, type)
// und liefert die Nummer des neuen
// Typs
// wird von G-type::G_type(...)
// aufgerufen
void setSubType(G_typeNo subNo, G_typeNo superNo);
// setzt das entsprechende Bit in
// subTypeTable
inline int isValid(G_typeNo tNo) const;
// testet, ob tNo gueltige Typnummer
public:
G_typeSystem(unsigned typeMax
=G_getEnvVar("G_MaxType", 200 ) );
// erzeugt ein leeres TypSystem
// (mit Default-Typ "NULL"
~G_typeSystem();
// gibt die benutzten Speicher-
// bereiche frei
G_typeSystem(const char *fileName);
// erzeugt ein neues Typsystem mit den
// Typen aus Datei fileName
int store(const char *fileName) const;
// schreibt das Typsystem in Datei
// fileName
// liefert true im Erfolgsfall
void setIsA(const G_type &subType, const G_type &superType);
// setzt Untertypbeziehung unter
// Bildung des transitiven
// Abschlusses
int isA(const G_type &subType, const G_type &superType) const;
// testet auf Untertypbeziehung,
// auch transitiv
int isA(G_typeNo subNo, G_typeNo superNo) const;
// testet isA mittels Typnummern
inline const G_type & getType(G_typeNo tNo) const;
// liefert das Typobjekt mit
// Typnummer tNo
const G_type & getType(const char *id) const;
// liefert das Typobjekt mit Bezeichnung
// id
int contains(const char *id) const;
// testet, ob es einen Typ mit der
// Bezeichnung id gibt
inline int contains(const G_type &type) const;
// testet, ob der Typ type zu
// Typsystem gehoert
inline unsigned getCount() { return typeCount; };
inline unsigned typeMax() { return typeM; };
};
class G_type // Objekte dieses Klasse
// repraesentieren Typen
{
friend G_typeSystem;
private:
G_type(const G_type &);
G_type & operator=(const G_type &);
protected:
const char * idString; // Identifikationsstring
G_typeNo typeNo; // Nummer des Typs
G_attrNo attrNo; // Nummer des zu verwendenden
// Attributschemas (evtl. G_AttrNoNull)
G_type() {};
public:
G_type(G_typeSystem &tSys,
const char *idString,
const G_attrSchema &aSchema
= G_attrSchema::getSchema(G_attrSchema::getAttrNo("NULL")));
// Konstruktor, vergibt Typnummer und
// traegt Typ in Typsystem tSys ein
inline G_typeNo getTypeNo() const;
// liefert die Nummer des Typs
inline G_attrNo getAttrNo() const;
// liefert die Nummer des zu
// verwendenden Attributsschemas
inline const char * getTypeId() const;
// liefert Bezeichnung des Typs
inline int isTypeNull() const;
// testet, ob das Objekt den
// Nulltyp repraesentiert
G_attribute * restore(istream &iS) const;
// erzeugt ein Attribut, das dem
// Schema fuer Typ mit tNo enstpricht,
// unter Beruecksichtigung der Angaben
// aus Stream iS
};
class G_typeNull:public G_type
{
private:
G_typeNull(const G_typeNull &);
public:
void init();
G_typeNull();
};
extern G_typeNull G__TypeNull;
extern G_type & G_TypeNull; // alle Typsysteme enthalten das
// gleiche Nulltyp-Objekt
# 53 "/home/arthur/benz/Packages/GraLab3/src/include/graph.h" 2
# 1 "/home/arthur/benz/Packages/GraLab3/src/include/grfclass.h" 1
typedef unsigned G_vertex;
typedef int G_edge;
extern const G_vertex G_VertexNull; // Nullelement von G_vertex
extern const G_edge G_EdgeNull; // Nullelement von G_edge
# 1 "/home/arthur/benz/Packages/GraLab3/src/include/atrclass.h" 1
# 1 "/home/arthur/benz/Packages/GraLab3/src/include/tempattr.h" 1
# 1 "/home/arthur/benz/Packages/GraLab3/src/include/basattr.h" 1
class G_basicAttribute
{
public:
virtual ostream &print(ostream &oS);
// Ausgabe des Attributs in 'schoenem' Format
// fuer G_graph::print
virtual ~G_basicAttribute();
// loescht das Attribut fu"r G_graph::~G_graph
// etc.
#ifdef LOG_DESTRUCTOR
virtual void logicalDelete();
virtual void logicalUndelete();
#else
void logicalDelete() {};
void logicalUndelete() {};
#endif
static void callDestructor(void *pAttr) { delete (G_basicAttribute *)pAttr; };
static void callLogicalUndelete(void *pAttr) { ((G_basicAttribute *)pAttr)->logicalUndelete(); };
};
/************ basattr.h *****************************************************/
# 4 "/home/arthur/benz/Packages/GraLab3/src/include/tempattr.h" 2
class G_graph;
class G_tempAttribute : public G_basicAttribute
{
friend G_graph;
private:
int layerId;
G_tempAttribute *nextInStack;
union { G_vertex v;
G_edge e; }
nextInLayer;
};
class G_tempLayer
{
friend G_graph;
private:
G_tempLayer *next;
union { G_vertex v;
G_edge e; }
firstInLayer;
};
# 8 "/home/arthur/benz/Packages/GraLab3/src/include/atrclass.h" 2
class G_attribute : public G_basicAttribute
{
private:
// static const G_attrSchema * attrSchema;
// muss in jeder abgeleiteten Klasse
// deklariert und mit &getSchema()
// initialisiert werden.
// Dabei wird das Schema in der Klasse
// G_attrSchema registriert
public:
virtual void *getPAttr() { return this; };
virtual ostream &print(ostream &oS);
// Ausgabe des Attributs in 'schoenem' Format
// fuer G_graph::print
// aus G_tempAttribute geerbt
virtual void store(ostream &oS);
// Ausgabe des Attributs in 'praktischem' Format
// fuer G_graph::store
// static G_attribute *restore(istream &iS, unsigned length);
// muss in jeder abgeleiteten Klasse
// definiert werden.
// erzeugt eine Instanz der jeweiligen Klasse
// initialisert diese mit den Werten aus dem Stream
// iS, sollte dabei length Zeichen aus iS lesen
// virtual ~G_attribute();
// loescht das Attribut fu"r G_graph::~G_graph etc.
// virtueller Destruktor aus
// G_tempAttribute geerbt
virtual G_attrNo getAttrNo()=0;
// liefert Nummer des Attributschemas des Attributs
// static const G_attrSchema &
getSchema();
// liefert die Referenz des der Klasse
// zugeordneten Attributschemaobjektes
// Beim ersten Aufruf wird dieses
// Schemaobjekt erzeugt
// muss in jeder abgeleiteten Klasse
// definiert werden.
};
/************ atrclass.h *****************************************************/
# 51 "/home/arthur/benz/Packages/GraLab3/src/include/grfclass.h" 2
class G_graph
{
private:
unsigned vMax, eMax,
vCount, eCount;
G_vertex firstGV, lastGV, *nextGV, // Dimension: nextGV[1..vMax]
firstFreeV;
G_edge firstGE, lastGE, *nextGE, // Dimension: nextGE[1..eMax]
firstFreeE;
G_edge *firstE, // Dimension: firstE[1..vMax]
*lastE, // Dimension: lastE[1..vMax]
*nextE; // Dimension: nextE[-eMax..eMax]
G_typeSystem * pTypeSystem;
G_typeNo *vType; // Dimension: vType[1..vMax]
G_attribute **vAttr; // Dimension: vAttr[1..vMax]
G_typeNo *eType; // Dimension: eType[1..eMax]
G_attribute **eAttr; // Dimension: eAttr[1..eMax]
G_vertex *node; // Dimension: node[-eMax..eMax]
G_tempLayer *vTempLayer, *eTempLayer;
int vTempLayerId, eTempLayerId;
G_tempAttribute **vTemp, // Dimension vTemp[1..vMax],
**eTemp; // eTemp[1..eMax]
G_undoStack *uS;
int vIncrease(); // increases maximal number of vertices
int eIncrease(); // increases maximal number of edges,
// returns 1, if successful
void storeTypeTranslation(ostream &oS) const;
// schreibt die aktuelle Zuordnung
// von Typnummern zu Typbezeichnern
// nach oS
G_typeNo * restoreTypeTranslation(istream &iS, unsigned &tCount) const;
// liest die alte Zuordnung von
// Typnummern zu Typnummern und
// liefert die Zuordnung zu
// den aktuellen Typnummern
public:
G_graph(G_typeSystem *pTypeSys=0,
unsigned vMax=G_getEnvVar("G_NMAX", 1000 ),
unsigned eMax=G_getEnvVar("G_MMAX", 1000 ));
// erzeugt leeren Graph mit maximal
// vMax Knoten und eMax Kanten
// fuer den Graphen wird das Typsystem
// pTypeSys verwendet
~G_graph();
// loescht kompletten Graphen mit
// allen Attributen
G_vertex createVertex(), createVertex(unsigned vNo);
// erzeugt einen neuen Knoten evtl.
// mit vorgegebener Nummer vNr.
// Der neue Knoten hat den Typ
// G_TypeNull und kein Attribut.
G_edge createEdge(G_vertex alpha, G_vertex omega),
createEdge(unsigned eNr, G_vertex alpha, G_vertex omega);
// erzeugt eine neue Kante evtl.
// mit vorgegebener Nummer eNr.
// Die neue Kante hat den Typ
// G_TypeNull und kein Attribut.
G_vertex getV(unsigned vNo) const { return vNo; };
G_edge getE(int eNo) const { return eNo; };
unsigned getVNo(G_vertex v) const { return v; };
int getENo(G_edge e) const { return e; };
void changeAlpha(G_edge e, G_vertex v),
// loescht out-Kante e in lambda(alpha(e))
// und fuegt e als out-Kante in
// lambda(v) ans Ende ein
changeOmega(G_edge e, G_vertex v),
// loescht in-Kante e in lambda(omega(e))
// und fuegt e als in-Kante in lambda(v)
// ans Ende ein
changeThis(G_edge e, G_vertex v),
// loescht e in lambda(this(e))
// und fuegt e in lambda(v) ans Ende
// ein
changeThat(G_edge e, G_vertex v);
// loescht reverse(e) in lambda(that(e))
// und fuegt reverse(e) in lambda(v)
// ans Ende ein
void deleteVertex(G_vertex v);
// loescht Knoten v samt Attribut
// und alle inzidenten Kanten
void deleteEdge(G_edge e);
// loescht Kante e samt Attribut
inline unsigned vertexCount() const, edgeCount() const,
// liefert die Anzahl der Knoten
// bzw. Kanten
vertexMax() const, edgeMax() const;
// liefert die maximale Anzahl der
// Knoten bzw. Kanten
G_edge edgeFromTo(G_vertex alpha, G_vertex omega) const,
edgeBetween(G_vertex v1, G_vertex v2) const;
inline G_vertex firstVertex() const,
// liefert ersten Knoten des Graphen
nextVertex(G_vertex v) const;
// liefert auf v folgenden Knoten
inline G_edge firstEdge() const,
// liefert erste Kante des Graphen
nextEdge(G_edge e) const;
// liefert auf e folgende Kante
inline G_edge first(G_vertex v) const,
// liefert erste mit v inzidente orientierte
// Kante
next(G_edge e) const;
// liefert auf e folgende mit this(e)
// inzidente orientierte Kante
G_edge firstIn(G_vertex v) const,
// liefert erste in-Kante von v
nextIn(G_edge e) const,
// liefert die auf e folgende in-Kante
// von omega(e)
firstOut(G_vertex v) const,
// liefert erste out-Kante von v
nextOut(G_edge e) const;
// liefert die auf e folgende out-Kante
// von alpha(e)
G_vertex firstVertex(const G_type &type) const,
// liefert ersten Knoten des Graphen
// mit (Sub-)Typ von type
nextVertex(const G_type &type, G_vertex v) const;
// liefert auf v folgenden Knoten
// mit (Sub-)Typ von type
G_edge firstEdge(const G_type &type) const,
// liefert erste Kante des Graphen
// mit (Sub-)Typ von type
nextEdge(const G_type &type, G_edge e) const;
// liefert auf e folgende Kante
// mit (Sub-)Typ von type
G_edge first(const G_type &type, G_vertex v) const,
// liefert erste mit v inzidente orientierte
// Kante
// mit (Sub-)Typ von type
next(const G_type &type, G_edge e) const;
// liefert auf e folgende mit this(e)
// inzidente orientierte Kante
// mit (Sub-)Typ von type
G_edge firstIn(const G_type &type, G_vertex v) const,
// liefert erste in-Kante von v
// mit (Sub-)Typ von type
nextIn(const G_type &type, G_edge e) const,
// liefert die auf e folgende in-Kante
// von omega(e)
// mit (Sub-)Typ von type
firstOut(const G_type &type, G_vertex v) const,
// liefert erste out-Kante von v
// mit (Sub-)Typ von type
nextOut(const G_type &type, G_edge e) const;
// liefert die auf e folgende out-Kante
// von alpha(e)
// mit (Sub-)Typ von type
inline int isVertex(G_vertex v) const,
// liefert true, falls v Knoten des Graphen ist
isEdge(G_edge e) const;
// liefert true, falls e Kante des Graphen ist
inline int areEqualVertices(G_vertex v1, G_vertex v2) const,
areEqualEdges(G_edge e1, G_edge e2) const,
// liefert true, falls Elemente gleich
isVertexNull(G_vertex v) const,
isEdgeNull(G_edge e) const;
// liefert true, falls Nullelemente
int isVertexBefore(G_vertex v, G_vertex w) const,
// liefert true, falls v in globaler Knotenliste
// vor w steht
isEdgeBefore(G_edge e, G_edge f) const,
// liefert true, falls e in globaler Kantenliste
// vor f steht
isBefore(G_edge e, G_edge f) const;
// liefert true, falls e in Inzidenzliste von
// this(e) vor f steht
void putVertexBefore(G_vertex v, G_vertex w),
// setzt v in globaler Knotenlist unmittelbar
// vor w
putVertexAfter(G_vertex v, G_vertex w),
// setzt v in globaler Knotenlist unmittelbar
// nach w
putEdgeBefore(G_edge e, G_edge f),
// setzt e in globaler Kantenliste unmittelbar
// vor f
putEdgeAfter(G_edge e, G_edge f),
// setzt e in globaler Kantenliste unmittelbar
// nach f
putBefore(G_edge e, G_edge f),
// setzt e in Inzidenzliste von this(e)
// unmittelbar vor f
putAfter(G_edge e, G_edge f);
// setzt e in Inzidenzliste von this(e)
// unmittelbar nach f
inline G_vertex alpha(G_edge e) const, omega(G_edge e) const,
thisV(G_edge e) const, thatV(G_edge e) const;
// liefern die entsprechenden Werte fuer Kante e
inline G_edge normal(G_edge e) const, reverse(G_edge e) const;
unsigned degree(G_vertex v) const,
inDegree(G_vertex v) const, outDegree(G_vertex v) const;
// gibt die Anzahl der zu v inzidenten
// (in- / out-) Kanten zurueck
int setVType(G_vertex v, const G_type &type, G_attribute *pAttr=0);
// setzt Typ des Knotens v auf Typ mit Nummer tNo,
// seinen Attributzeiger auf pAttr.
// Schema des Attributs muss mit dem Typ
// vertraeglich sein.
// Das alte Attribut wird geloescht.
// liefert true im Erfolgsfall
int setEType(G_edge e, const G_type &type, G_attribute *pAttr=0);
// setzt Typ der Kante e auf Typ mit Nummer tNo,
// seinen Attributzeiger auf pAttr.
// Schema des Attributs muss mit dem Typ
// vertraeglich sein.`
// Das alte Attribut wird geloescht.
// liefert true im Erfolgsfall
inline G_attribute *getPVAttr(G_vertex v) const,
*getPEAttr(G_edge e) const;
// liefern Zeiger auf die Attribute
inline const G_type & getVType(G_vertex) const;
inline const G_type & getEType(G_edge) const;
// liefern die zugeordneten Typen
inline int isAV(G_vertex v, const G_type &type) const,
isAE(G_edge e, const G_type &type) const;
// testet, ob Type des Knotens/Kante
// Untertyp des Typs type ist
// Behandlung temporaerer Attribute
int createVTemp(),
createETemp();
// erzeugen leere Schichten
// temporaerer Attribute
void deleteVTemp(), deleteETemp();
// loeschen die aktuelle
// Schicht temporaerer Attribute
int setPVTemp(G_vertex, G_tempAttribute *),
setPETemp(G_edge, G_tempAttribute *);
// liefern true im Erfolgsfall
inline G_tempAttribute *getPVTemp(G_vertex v) const,
*getPETemp(G_edge e) const;
// liefern temporaere Attribute
int getVTempLevel() { return vTempLayerId; };
int getETempLevel() { return eTempLayerId; };
ostream &print(ostream &oS) const,
// gibt kompletten Graphen mit Typen und Attributen
// nach oS aus.
&printVertex(ostream &oS, G_vertex) const,
// gibt Knoten v mit Typ und Attribut nach oS aus.
&printEdge(ostream &oS, G_edge) const;
// gibt Kante e mit Typ und Attribut nach oS aus.
static G_graph *restore(const char *fileName, G_typeSystem *pTypeSys=0);
// liest kompletten Graphen zum Typsystem
// pTypeSys aus Datei mit Namen
// fileName aus.
void store(const char *fileName) const;
// schreibt kompletten Graphen in Datei mit Namen
// fileName
inline void setUndoStack(G_undoStack *undoSt)
{ uS=undoSt; };
// setzt undoStack
// some methods for GraLab3 debugging
int checkEdge(G_edge e);
int checkVertex(G_vertex v);
int checkStructure();
};
inline ostream & operator <<(ostream &oS, const G_graph &g);
# 59 "/home/arthur/benz/Packages/GraLab3/src/include/graph.h" 2
# 1 "/home/arthur/benz/Packages/GraLab3/src/include/grfundo.h" 1
# 13 "/home/arthur/benz/Packages/GraLab3/src/include/grfundo.h"
# 61 "/home/arthur/benz/Packages/GraLab3/src/include/graph.h" 2
# 1 "/home/arthur/benz/Packages/GraLab3/src/include/inline/grftra.h" 1
inline G_vertex G_graph::firstVertex() const
{
return firstGV;
}
inline G_vertex G_graph::nextVertex(G_vertex v) const
{
return nextGV[v];
}
inline G_edge G_graph::firstEdge() const
{
return firstGE;
}
inline G_edge G_graph::nextEdge(G_edge e) const
{
return nextGE[abs(e)];
}
inline G_edge G_graph::first(G_vertex v) const
{
return firstE[v];
}
inline G_edge G_graph::next(G_edge e) const
{
return nextE[e];
}
# 65 "/home/arthur/benz/Packages/GraLab3/src/include/graph.h" 2
# 1 "/home/arthur/benz/Packages/GraLab3/src/include/inline/grfatr.h" 1
inline G_attribute *G_graph::getPVAttr(G_vertex v) const
{
return vAttr[v];
}
inline G_attribute *G_graph::getPEAttr(G_edge e) const
{
return eAttr[abs(e)];
}
inline const G_type & G_graph::getVType(G_vertex v) const
{
if (pTypeSystem)
return pTypeSystem->getType(vType[v]);
else
return G_TypeNull;
}
inline const G_type & G_graph::getEType(G_edge e) const
{
if (pTypeSystem)
return pTypeSystem->getType(eType[abs(e)]);
else
return G_TypeNull;
}
inline int G_graph::isAV(G_vertex v, const G_type &type) const
{
# 82 "/home/arthur/benz/Packages/GraLab3/src/include/inline/grfatr.h"
return pTypeSystem->isA(vType[v], type.getTypeNo());
}
inline int G_graph::isAE(G_edge e, const G_type &type) const
{
# 108 "/home/arthur/benz/Packages/GraLab3/src/include/inline/grfatr.h"
return pTypeSystem->isA(eType[abs(e)], type.getTypeNo());
}
inline G_tempAttribute *G_graph::getPVTemp(G_vertex v) const
{
G_tempAttribute *pAttr=vTemp[v];
if (pAttr && pAttr->layerId==vTempLayerId)
return pAttr;
else
return 0;
}
inline G_tempAttribute *G_graph::getPETemp(G_edge e) const
{
G_tempAttribute *pAttr=eTemp[abs(e)];
if (pAttr && pAttr->layerId==eTempLayerId)
return pAttr;
else
return 0;
}
# 66 "/home/arthur/benz/Packages/GraLab3/src/include/graph.h" 2
# 1 "/home/arthur/benz/Packages/GraLab3/src/include/inline/grfaux.h" 1
inline G_vertex G_graph::alpha(G_edge e) const
{
return node[-abs(e)];
}
inline G_vertex G_graph::omega(G_edge e) const
{
return node[abs(e)];
}
inline G_vertex G_graph::thisV(G_edge e) const
{
return node[-e];
}
inline G_vertex G_graph::thatV(G_edge e) const
{
return node[e];
}
inline G_edge G_graph::normal(G_edge e) const
{
return abs(e);
}
inline G_edge G_graph::reverse(G_edge e) const
{
return -e;
}
# 67 "/home/arthur/benz/Packages/GraLab3/src/include/graph.h" 2
# 1 "/home/arthur/benz/Packages/GraLab3/src/include/inline/grfprt.h" 1
inline ostream &operator << (ostream &oS, const G_graph &g)
{
return g.print(oS);
}
# 68 "/home/arthur/benz/Packages/GraLab3/src/include/graph.h" 2
# 1 "/home/arthur/benz/Packages/GraLab3/src/include/inline/grftst.h" 1
inline int G_graph::isVertex(G_vertex v) const
{
return (v>=1 && v<=vMax && vType[v]!=G_NotUsed);
}
inline int G_graph::isEdge(G_edge e) const
{
return (e>=1 && e<=eMax && eType[e]!=G_NotUsed);
}
inline int G_graph::isVertexNull(G_vertex v) const
{
return v==0;
}
inline int G_graph::isEdgeNull(G_edge e) const
{
return e==0;
}
inline int G_graph::areEqualVertices(G_vertex v1, G_vertex v2) const
{
# 37 "/home/arthur/benz/Packages/GraLab3/src/include/inline/grftst.h"
return v1==v2;
}
inline int G_graph::areEqualEdges(G_edge e1, G_edge e2) const
{
# 56 "/home/arthur/benz/Packages/GraLab3/src/include/inline/grftst.h"
return abs(e1)==abs(e2);
}
# 69 "/home/arthur/benz/Packages/GraLab3/src/include/graph.h" 2
# 1 "/home/arthur/benz/Packages/GraLab3/src/include/inline/grfmsc.h" 1
inline unsigned G_graph::vertexCount() const
{
return vCount;
}
inline unsigned G_graph::edgeCount() const
{
return eCount;
}
inline unsigned G_graph::vertexMax() const
{
return vMax;
}
inline unsigned G_graph::edgeMax() const
{
return eMax;
}
# 70 "/home/arthur/benz/Packages/GraLab3/src/include/graph.h" 2
# 1 "grfall.c" 2
# 1 "/home/arthur/benz/Packages/OpenStep/lib/gcc-lib/sparc-sun-solaris2.4/2.7.0/include/memory.h" 1 3
#pragma ident "@(#)memory.h 1.8 92/07/14 SMI"
extern void *memccpy(void *, const void *, int, size_t);
extern void *memchr(const void *, int, size_t);
extern void *memcpy(void *, const void *, size_t);
extern void *memset(void *, int, size_t);
extern int memcmp(const void *, const void *, size_t);
# 2 "grfall.c" 2
int allocVPointers(G_attribute **&vAttr, G_typeNo *&vType, G_vertex *&nextGV,
G_edge *&firstE, G_edge *&lastE, G_tempAttribute **&vTemp,
unsigned vM, G_undoStack *uS)
{
unsigned vSize=(vM+1)*(sizeof(G_attribute *)+sizeof(G_type)
+sizeof(G_vertex)+2*sizeof(G_edge)+sizeof(G_tempAttribute *));
# 22 "grfall.c"
void *newMem=malloc(vSize);
if (newMem==0)
return 0;
;
vAttr=(G_attribute **)newMem;
vType=(G_typeNo*)(vAttr+vM+1);
nextGV=(G_vertex *)(vType+vM+1);
firstE=(G_edge *)(nextGV+vM+1);
lastE=firstE+vM+1;
vTemp=(G_tempAttribute **)(lastE+vM+1);
return 1;
}
int allocEPointers(G_attribute **&eAttr, G_typeNo *&eType, G_edge *&nextGE,
G_edge *&nextE, G_vertex *&node, G_tempAttribute **&eTemp,
unsigned eM, G_undoStack *uS)
{
unsigned eSize= (eM+1)*(sizeof(G_attribute *)+sizeof(G_typeNo)+sizeof(G_edge)
+sizeof(G_tempAttribute *))
+ (eM*2+1)*(sizeof(G_edge)+sizeof(G_vertex));
# 58 "grfall.c"
void *newMem=malloc(eSize);
if (newMem==0)
return 0;
;
eAttr=(G_attribute **)newMem;
eType=(G_typeNo *)(eAttr+eM+1);
nextGE=(G_edge *)(eType+eM+1);
nextE=nextGE+2*eM+1;
node=(G_vertex *)(nextE+eM+1)+eM;
eTemp=(G_tempAttribute **)(node+eM+1);
return 1;
}
int G_graph::vIncrease()
{
int result=0;
;
unsigned vM=vMax*2;
G_attribute **newVAttr;
G_typeNo *newVType;
G_vertex *newNextGV, v;
G_edge *newFirstE, *newLastE;
G_tempAttribute **newVTemp;
if (!allocVPointers(newVAttr, newVType, newNextGV,
newFirstE, newLastE, newVTemp, vM, uS))
{
G_msg::error(5, "grf", "G_graph::vIncrease");
goto exit;
}
memcpy(newVAttr, vAttr, (vMax+1)*sizeof(G_attribute *));
memcpy(newVType, vType, (vMax+1)*sizeof(G_typeNo));
memcpy(newNextGV, nextGV, (vMax+1)*sizeof(G_vertex));
memcpy(newFirstE, firstE, (vMax+1)*sizeof(G_edge));
memcpy(newLastE, lastE, (vMax+1)*sizeof(G_edge));
memcpy(newVTemp, vTemp, (vMax+1)*sizeof(G_tempAttribute *));
free( vAttr ); ;
( vAttr )=( newVAttr ); ;
( vType )=( newVType ); ;
( nextGV )=( newNextGV ); ;
( firstE )=( newFirstE ); ;
( lastE )=( newLastE ); ;
( vTemp )=( newVTemp ); ;
for (v=vMax+1; v<=vM; ++v)
{
vAttr[v]=0;
vType[v]=G_NotUsed;
nextGV[v]=v+1;
firstE[v]=lastE[v]=0;
vTemp[v]=0;
}
( vMax )=( vM ); ;
result=1;
exit:
;
return result;
}
int G_graph::eIncrease()
{
int result=0;
;
unsigned eM=eMax*2;
G_attribute **newEAttr;
G_typeNo *newEType;
G_edge *newNextGE, e;
G_edge *newNextE;
G_vertex *newNode;
G_tempAttribute **newETemp;
if (!allocEPointers(newEAttr, newEType, newNextGE,
newNextE, newNode, newETemp, eM, uS))
{
G_msg::error(5, "grf", "G_graph::eIncrease");
goto exit;
}
memcpy(newEAttr, eAttr, (eMax+1)*sizeof(G_attribute *));
memcpy(newEType, eType, (eMax+1)*sizeof(G_typeNo));
memcpy(newNextGE, nextGE, (eMax+1)*sizeof(G_edge));
memcpy(newNextE-eMax, nextE-eMax, (2*eMax+1)*sizeof(G_edge));
memcpy(newNode-eMax, node-eMax, (2*eMax+1)*sizeof(G_vertex));
memcpy(newETemp, eTemp, (eMax+1)*sizeof(G_tempAttribute *));
free( eAttr ); ;
( eAttr )=( newEAttr ); ;
( eType )=( newEType ); ;
( nextGE )=( newNextGE ); ;
( nextE )=( newNextE ); ;
( node )=( newNode ); ;
( eTemp )=( newETemp ); ;
for (e=eMax+1; e<=eM; ++e)
{
eAttr[e]=0;
eType[e]=G_NotUsed;
nextGE[e]=e+1;
nextE[e]=nextE[-e]=0;
node[e]=node[-e]=0;
eTemp[e]=0;
}
( eMax )=( eM ); ;
result=1;
exit:
return result;
}
G_graph::G_graph(G_typeSystem *pTypeSys, unsigned vM, unsigned eM)
{
;
vMax=vM;
eMax=eM;
vCount=0;
eCount=0;
firstGE=lastGE=0;
pTypeSystem=pTypeSys;
if (!allocVPointers(vAttr, vType, nextGV, firstE, lastE, vTemp, vM, 0))
{
do
{
vMax/=2;
}
while (vMax && !allocVPointers(vAttr, vType, nextGV, firstE, lastE, vTemp, vMax, 0));
G_msg::error(22, "grf", "G_graph::G_graph(%u,%u)",
vM, eM, vMax);
}
for (G_vertex v=1; v<=vMax; ++v)
{
nextGV[v]=v+1;
firstE[v]=lastE[v]=0;
vType[v]=G_NotUsed;
vAttr[v]=0;
vTemp[v]=0;
};
firstFreeV=1;
firstGV=lastGV=0;
if (!allocEPointers(eAttr, eType, nextGE, nextE, node, eTemp, eM, 0))
{
do
{
eMax/=2;
}
while(eMax && !allocEPointers(eAttr, eType, nextGE, nextE, node, eTemp, eMax, 0));
G_msg::error(23, "grf", "G_graph::G_graph(%u,%u)",
vM, eM, eMax);
}
for (G_edge e=1; e<=eMax; ++e)
{
eAttr[e]=0;
eType[e]=G_NotUsed;
nextGE[e]=e+1;
nextE[e]=nextE[-e]=0;
node[e]=node[-e]=0;
eTemp[e]=0;
}
firstFreeE=1;
firstGE=lastGE=0;
vTempLayer=eTempLayer=0;
vTempLayerId=eTempLayerId=0;
uS=0;
;
}
G_graph::~G_graph()
{
;
G_vertex v;
G_edge e;
G_tempAttribute *pAttr, *h;
G_tempLayer *pL, *pL2;
if (uS)
{
uS->clear();
uS=0;
}
for (e=firstGE; e; e=nextGE[e])
{
if (eAttr[e])
{
eAttr[e]->logicalDelete();
delete eAttr[e];
}
for (pAttr=eTemp[e]; pAttr; pAttr=h)
{
h=pAttr->nextInStack;
if (pAttr->layerId>0)
pAttr->logicalDelete();
delete pAttr;
}
}
for (v=firstGV; v; v=nextGV[v])
{
if (vAttr[v])
{
vAttr[v]->logicalDelete();
delete vAttr[v];
}
for (pAttr=vTemp[v]; pAttr; pAttr=h)
{
h=pAttr->nextInStack;
if (pAttr->layerId>0)
pAttr->logicalDelete();
delete pAttr;
}
}
delete vAttr;
delete eAttr;
for (pL=vTempLayer; pL; pL=pL2)
{
pL2=pL->next;
delete pL;
}
for (pL=eTempLayer; pL; pL=pL2)
{
pL2=pL->next;
delete pL;
}
;
}
----------
X-Sun-Data-Type: default
X-Sun-Data-Description: default
X-Sun-Data-Name: InternalCompilerError
X-Sun-Charset: us-ascii
X-Sun-Content-Lines: 4446
# 1 "grfall.c"
# 1 "/home/arthur/benz/Packages/GraLab3/src/include/graph.h" 1
# 27 "/home/arthur/benz/Packages/GraLab3/src/include/graph.h"
# 1 "/home/arthur/benz/Packages/OpenStep/lib/gcc-lib/sparc-sun-solaris2.4/2.7.0/include/stdlib.h" 1 3 4
#pragma ident "@(#)stdlib.h 1.24 94/03/28 SMI"
# 1 "/usr/include/sys/feature_tests.h" 1 3 4
#pragma ident "@(#)feature_tests.h 1.6 93/07/09 SMI"
extern "C" {
}
# 13 "/home/arthur/benz/Packages/OpenStep/lib/gcc-lib/sparc-sun-solaris2.4/2.7.0/include/stdlib.h" 2 3 4
extern "C" {
typedef struct {
int quot;
int rem;
} div_t;
typedef struct {
long quot;
long rem;
} ldiv_t;
typedef struct {
long long quot;
long long rem;
} lldiv_t;
typedef unsigned int size_t;
typedef long uid_t;
typedef __wchar_t wchar_t;
extern unsigned char __ctype[];
extern double atof(const char *);
extern int atoi(const char *);
extern long int atol(const char *);
extern double strtod(const char *, char **);
extern long int strtol(const char *, char **, int);
extern unsigned long int strtoul(const char *, char **, int);
extern int rand(void);
extern void srand(unsigned int);
extern void *calloc(size_t, size_t);
extern void free(void *);
extern void *malloc(size_t);
extern void *realloc(void *, size_t);
extern void abort(void);
extern int atexit(void (*)(void));
extern void exit(int);
extern char *getenv(const char *);
extern int system(const char *);
extern void *bsearch(const void *, const void *, size_t, size_t,
int (*)(const void *, const void *));
extern void qsort(void *, size_t, size_t,
int (*)(const void *, const void *));
extern int abs(int);
extern div_t div(int, int);
extern long int labs(long);
extern ldiv_t ldiv(long, long);
extern int mbtowc(wchar_t *, const char *, size_t);
extern int mblen(const char *, size_t);
extern int wctomb(char *, wchar_t);
extern size_t mbstowcs(wchar_t *, const char *, size_t);
extern size_t wcstombs(char *, const wchar_t *, size_t);
extern double drand48(void);
extern double erand48(unsigned short *);
extern long jrand48(unsigned short *);
extern void lcong48(unsigned short *);
extern long lrand48(void);
extern long mrand48(void);
extern long nrand48(unsigned short *);
extern unsigned short *seed48(unsigned short *);
extern void srand48(long);
extern int putenv(const char *);
extern void setkey(const char *);
extern long a64l(const char *);
extern int dup2(int, int);
extern char *ecvt(double, int, int *, int *);
extern char *fcvt(double, int, int *, int *);
extern char *qecvt(long double, int, int *, int *);
extern char *qfcvt(long double, int, int *, int *);
extern char *qgcvt(long double, int, char *);
extern char *getcwd(char *, size_t);
extern char *getlogin(void);
extern int getopt(int, char *const *, const char *);
extern int getsubopt(char **, char *const *, char **);
extern char *optarg;
extern int optind, opterr, optopt;
extern char *getpass(const char *);
extern int getpw(uid_t, char *);
extern char *gcvt(double, int, char *);
extern int isatty(int);
extern char *l64a(long);
extern void *memalign(size_t, size_t);
extern char *mktemp(char *);
extern char *realpath(char *, char *);
extern void swab(const char *, char *, int);
extern char *ttyname(int);
extern int ttyslot(void);
extern void *valloc(size_t);
extern char *ptsname(int);
extern int grantpt(int);
extern int unlockpt(int);
extern long long atoll(const char *);
extern long long llabs(long long);
extern lldiv_t lldiv(long long, long long);
extern char *lltostr(long long, char *);
extern long long strtoll(const char *, char **, int);
extern unsigned long long strtoull(const char *, char **, int);
extern char *ulltostr(unsigned long long, char *);
# 275 "/home/arthur/benz/Packages/OpenStep/lib/gcc-lib/sparc-sun-solaris2.4/2.7.0/include/stdlib.h" 3 4
}
# 28 "/home/arthur/benz/Packages/GraLab3/src/include/graph.h" 2
# 1 "/home/arthur/benz/Packages/OpenStep/lib/g++-include/string.h" 1 3
# 1 "/home/arthur/benz/Packages/OpenStep/lib/g++-include/cstring" 1 3
# 1 "/home/arthur/benz/Packages/OpenStep/lib/g++-include/std/cstring.h" 1 3
# 1 "/home/arthur/benz/Packages/OpenStep/lib/g++-include/string.h" 1 3
# 1 "/home/arthur/benz/Packages/OpenStep/lib/g++-include/cstring" 1 3
# 5 "/home/arthur/benz/Packages/OpenStep/lib/g++-include/string.h" 2 3
# 16 "/home/arthur/benz/Packages/OpenStep/lib/g++-include/string.h" 3
# 16 "/home/arthur/benz/Packages/OpenStep/lib/g++-include/std/cstring.h" 2 3
# 1 "/home/arthur/benz/Packages/OpenStep/lib/g++-include/std/cstddef.h" 1 3
# 1 "/home/arthur/benz/Packages/OpenStep/lib/gcc-lib/sparc-sun-solaris2.4/2.7.0/include/stddef.h" 1 3 4
# 59 "/home/arthur/benz/Packages/OpenStep/lib/gcc-lib/sparc-sun-solaris2.4/2.7.0/include/stddef.h" 3 4
typedef int ptrdiff_t;
# 180 "/home/arthur/benz/Packages/OpenStep/lib/gcc-lib/sparc-sun-solaris2.4/2.7.0/include/stddef.h" 3 4
# 252 "/home/arthur/benz/Packages/OpenStep/lib/gcc-lib/sparc-sun-solaris2.4/2.7.0/include/stddef.h" 3 4
# 286 "/home/arthur/benz/Packages/OpenStep/lib/gcc-lib/sparc-sun-solaris2.4/2.7.0/include/stddef.h" 3 4
# 6 "/home/arthur/benz/Packages/OpenStep/lib/g++-include/std/cstddef.h" 2 3
# 24 "/home/arthur/benz/Packages/OpenStep/lib/g++-include/std/cstring.h" 2 3
#pragma interface "std/cstring.h"
extern "C" const char *strchr (const char *, int);
inline char *
strchr (char *s, int c)
{
return (char*) strchr ((const char *) s, c);
}
extern "C" const char *strpbrk (const char *, const char *);
inline char *
strpbrk (char *s1, const char *s2)
{
return (char *) strpbrk ((const char *) s1, s2);
}
extern "C" const char *strrchr (const char *, int);
inline char *
strrchr (char *s, int c)
{
return (char *) strrchr ((const char *) s, c);
}
extern "C" const char *strstr (const char *, const char *);
inline char *
strstr (char *s1, const char *s2)
{
return (char *) strstr ((const char *) s1, s2);
}
extern "C" const void *memchr (const void *, int, size_t);
inline void *
memchr (void *s, int c, size_t n)
{
return (void *) memchr ((const void *) s, c, n);
}
# 5 "/home/arthur/benz/Packages/OpenStep/lib/g++-include/cstring" 2 3
# 5 "/home/arthur/benz/Packages/OpenStep/lib/g++-include/string.h" 2 3
# 16 "/home/arthur/benz/Packages/OpenStep/lib/g++-include/string.h" 3
# 29 "/home/arthur/benz/Packages/GraLab3/src/include/graph.h" 2
# 1 "/home/arthur/benz/Packages/OpenStep/lib/g++-include/iostream.h" 1 3
#pragma interface
# 1 "/home/arthur/benz/Packages/OpenStep/lib/g++-include/streambuf.h" 1 3
#pragma interface
extern "C" {
# 1 "/home/arthur/benz/Packages/OpenStep/lib/g++-include/libio.h" 1 3
# 1 "/home/arthur/benz/Packages/OpenStep/lib/g++-include/_G_config.h" 1 3
typedef long _G_clock_t;
typedef unsigned long _G_dev_t;
typedef long _G_fpos_t;
typedef long _G_gid_t;
typedef unsigned long _G_ino_t;
typedef unsigned long _G_mode_t;
typedef unsigned long _G_nlink_t;
typedef long _G_off_t;
typedef long _G_pid_t;
typedef int _G_ptrdiff_t;
typedef int _G_sigset_t;
typedef unsigned int _G_size_t;
typedef long _G_time_t;
typedef long _G_uid_t;
typedef long int _G_wchar_t;
typedef int _G_ssize_t;
typedef long _G_wint_t;
typedef void * _G_va_list;
typedef int _G_int8_t __attribute__ ((mode (QI)));
typedef unsigned int _G_uint8_t __attribute__ ((mode (QI)));
typedef int _G_int16_t __attribute__ ((mode (HI)));
typedef unsigned int _G_uint16_t __attribute__ ((mode (HI)));
typedef int _G_int32_t __attribute__ ((mode (SI)));
typedef unsigned int _G_uint32_t __attribute__ ((mode (SI)));
typedef int _G_int64_t __attribute__ ((mode (DI)));
typedef unsigned int _G_uint64_t __attribute__ ((mode (DI)));
# 30 "/home/arthur/benz/Packages/OpenStep/lib/g++-include/libio.h" 2 3
# 51 "/home/arthur/benz/Packages/OpenStep/lib/g++-include/libio.h" 3
struct _IO_jump_t; struct _IO_FILE;
struct _IO_marker {
struct _IO_marker *_next;
struct _IO_FILE *_sbuf;
int _pos;
# 160 "/home/arthur/benz/Packages/OpenStep/lib/g++-include/libio.h" 3
};
struct _IO_FILE {
int _flags;
char* _IO_read_ptr;
char* _IO_read_end;
char* _IO_read_base;
char* _IO_write_base;
char* _IO_write_ptr;
char* _IO_write_end;
char* _IO_buf_base;
char* _IO_buf_end;
char *_IO_save_base;
char *_IO_backup_base;
char *_IO_save_end;
struct _IO_marker *_markers;
struct _IO_FILE *_chain;
int _fileno;
int _blksize;
_G_off_t _offset;
unsigned short _cur_column;
char _unused;
char _shortbuf[1];
};
struct _IO_FILE_plus;
extern struct _IO_FILE_plus _IO_stdin_, _IO_stdout_, _IO_stderr_;
extern "C" {
extern int __underflow (_IO_FILE*) ;
extern int __uflow (_IO_FILE*) ;
extern int __overflow (_IO_FILE*, int) ;
extern int _IO_vfscanf (_IO_FILE*, const char*, _G_va_list , int*) ;
extern int _IO_vfprintf (_IO_FILE*, const char*, _G_va_list ) ;
extern _G_ssize_t _IO_padn (_IO_FILE *, int, _G_ssize_t ) ;
extern _G_size_t _IO_sgetn (_IO_FILE *, void*, _G_size_t ) ;
extern void _IO_free_backup_area (_IO_FILE*) ;
}
# 36 "/home/arthur/benz/Packages/OpenStep/lib/g++-include/streambuf.h" 2 3
}
class istream;
class ostream; class streambuf;
typedef _G_off_t streamoff;
typedef _G_fpos_t streampos;
typedef _G_ssize_t streamsize;
typedef unsigned long __fmtflags;
typedef unsigned char __iostate;
struct _ios_fields
{
streambuf *_strbuf;
ostream* _tie;
int _width;
__fmtflags _flags;
short _fill;
__iostate _state;
__iostate _exceptions;
int _precision;
void *_arrays;
};
# 114 "/home/arthur/benz/Packages/OpenStep/lib/g++-include/streambuf.h" 3
class ios : public _ios_fields {
ios& operator=(ios&);
public:
typedef __fmtflags fmtflags;
typedef int iostate;
typedef int openmode;
typedef int streamsize;
enum io_state {
goodbit = 0 ,
eofbit = 1 ,
failbit = 2 ,
badbit = 4 };
enum open_mode {
in = 1 ,
out = 2 ,
ate = 4 ,
app = 8 ,
trunc = 16 ,
nocreate = 32 ,
noreplace = 64 ,
bin = 128 };
enum seek_dir { beg, cur, end};
enum { skipws= 01 ,
left= 02 , right= 04 , internal= 010 ,
dec= 020 , oct= 040 , hex= 0100 ,
showbase= 0200 , showpoint= 0400 ,
uppercase= 01000 , showpos= 02000 ,
scientific= 04000 , fixed= 010000 ,
unitbuf= 020000 , stdio= 040000
};
enum {
basefield=dec+oct+hex,
floatfield = scientific+fixed,
adjustfield = left+right+internal
};
# 165 "/home/arthur/benz/Packages/OpenStep/lib/g++-include/streambuf.h" 3
ostream* tie() const { return _tie; }
ostream* tie(ostream* val) { ostream* save=_tie; _tie=val; return save; }
short fill() const { return (short )_fill; }
short fill(short newf)
{short oldf = (short )_fill; _fill = (char)newf; return oldf;}
fmtflags flags() const { return _flags; }
fmtflags flags(fmtflags new_val) {
fmtflags old_val = _flags; _flags = new_val; return old_val; }
int precision() const { return _precision; }
int precision(int newp) {
unsigned short oldp = _precision; _precision = (unsigned short)newp;
return oldp; }
fmtflags setf(fmtflags val) {
fmtflags oldbits = _flags;
_flags |= val; return oldbits; }
fmtflags setf(fmtflags val, fmtflags mask) {
fmtflags oldbits = _flags;
_flags = (_flags & ~mask) | (val & mask); return oldbits; }
fmtflags unsetf(fmtflags mask) {
fmtflags oldbits = _flags;
_flags &= ~mask; return oldbits; }
int width() const { return _width; }
int width(int val) { int save = _width; _width = val; return save; }
void _throw_failure() const { }
void clear(iostate state = 0) {
_state = _strbuf ? state : state|badbit;
if (_state & _exceptions) _throw_failure(); }
void set(iostate flag) { _state |= flag;
if (_state & _exceptions) _throw_failure(); }
void setstate(iostate flag) { _state |= flag;
if (_state & _exceptions) _throw_failure(); }
int good() const { return _state == 0; }
int eof() const { return _state & ios::eofbit; }
int fail() const { return _state & (ios::badbit|ios::failbit); }
int bad() const { return _state & ios::badbit; }
iostate rdstate() const { return _state; }
operator void*() const { return fail() ? (void*)0 : (void*)(-1); }
int operator!() const { return fail(); }
iostate exceptions() const { return _exceptions; }
void exceptions(iostate enable) {
_exceptions = enable;
if (_state & _exceptions) _throw_failure(); }
streambuf* rdbuf() const { return _strbuf; }
streambuf* rdbuf(streambuf *_s) {
streambuf *_old = _strbuf; _strbuf = _s; clear (); return _old; }
static int sync_with_stdio(int on);
static void sync_with_stdio() { sync_with_stdio(1); }
static fmtflags bitalloc();
static int xalloc();
void*& pword(int);
void* pword(int) const;
long& iword(int);
long iword(int) const;
class Init {
public:
Init () { }
};
protected:
ios(streambuf* sb = 0, ostream* tie_to = 0);
virtual ~ios();
void init(streambuf* sb, ostream* tie = 0);
};
typedef ios::seek_dir _seek_dir;
class streammarker : private _IO_marker {
friend class streambuf;
void set_offset(int offset) { _pos = offset; }
public:
streammarker(streambuf *sb);
~streammarker();
int saving() { return 1; }
int delta(streammarker&);
int delta();
};
struct streambuf : public _IO_FILE {
friend class ios;
friend class istream;
friend class ostream;
friend class streammarker;
const void *&_vtable() { return *(const void**)((_IO_FILE*)this + 1); }
protected:
static streambuf* _list_all;
_IO_FILE*& xchain() { return _chain; }
void _un_link();
void _link_in();
char* gptr() const
{ return _flags & 0x100 ? _IO_save_base : _IO_read_ptr; }
char* pptr() const { return _IO_write_ptr; }
char* egptr() const
{ return _flags & 0x100 ? _IO_save_end : _IO_read_end; }
char* epptr() const { return _IO_write_end; }
char* pbase() const { return _IO_write_base; }
char* eback() const
{ return _flags & 0x100 ? _IO_save_base : _IO_read_base;}
char* base() const { return _IO_buf_base; }
char* ebuf() const { return _IO_buf_end; }
int blen() const { return _IO_buf_end - _IO_buf_base; }
void xput_char(char c) { *_IO_write_ptr++ = c; }
int xflags() { return _flags ; }
int xflags(int f) {int fl = _flags ; _flags = f; return fl;}
void xsetflags(int f) { _flags |= f; }
void xsetflags(int f, int mask)
{ _flags = (_flags & ~mask) | (f & mask); }
void gbump(int n)
{ _flags & 0x100 ? (_IO_save_base+=n):(_IO_read_ptr+=n);}
void pbump(int n) { _IO_write_ptr += n; }
void setb(char* b, char* eb, int a=0);
void setp(char* p, char* ep)
{ _IO_write_base=_IO_write_ptr=p; _IO_write_end=ep; }
void setg(char* eb, char* g, char *eg) {
if (_flags & 0x100 ) _IO_free_backup_area(this);
_IO_read_base = eb; _IO_read_ptr = g; _IO_read_end = eg; }
char *shortbuf() { return _shortbuf; }
int in_backup() { return _flags & 0x100 ; }
char *Gbase() { return in_backup() ? _IO_save_base : _IO_read_base; }
char *eGptr() { return in_backup() ? _IO_save_end : _IO_read_end; }
char *Bbase() { return in_backup() ? _IO_read_base : _IO_save_base; }
char *Bptr() { return _IO_backup_base; }
char *eBptr() { return in_backup() ? _IO_read_end : _IO_save_end; }
char *Nbase() { return _IO_save_base; }
char *eNptr() { return _IO_save_end; }
int have_backup() { return _IO_save_base != ((void *)0) ; }
int have_markers() { return _markers != ((void *)0) ; }
void free_backup_area();
void unsave_markers();
int put_mode() { return _flags & 0x800 ; }
int switch_to_get_mode();
streambuf(int flags=0);
public:
static int flush_all();
static void flush_all_linebuffered();
virtual ~streambuf();
virtual int overflow(int c = (-1) );
virtual int underflow();
virtual int uflow();
virtual int pbackfail(int c);
virtual streamsize xsputn(const char* s, streamsize n);
virtual streamsize xsgetn(char* s, streamsize n);
virtual streampos seekoff(streamoff, _seek_dir, int mode=ios::in|ios::out);
virtual streampos seekpos(streampos pos, int mode = ios::in|ios::out);
streampos sseekoff(streamoff, _seek_dir, int mode=ios::in|ios::out);
streampos sseekpos(streampos pos, int mode = ios::in|ios::out);
virtual streambuf* setbuf(char* p, int len);
virtual int sync();
virtual int doallocate();
int seekmark(streammarker& mark, int delta = 0);
int sputbackc(char c);
int sungetc();
int unbuffered() { return _flags & 2 ? 1 : 0; }
int linebuffered() { return _flags & 0x200 ? 1 : 0; }
void unbuffered(int i)
{ if (i) _flags |= 2 ; else _flags &= ~2 ; }
void linebuffered(int i)
{ if (i) _flags |= 0x200 ; else _flags &= ~0x200 ; }
int allocate() {
if (base() || unbuffered()) return 0;
else return doallocate(); }
void allocbuf() { if (base() == ((void *)0) ) doallocbuf(); }
void doallocbuf();
int in_avail() { return _IO_read_end - _IO_read_ptr; }
int out_waiting() { return _IO_write_ptr - _IO_write_base; }
streamsize sputn(const char* s, streamsize n) { return xsputn(s, n); }
streamsize padn(char pad, streamsize n) { return _IO_padn(this, pad, n); }
streamsize sgetn(char* s, streamsize n) { return _IO_sgetn(this, s, n); }
int ignore(int);
int get_column();
int set_column(int);
long sgetline(char* buf, _G_size_t n, char delim, int putback_delim);
int sputc(int c) { return ((( this )->_IO_write_ptr >= ( this )->_IO_write_end) ? __overflow( this , (unsigned char)( c )) : (unsigned char)(*( this )->_IO_write_ptr++ = ( c ))) ; }
int sbumpc() { return (( this )->_IO_read_ptr >= ( this )->_IO_read_end ? __uflow( this ) : *(unsigned char*)( this )->_IO_read_ptr++) ; }
int sgetc() { return (( this )->_IO_read_ptr >= ( this )->_IO_read_end && __underflow( this ) == (-1) ? (-1) : *(unsigned char*)( this )->_IO_read_ptr) ; }
int snextc() {
if (_IO_read_ptr >= _IO_read_end && __underflow(this) == (-1) )
return (-1) ;
else return _IO_read_ptr++, sgetc(); }
void stossc() { if (_IO_read_ptr < _IO_read_end) _IO_read_ptr++; }
int vscan(char const *fmt0, _G_va_list ap, ios* stream = ((void *)0) );
int scan(char const *fmt0 ...);
int vform(char const *fmt0, _G_va_list ap);
int form(char const *fmt0 ...);
virtual streamsize sys_read(char* buf, streamsize size);
virtual streamsize sys_write(const char*, streamsize);
virtual streampos sys_seek(streamoff, _seek_dir);
virtual int sys_close();
virtual int sys_stat(void*);
};
class filebuf : public streambuf {
protected:
void init();
public:
static const int openprot;
filebuf();
filebuf(int fd);
filebuf(int fd, char* p, int len);
~filebuf();
filebuf* attach(int fd);
filebuf* open(const char *filename, const char *mode);
filebuf* open(const char *filename, ios::openmode mode, int prot = 0664);
virtual int underflow();
virtual int overflow(int c = (-1) );
int is_open() const { return _fileno >= 0; }
int fd() const { return is_open() ? _fileno : (-1) ; }
filebuf* close();
virtual int doallocate();
virtual streampos seekoff(streamoff, _seek_dir, int mode=ios::in|ios::out);
virtual streambuf* setbuf(char* p, int len);
streamsize xsputn(const char* s, streamsize n);
streamsize xsgetn(char* s, streamsize n);
virtual int sync();
protected:
int is_reading() { return eback() != egptr(); }
char* cur_ptr() { return is_reading() ? gptr() : pptr(); }
char* file_ptr() { return eGptr(); }
virtual streamsize sys_read(char* buf, streamsize size);
virtual streampos sys_seek(streamoff, _seek_dir);
virtual streamsize sys_write(const char*, streamsize);
virtual int sys_stat(void*);
virtual int sys_close();
};
inline void ios::init(streambuf* sb, ostream* tie_to) {
_state = sb ? ios::goodbit : ios::badbit; _exceptions=0;
_strbuf=sb; _tie = tie_to; _width=0; _fill=' ';
_flags=ios::skipws|ios::dec;
_precision=6; _arrays = 0; }
inline ios::ios(streambuf* sb, ostream* tie_to) { init(sb, tie_to); }
inline ios::~ios() {
if (_arrays) delete [] _arrays;
}
# 31 "/home/arthur/benz/Packages/OpenStep/lib/g++-include/iostream.h" 2 3
class istream; class ostream;
typedef ios& (*__manip)(ios&);
typedef istream& (*__imanip)(istream&);
typedef ostream& (*__omanip)(ostream&);
extern istream& ws(istream& ins);
extern ostream& flush(ostream& outs);
extern ostream& endl(ostream& outs);
extern ostream& ends(ostream& outs);
class ostream : virtual public ios
{
void do_osfx();
public:
ostream() { }
ostream(streambuf* sb, ostream* tied= ((void *)0) );
int opfx() {
if (!good()) return 0; else { if (_tie) _tie->flush(); return 1;} }
void osfx() { if (flags() & (ios::unitbuf|ios::stdio))
do_osfx(); }
ostream& flush();
ostream& put(char c) { _strbuf->sputc(c); return *this; }
ostream& write(const char *s, streamsize n);
ostream& write(const unsigned char *s, streamsize n)
{ return write((const char*)s, n);}
ostream& write(const signed char *s, streamsize n)
{ return write((const char*)s, n);}
ostream& write(const void *s, streamsize n)
{ return write((const char*)s, n);}
ostream& seekp(streampos);
ostream& seekp(streamoff, _seek_dir);
streampos tellp();
ostream& form(const char *format ...);
ostream& vform(const char *format, _G_va_list args);
ostream& operator<<(char c);
ostream& operator<<(unsigned char c) { return (*this) << (char)c; }
ostream& operator<<(signed char c) { return (*this) << (char)c; }
ostream& operator<<(const char *s);
ostream& operator<<(const unsigned char *s)
{ return (*this) << (const char*)s; }
ostream& operator<<(const signed char *s)
{ return (*this) << (const char*)s; }
ostream& operator<<(const void *p);
ostream& operator<<(int n);
ostream& operator<<(unsigned int n);
ostream& operator<<(long n);
ostream& operator<<(unsigned long n);
ostream& operator<<(long long n);
ostream& operator<<(unsigned long long n);
ostream& operator<<(short n) {return operator<<((int)n);}
ostream& operator<<(unsigned short n) {return operator<<((unsigned int)n);}
ostream& operator<<(bool b) { return operator<<((int)b); }
ostream& operator<<(double n);
ostream& operator<<(float n) { return operator<<((double)n); }
ostream& operator<<(long double n) { return operator<<((double)n); }
ostream& operator<<(__omanip func) { return (*func)(*this); }
ostream& operator<<(__manip func) {(*func)(*this); return *this;}
ostream& operator<<(streambuf*);
};
class istream : virtual public ios
{
protected:
_G_size_t _gcount;
int _skip_ws();
public:
istream() { _gcount = 0; }
istream(streambuf* sb, ostream*tied= ((void *)0) );
istream& get(char* ptr, int len, char delim = '\n');
istream& get(unsigned char* ptr, int len, char delim = '\n')
{ return get((char*)ptr, len, delim); }
istream& get(char& c);
istream& get(unsigned char& c) { return get((char&)c); }
istream& getline(char* ptr, int len, char delim = '\n');
istream& getline(unsigned char* ptr, int len, char delim = '\n')
{ return getline((char*)ptr, len, delim); }
istream& get(signed char& c) { return get((char&)c); }
istream& get(signed char* ptr, int len, char delim = '\n')
{ return get((char*)ptr, len, delim); }
istream& getline(signed char* ptr, int len, char delim = '\n')
{ return getline((char*)ptr, len, delim); }
istream& read(char *ptr, streamsize n);
istream& read(unsigned char *ptr, streamsize n)
{ return read((char*)ptr, n); }
istream& read(signed char *ptr, streamsize n)
{ return read((char*)ptr, n); }
istream& read(void *ptr, streamsize n)
{ return read((char*)ptr, n); }
istream& get(streambuf& sb, char delim = '\n');
istream& gets(char **s, char delim = '\n');
int ipfx(int need) {
if (!good()) { set(ios::failbit); return 0; }
else {
if (_tie && (need == 0 || rdbuf()->in_avail() < need)) _tie->flush();
if (!need && (flags() & ios::skipws)) return _skip_ws();
else return 1;
}
}
int ipfx0() {
if (!good()) { set(ios::failbit); return 0; }
else {
if (_tie) _tie->flush();
if (flags() & ios::skipws) return _skip_ws();
else return 1;
}
}
int ipfx1() {
if (!good()) { set(ios::failbit); return 0; }
else {
if (_tie && rdbuf()->in_avail() == 0) _tie->flush();
return 1;
}
}
void isfx() { }
int get() { if (!ipfx1()) return (-1) ;
else { int ch = _strbuf->sbumpc();
if (ch == (-1) ) set(ios::eofbit);
return ch;
} }
int peek();
_G_size_t gcount() { return _gcount; }
istream& ignore(int n=1, int delim = (-1) );
istream& seekg(streampos);
istream& seekg(streamoff, _seek_dir);
streampos tellg();
istream& putback(char ch) {
if (good() && _strbuf->sputbackc(ch) == (-1) ) clear(ios::badbit);
return *this;}
istream& unget() {
if (good() && _strbuf->sungetc() == (-1) ) clear(ios::badbit);
return *this;}
istream& scan(const char *format ...);
istream& vscan(const char *format, _G_va_list args);
istream& operator>>(char*);
istream& operator>>(unsigned char* p) { return operator>>((char*)p); }
istream& operator>>(signed char*p) { return operator>>((char*)p); }
istream& operator>>(char& c);
istream& operator>>(unsigned char& c) {return operator>>((char&)c);}
istream& operator>>(signed char& c) {return operator>>((char&)c);}
istream& operator>>(int&);
istream& operator>>(long&);
istream& operator>>(long long&);
istream& operator>>(unsigned long long&);
istream& operator>>(short&);
istream& operator>>(unsigned int&);
istream& operator>>(unsigned long&);
istream& operator>>(unsigned short&);
istream& operator>>(bool&);
istream& operator>>(float&);
istream& operator>>(double&);
istream& operator>>(long double&);
istream& operator>>( __manip func) {(*func)(*this); return *this;}
istream& operator>>(__imanip func) { return (*func)(*this); }
istream& operator>>(streambuf*);
};
class iostream : public istream, public ostream
{
public:
iostream() { }
iostream(streambuf* sb, ostream*tied= ((void *)0) );
};
class _IO_istream_withassign : public istream {
public:
_IO_istream_withassign& operator=(istream&);
};
class _IO_ostream_withassign : public ostream {
public:
_IO_ostream_withassign& operator=(ostream&);
};
extern _IO_istream_withassign cin;
extern _IO_ostream_withassign cout, cerr, clog;
struct Iostream_init { } ;
inline ios& dec(ios& i)
{ i.setf(ios::dec, ios::dec|ios::hex|ios::oct); return i; }
inline ios& hex(ios& i)
{ i.setf(ios::hex, ios::dec|ios::hex|ios::oct); return i; }
inline ios& oct(ios& i)
{ i.setf(ios::oct, ios::dec|ios::hex|ios::oct); return i; }
# 30 "/home/arthur/benz/Packages/GraLab3/src/include/graph.h" 2
# 1 "/home/arthur/benz/Packages/OpenStep/lib/gcc-lib/sparc-sun-solaris2.4/2.7.0/include/stdarg.h" 1 3 4
# 1 "/home/arthur/benz/Packages/OpenStep/lib/gcc-lib/sparc-sun-solaris2.4/2.7.0/include/va-sparc.h" 1 3 4
# 19 "/home/arthur/benz/Packages/OpenStep/lib/gcc-lib/sparc-sun-solaris2.4/2.7.0/include/va-sparc.h" 3 4
typedef void * __gnuc_va_list;
# 50 "/home/arthur/benz/Packages/OpenStep/lib/gcc-lib/sparc-sun-solaris2.4/2.7.0/include/va-sparc.h" 3 4
# 88 "/home/arthur/benz/Packages/OpenStep/lib/gcc-lib/sparc-sun-solaris2.4/2.7.0/include/va-sparc.h" 3 4
void va_end (__gnuc_va_list);
enum __va_type_classes {
__no_type_class = -1,
__void_type_class,
__integer_type_class,
__char_type_class,
__enumeral_type_class,
__boolean_type_class,
__pointer_type_class,
__reference_type_class,
__offset_type_class,
__real_type_class,
__complex_type_class,
__function_type_class,
__method_type_class,
__record_type_class,
__union_type_class,
__array_type_class,
__string_type_class,
__set_type_class,
__file_type_class,
__lang_type_class
};
# 175 "/home/arthur/benz/Packages/OpenStep/lib/gcc-lib/sparc-sun-solaris2.4/2.7.0/include/va-sparc.h" 3 4
# 198 "/home/arthur/benz/Packages/OpenStep/lib/gcc-lib/sparc-sun-solaris2.4/2.7.0/include/va-sparc.h" 3 4
# 30 "/home/arthur/benz/Packages/OpenStep/lib/gcc-lib/sparc-sun-solaris2.4/2.7.0/include/stdarg.h" 2 3 4
# 96 "/home/arthur/benz/Packages/OpenStep/lib/gcc-lib/sparc-sun-solaris2.4/2.7.0/include/stdarg.h" 3 4
typedef __gnuc_va_list va_list;
# 165 "/home/arthur/benz/Packages/OpenStep/lib/gcc-lib/sparc-sun-solaris2.4/2.7.0/include/stdarg.h" 3 4
# 31 "/home/arthur/benz/Packages/GraLab3/src/include/graph.h" 2
# 1 "/home/arthur/benz/Packages/OpenStep/lib/gcc-lib/sparc-sun-solaris2.4/2.7.0/include/stdio.h" 1 3 4
#pragma ident "@(#)stdio.h 1.34 94/06/07 SMI"
extern "C" {
typedef long fpos_t;
typedef struct
{
int _cnt;
unsigned char *_ptr;
unsigned char *_base;
unsigned char _flag;
unsigned char _file;
} FILE;
extern FILE __iob[20 ];
extern FILE *_lastbuf;
extern unsigned char *_bufendtab[];
extern unsigned char _sibuf[], _sobuf[];
extern int remove(const char *);
extern int rename(const char *, const char *);
extern FILE *tmpfile(void);
extern char *tmpnam(char *);
extern int fclose(FILE *);
extern int fflush(FILE *);
extern FILE *fopen(const char *, const char *);
extern FILE *freopen(const char *, const char *, FILE *);
extern void setbuf(FILE *, char *);
extern int setvbuf(FILE *, char *, int, size_t);
extern int fprintf(FILE *, const char *, ...);
extern int fscanf(FILE *, const char *, ...);
extern int printf(const char *, ...);
extern int scanf(const char *, ...);
extern int sprintf(char *, const char *, ...);
extern int sscanf(const char *, const char *, ...);
extern int vfprintf(FILE *, const char *, void *);
extern int vprintf(const char *, void *);
extern int vsprintf(char *, const char *, void *);
extern int fgetc(FILE *);
extern char *fgets(char *, int, FILE *);
extern int fputc(int, FILE *);
extern int fputs(const char *, FILE *);
extern int getc(FILE *);
extern int getchar(void);
extern char *gets(char *);
extern int putc(int, FILE *);
extern int putchar(int);
extern int puts(const char *);
extern int ungetc(int, FILE *);
extern size_t fread(void *, size_t, size_t, FILE *);
#pragma int_to_unsigned fread
extern size_t fwrite(const void *, size_t, size_t, FILE *);
#pragma int_to_unsigned fwrite
extern int fgetpos(FILE *, fpos_t *);
extern int fseek(FILE *, long, int);
extern int fsetpos(FILE *, const fpos_t *);
extern long ftell(FILE *);
extern void rewind(FILE *);
extern void clearerr(FILE *);
extern int feof(FILE *);
extern int ferror(FILE *);
extern void perror(const char *);
extern int __filbuf(FILE *);
extern int __flsbuf(int, FILE *);
# 244 "/home/arthur/benz/Packages/OpenStep/lib/gcc-lib/sparc-sun-solaris2.4/2.7.0/include/stdio.h" 3 4
extern FILE *fdopen(int, const char *);
extern char *ctermid(char *);
extern int fileno(FILE *);
extern FILE *popen(const char *, const char *);
extern char *cuserid(char *);
extern char *tempnam(const char *, const char *);
extern int getopt(int, char *const *, const char *);
extern int getsubopt(char **, char *const *, char **);
extern char *optarg;
extern int optind, opterr, optopt;
extern int getw(FILE *);
extern int putw(int, FILE *);
extern int pclose(FILE *);
# 341 "/home/arthur/benz/Packages/OpenStep/lib/gcc-lib/sparc-sun-solaris2.4/2.7.0/include/stdio.h" 3 4
}
# 32 "/home/arthur/benz/Packages/GraLab3/src/include/graph.h" 2
# 1 "/home/arthur/benz/Packages/GraLab3/src/include/graphconfig.h" 1
# 35 "/home/arthur/benz/Packages/GraLab3/src/include/graph.h" 2
# 1 "/home/arthur/benz/Packages/GraLab3/src/include/undo.h" 1
class G_undoStack;
typedef void (*G_action)(void *);
class G_undoStack
{
struct item
{
enum itemType { assignInt, assignUInt, assignPointer,
undoAction, clearAction, action,
marker }
type;
union {
int vInt;
unsigned vUInt;
void * vPointer;
} value;
union {
int *pI;
unsigned *pUI;
void **pP;
G_action action;
} address;
};
private:
unsigned sz, count;
int status;
item * itemTable;
void overflow(const char *funcName);
public:
G_undoStack(unsigned size=1000);
~G_undoStack();
void undo(unsigned markerValue);
void _clear();
inline void clear();
inline void pushAssignInt(int *addr);
inline void pushAssignUInt(unsigned *addr);
inline void pushAssignPointer(void **addr);
inline void pushUndoAction(G_action action, void *param);
inline void pushClearAction(G_action action, void *param);
inline void pushAction(G_action action, void *param);
inline void mark(unsigned markerValue);
inline int isOk();
unsigned getAvailable() { return status ? 0 : sz-count; };
int isMarked(unsigned markerValue);
};
inline void G_undoStack::clear()
{
_clear();
status=0;
}
inline int G_undoStack::isOk()
{
return status==0;
}
inline void G_undoStack::pushAssignInt(int *lhs)
{
if (count==sz)
overflow("pushAssignInt");
if (!status)
{
itemTable[count].value.vInt=*(itemTable[count].address.pI=lhs);
itemTable[count].type=item::assignInt;
++count;
}
}
inline void G_undoStack::pushAssignUInt(unsigned *lhs)
{
if (count==sz)
overflow("pushAssignInt");
if (!status)
{
itemTable[count].value.vUInt=*(itemTable[count].address.pUI=lhs);
itemTable[count].type=item::assignUInt;
++count;
}
}
inline void G_undoStack::pushAssignPointer(void **lhs)
{
if (count==sz)
overflow("pushAssignPointer");
if (!status)
{
itemTable[count].value.vPointer=*(itemTable[count].address.pP=lhs);
itemTable[count].type=item::assignPointer;
++count;
}
}
inline void G_undoStack::pushUndoAction(G_action action, void *param)
{
if (count==sz)
overflow("pushUndoAction");
if (!status)
{
itemTable[count].value.vPointer=param;
itemTable[count].address.action=action;
itemTable[count].type=item::undoAction;
++count;
}
}
inline void G_undoStack::pushClearAction(G_action action, void *param)
{
if (count==sz)
overflow("pushClearAction");
if (!status)
{
itemTable[count].value.vPointer=param;
itemTable[count].address.action=action;
itemTable[count].type=item::clearAction;
++count;
}
}
inline void G_undoStack::pushAction(G_action action, void *param)
{
if (count==sz)
overflow("pushAction");
if (!status)
{
itemTable[count].value.vPointer=param;
itemTable[count].address.action=action;
itemTable[count].type=item::action;
++count;
}
}
inline void G_undoStack::mark(unsigned markerValue)
{
if (count==sz)
overflow("mark");
if (!status)
{
itemTable[count].value.vUInt=markerValue;
itemTable[count].type=item::marker;
++count;
}
}
# 266 "/home/arthur/benz/Packages/GraLab3/src/include/undo.h"
# 37 "/home/arthur/benz/Packages/GraLab3/src/include/graph.h" 2
# 1 "/home/arthur/benz/Packages/GraLab3/src/include/message.h" 1
class G_msg {
private:
static int initialized;
static char msgStr[100], errStr[100], fErrStr[100], infStr[100],
conFndStr[100], actTakStr[100], reaProStr[100];
static char msgPath[600];
static void print(int sev, int nr, const char *mod, const char *fun, va_list va_ptr);
static int seekMsgEntry(FILE *fp, int nr);
public:
static int errorCount, maxErrorCount;
static void warning (int nr, const char *modName, const char *funcName, ...),
error (int nr, const char *modName, const char *funcName, ...),
fatalError (int nr, const char *modName, const char *funcName, ...);
static void setHeaders(const char *fileName="msgems");
static void addDirectory(const char *directoryName);
};
# 41 "/home/arthur/benz/Packages/GraLab3/src/include/graph.h" 2
# 1 "/home/arthur/benz/Packages/GraLab3/src/include/checking.h" 1
# 42 "/home/arthur/benz/Packages/GraLab3/src/include/graph.h" 2
# 1 "/home/arthur/benz/Packages/GraLab3/src/include/trace.h" 1
class G_trace
{
private:
static G_trace *entry[100 ];
static int numEntry;
static int globFlag;
static int level;
public:
static ostream *out;
static void enter() { ++level; };
static void leave() { if (level) --level; };
static void indent();
static int set(char *pattern, int flag);
static void set(int flag) { globFlag=flag; };
static void setFile(const char *fileName);
private:
int flag;
char *name;
public:
int reg();
G_trace(char *n)
{ name=strdup(n); flag=0; reg(); };
int check() { return flag && globFlag; };
};
# 64 "/home/arthur/benz/Packages/GraLab3/src/include/trace.h"
# 43 "/home/arthur/benz/Packages/GraLab3/src/include/graph.h" 2
# 1 "/home/arthur/benz/Packages/GraLab3/src/include/fns.h" 1
int G_getEnvVar(const char *varId, int def);
unsigned G_getEnvVar(const char *varId, unsigned def);
void G_getEnvVar(const char *varId, char *dest, const char *def, int maxLength);
FILE *G_flopen(const char *libs, const char *file, const char *flags);
int G_scan(istream &iS, const char *string);
# 46 "/home/arthur/benz/Packages/GraLab3/src/include/graph.h" 2
# 1 "/home/arthur/benz/Packages/OpenStep/lib/gcc-lib/sparc-sun-solaris2.4/2.7.0/include/math.h" 1 3 4
extern "C" {
#pragma ident "@(#)math.h 2.3 93/09/07"
typedef union _h_val {
unsigned long _i[2];
double _d;
} _h_val;
extern const _h_val __huge_val;
extern int signgam;
enum version {libm_ieee = -1, c_issue_4, ansi_1, strict_ansi};
extern const enum version _lib_version;
struct exception {
int type;
char *name;
double arg1;
double arg2;
double retval;
};
extern double acos (double) ;
extern double asin (double) ;
extern double atan (double) ;
extern double atan2 (double, double) ;
extern double cos (double) ;
extern double sin (double) ;
extern double tan (double) ;
extern double cosh (double) ;
extern double sinh (double) ;
extern double tanh (double) ;
extern double exp (double) ;
extern double frexp (double, int *) ;
extern double ldexp (double, int) ;
extern double log (double) ;
extern double log10 (double) ;
extern double modf (double, double *) ;
extern double pow (double, double) ;
extern double sqrt (double) ;
extern double ceil (double) ;
extern double fabs (double) ;
extern double floor (double) ;
extern double fmod (double, double) ;
extern double erf (double) ;
extern double erfc (double) ;
extern double gamma (double) ;
extern double hypot (double, double) ;
extern int isnan (double) ;
extern double j0 (double) ;
extern double j1 (double) ;
extern double jn (int, double) ;
extern double lgamma (double) ;
extern double y0 (double) ;
extern double y1 (double) ;
extern double yn (int, double) ;
extern double acosh (double) ;
extern double asinh (double) ;
extern double atanh (double) ;
extern double cbrt (double) ;
extern double logb (double) ;
extern double nextafter (double, double) ;
extern double remainder (double, double) ;
extern double scalb (double, double) ;
extern int matherr (struct exception *) ;
extern double significand (double) ;
extern double copysign (double, double) ;
extern int ilogb (double) ;
extern double rint (double) ;
extern double scalbn (double, int) ;
extern double expm1 (double) ;
extern double log1p (double) ;
extern float modff (float, float *) ;
# 1 "/home/arthur/benz/Packages/OpenStep/lib/gcc-lib/sparc-sun-solaris2.4/2.7.0/include/floatingpoint.h" 1 3 4
extern "C" {
#pragma ident "@(#)floatingpoint.h 2.3 93/09/07 SunPro"
# 1 "/home/arthur/benz/Packages/OpenStep/lib/gcc-lib/sparc-sun-solaris2.4/2.7.0/include/sys/ieeefp.h" 1 3 4
#pragma ident "@(#)ieeefp.h 2.3 93/09/07 SunPro"
extern "C" {
enum fp_direction_type {
fp_nearest = 0,
fp_tozero = 1,
fp_positive = 2,
fp_negative = 3
};
enum fp_precision_type {
fp_extended = 0,
fp_single = 1,
fp_double = 2,
fp_precision_3 = 3
};
enum fp_exception_type {
fp_inexact = 0,
fp_division = 1,
fp_underflow = 2,
fp_overflow = 3,
fp_invalid = 4
};
# 64 "/home/arthur/benz/Packages/OpenStep/lib/gcc-lib/sparc-sun-solaris2.4/2.7.0/include/sys/ieeefp.h" 3 4
enum fp_class_type {
fp_zero = 0,
fp_subnormal = 1,
fp_normal = 2,
fp_infinity = 3,
fp_quiet = 4,
fp_signaling = 5
};
}
# 35 "/home/arthur/benz/Packages/OpenStep/lib/gcc-lib/sparc-sun-solaris2.4/2.7.0/include/floatingpoint.h" 2 3 4
typedef int sigfpe_code_type;
typedef void (*sigfpe_handler_type)();
extern sigfpe_handler_type sigfpe (sigfpe_code_type, sigfpe_handler_type) ;
typedef float single;
typedef unsigned extended[3];
typedef long double quadruple;
typedef unsigned fp_exception_field_type;
typedef char decimal_string[512 ];
typedef struct {
enum fp_class_type fpclass;
int sign;
int exponent;
decimal_string ds;
int more;
int ndigits;
} decimal_record;
enum decimal_form {
fixed_form,
floating_form
};
typedef struct {
enum fp_direction_type rd;
enum decimal_form df;
int ndigits;
} decimal_mode;
enum decimal_string_form {
invalid_form,
whitespace_form,
fixed_int_form,
fixed_intdot_form,
fixed_dotfrac_form,
fixed_intdotfrac_form,
floating_int_form,
floating_intdot_form,
floating_dotfrac_form,
floating_intdotfrac_form,
inf_form,
infinity_form,
nan_form,
nanstring_form
};
extern void single_to_decimal (single *, decimal_mode *, decimal_record *,
fp_exception_field_type *) ;
extern void double_to_decimal (double *, decimal_mode *, decimal_record *,
fp_exception_field_type *) ;
extern void extended_to_decimal (extended *, decimal_mode *,
decimal_record *, fp_exception_field_type *) ;
extern void quadruple_to_decimal (quadruple *, decimal_mode *,
decimal_record *, fp_exception_field_type *) ;
extern void decimal_to_single (single *, decimal_mode *, decimal_record *,
fp_exception_field_type *) ;
extern void decimal_to_double (double *, decimal_mode *, decimal_record *,
fp_exception_field_type *) ;
extern void decimal_to_extended (extended *, decimal_mode *,
decimal_record *, fp_exception_field_type *) ;
extern void decimal_to_quadruple (quadruple *, decimal_mode *,
decimal_record *, fp_exception_field_type *) ;
extern void string_to_decimal (char **, int, int, decimal_record *,
enum decimal_string_form *, char **) ;
extern void func_to_decimal (char **, int, int, decimal_record *,
enum decimal_string_form *, char **,
int (*)(void), int *, int (*)(int)) ;
extern void file_to_decimal (char **, int, int, decimal_record *,
enum decimal_string_form *, char **,
FILE *, int *) ;
extern char *seconvert (single *, int, int *, int *, char *) ;
extern char *sfconvert (single *, int, int *, int *, char *) ;
extern char *sgconvert (single *, int, int, char *) ;
extern char *econvert (double, int, int *, int *, char *) ;
extern char *fconvert (double, int, int *, int *, char *) ;
extern char *gconvert (double, int, int, char *) ;
extern char *qeconvert (quadruple *, int, int *, int *, char *) ;
extern char *qfconvert (quadruple *, int, int *, int *, char *) ;
extern char *qgconvert (quadruple *, int, int, char *) ;
extern char *ecvt (double, int, int *, int *) ;
extern char *fcvt (double, int, int *, int *) ;
extern char *gcvt (double, int, char *) ;
extern double atof (const char *) ;
extern double strtod (const char *, char **) ;
}
# 206 "/home/arthur/benz/Packages/OpenStep/lib/gcc-lib/sparc-sun-solaris2.4/2.7.0/include/math.h" 2 3 4
}
# 50 "/home/arthur/benz/Packages/GraLab3/src/include/graph.h" 2
# 1 "/home/arthur/benz/Packages/GraLab3/src/include/type.h" 1
# 1 "/home/arthur/benz/Packages/GraLab3/src/include/atrschem.h" 1
typedef unsigned G_attrNo;
extern const G_attrNo G_AttrNoNull;
extern const G_attrNo G_AttrNoUnknown;
class G_attribute;
typedef G_attribute *(*G_restoreFunctionT)(istream &, unsigned);
class G_graph;
class G_attrSchema
{
private:
const char * idString;
G_attrNo attrNo;
G_restoreFunctionT
restoreFunc;
static G_attrNo attrCount, attrMax;
static G_attrSchema ** attrTable;
static void init();
void regSchema();
public:
G_attrSchema(const char *idStr,
G_restoreFunctionT restore);
inline G_attrNo getAttrNo() const;
inline const char * getAttrId() const;
static G_attrNo getAttrNo(const char *idString);
inline static const G_attrSchema &
getSchema(G_attrNo aNo);
static G_attribute * restore(G_attrNo, istream &iS, unsigned length);
};
inline G_attrNo G_attrSchema::getAttrNo() const
{
return attrNo;
};
inline const char *G_attrSchema::getAttrId() const
{
return idString;
};
inline const G_attrSchema &G_attrSchema::getSchema(G_attrNo aNo)
{
return *attrTable[aNo];
}
# 26 "/home/arthur/benz/Packages/GraLab3/src/include/type.h" 2
typedef unsigned G_typeNo;
extern const G_typeNo G_NotUsed;
extern const G_typeNo G_TypeNoNull;
extern const G_typeNo G_TypeUnusable;
class G_graph;
class G_type;
class G_typeSystem
{
friend G_type;
private:
G_typeSystem(const G_typeSystem &);
G_typeSystem & operator=(const G_typeSystem &);
protected:
G_typeNo typeCount, typeM;
G_type ** typeTable;
unsigned * subTypeTable;
unsigned subTypeTableLine;
void init(unsigned tMax);
G_typeNo newType(G_type &type);
void setSubType(G_typeNo subNo, G_typeNo superNo);
inline int isValid(G_typeNo tNo) const;
public:
G_typeSystem(unsigned typeMax
=G_getEnvVar("G_MaxType", 200 ) );
~G_typeSystem();
G_typeSystem(const char *fileName);
int store(const char *fileName) const;
void setIsA(const G_type &subType, const G_type &superType);
int isA(const G_type &subType, const G_type &superType) const;
int isA(G_typeNo subNo, G_typeNo superNo) const;
inline const G_type & getType(G_typeNo tNo) const;
const G_type & getType(const char *id) const;
int contains(const char *id) const;
inline int contains(const G_type &type) const;
inline unsigned getCount() { return typeCount; };
inline unsigned typeMax() { return typeM; };
};
class G_type
{
friend G_typeSystem;
private:
G_type(const G_type &);
G_type & operator=(const G_type &);
protected:
const char * idString;
G_typeNo typeNo;
G_attrNo attrNo;
G_type() {};
public:
G_type(G_typeSystem &tSys,
const char *idString,
const G_attrSchema &aSchema
= G_attrSchema::getSchema(G_attrSchema::getAttrNo("NULL")));
inline G_typeNo getTypeNo() const;
inline G_attrNo getAttrNo() const;
inline const char * getTypeId() const;
inline int isTypeNull() const;
G_attribute * restore(istream &iS) const;
};
class G_typeNull:public G_type
{
private:
G_typeNull(const G_typeNull &);
public:
void init();
G_typeNull();
};
extern G_typeNull G__TypeNull;
extern G_type & G_TypeNull;
# 53 "/home/arthur/benz/Packages/GraLab3/src/include/graph.h" 2
# 1 "/home/arthur/benz/Packages/GraLab3/src/include/inline/typeget.h" 1
inline G_typeNo G_type::getTypeNo() const
{ return typeNo; }
inline G_attrNo G_type::getAttrNo() const
{ return attrNo; }
inline const char * G_type::getTypeId() const
{ return idString; }
inline int G_type::isTypeNull() const
{ return this==&G_TypeNull; }
inline int G_typeSystem::isA(G_typeNo subNo, G_typeNo superNo) const
{
return subTypeTable[subNo*subTypeTableLine+superNo/ (sizeof(unsigned)*8) ]
& (1<< (superNo % (sizeof(unsigned)*8) ));
}
inline int G_typeSystem::isA(const G_type &sub, const G_type &super) const
{
return isA (sub.getTypeNo(), super.getTypeNo());
}
inline int G_typeSystem::isValid(G_typeNo tNo) const
{
return (tNo <typeCount);
}
inline int G_typeSystem::contains(const G_type &type) const
{
return (isValid(type.getTypeNo())
&& &type==typeTable[type.getTypeNo()]);
}
inline const G_type &G_typeSystem::getType(G_typeNo tNo) const
{
return *typeTable[tNo];
}
# 56 "/home/arthur/benz/Packages/GraLab3/src/include/graph.h" 2
# 1 "/home/arthur/benz/Packages/GraLab3/src/include/grfclass.h" 1
typedef unsigned G_vertex;
typedef int G_edge;
extern const G_vertex G_VertexNull;
extern const G_edge G_EdgeNull;
# 1 "/home/arthur/benz/Packages/GraLab3/src/include/atrclass.h" 1
# 1 "/home/arthur/benz/Packages/GraLab3/src/include/tempattr.h" 1
# 1 "/home/arthur/benz/Packages/GraLab3/src/include/basattr.h" 1
class G_basicAttribute
{
public:
virtual ostream &print(ostream &oS);
virtual ~G_basicAttribute();
void logicalDelete() {};
void logicalUndelete() {};
static void callDestructor(void *pAttr) { delete (G_basicAttribute *)pAttr; };
static void callLogicalUndelete(void *pAttr) { ((G_basicAttribute *)pAttr)->logicalUndelete(); };
};
# 4 "/home/arthur/benz/Packages/GraLab3/src/include/tempattr.h" 2
class G_graph;
class G_tempAttribute : public G_basicAttribute
{
friend G_graph;
private:
int layerId;
G_tempAttribute *nextInStack;
union { G_vertex v;
G_edge e; }
nextInLayer;
};
class G_tempLayer
{
friend G_graph;
private:
G_tempLayer *next;
union { G_vertex v;
G_edge e; }
firstInLayer;
};
# 8 "/home/arthur/benz/Packages/GraLab3/src/include/atrclass.h" 2
class G_attribute : public G_basicAttribute
{
private:
public:
virtual void *getPAttr() { return this; };
virtual ostream &print(ostream &oS);
virtual void store(ostream &oS);
virtual G_attrNo getAttrNo()=0;
getSchema();
};
# 51 "/home/arthur/benz/Packages/GraLab3/src/include/grfclass.h" 2
class G_graph
{
private:
unsigned vMax, eMax,
vCount, eCount;
G_vertex firstGV, lastGV, *nextGV,
firstFreeV;
G_edge firstGE, lastGE, *nextGE,
firstFreeE;
G_edge *firstE,
*lastE,
*nextE;
G_typeSystem * pTypeSystem;
G_typeNo *vType;
G_attribute **vAttr;
G_typeNo *eType;
G_attribute **eAttr;
G_vertex *node;
G_tempLayer *vTempLayer, *eTempLayer;
int vTempLayerId, eTempLayerId;
G_tempAttribute **vTemp,
**eTemp;
G_undoStack *uS;
int vIncrease();
int eIncrease();
void storeTypeTranslation(ostream &oS) const;
G_typeNo * restoreTypeTranslation(istream &iS, unsigned &tCount) const;
public:
G_graph(G_typeSystem *pTypeSys=0,
unsigned vMax=G_getEnvVar("G_NMAX", 1000 ),
unsigned eMax=G_getEnvVar("G_MMAX", 1000 ));
~G_graph();
G_vertex createVertex(), createVertex(unsigned vNo);
G_edge createEdge(G_vertex alpha, G_vertex omega),
createEdge(unsigned eNr, G_vertex alpha, G_vertex omega);
G_vertex getV(unsigned vNo) const { return vNo; };
G_edge getE(int eNo) const { return eNo; };
unsigned getVNo(G_vertex v) const { return v; };
int getENo(G_edge e) const { return e; };
void changeAlpha(G_edge e, G_vertex v),
changeOmega(G_edge e, G_vertex v),
changeThis(G_edge e, G_vertex v),
changeThat(G_edge e, G_vertex v);
void deleteVertex(G_vertex v);
void deleteEdge(G_edge e);
inline unsigned vertexCount() const, edgeCount() const,
vertexMax() const, edgeMax() const;
G_edge edgeFromTo(G_vertex alpha, G_vertex omega) const,
edgeBetween(G_vertex v1, G_vertex v2) const;
inline G_vertex firstVertex() const,
nextVertex(G_vertex v) const;
inline G_edge firstEdge() const,
nextEdge(G_edge e) const;
inline G_edge first(G_vertex v) const,
next(G_edge e) const;
G_edge firstIn(G_vertex v) const,
nextIn(G_edge e) const,
firstOut(G_vertex v) const,
nextOut(G_edge e) const;
G_vertex firstVertex(const G_type &type) const,
nextVertex(const G_type &type, G_vertex v) const;
G_edge firstEdge(const G_type &type) const,
nextEdge(const G_type &type, G_edge e) const;
G_edge first(const G_type &type, G_vertex v) const,
next(const G_type &type, G_edge e) const;
G_edge firstIn(const G_type &type, G_vertex v) const,
nextIn(const G_type &type, G_edge e) const,
firstOut(const G_type &type, G_vertex v) const,
nextOut(const G_type &type, G_edge e) const;
inline int isVertex(G_vertex v) const,
isEdge(G_edge e) const;
inline int areEqualVertices(G_vertex v1, G_vertex v2) const,
areEqualEdges(G_edge e1, G_edge e2) const,
isVertexNull(G_vertex v) const,
isEdgeNull(G_edge e) const;
int isVertexBefore(G_vertex v, G_vertex w) const,
isEdgeBefore(G_edge e, G_edge f) const,
isBefore(G_edge e, G_edge f) const;
void putVertexBefore(G_vertex v, G_vertex w),
putVertexAfter(G_vertex v, G_vertex w),
putEdgeBefore(G_edge e, G_edge f),
putEdgeAfter(G_edge e, G_edge f),
putBefore(G_edge e, G_edge f),
putAfter(G_edge e, G_edge f);
inline G_vertex alpha(G_edge e) const, omega(G_edge e) const,
thisV(G_edge e) const, thatV(G_edge e) const;
inline G_edge normal(G_edge e) const, reverse(G_edge e) const;
unsigned degree(G_vertex v) const,
inDegree(G_vertex v) const, outDegree(G_vertex v) const;
int setVType(G_vertex v, const G_type &type, G_attribute *pAttr=0);
int setEType(G_edge e, const G_type &type, G_attribute *pAttr=0);
inline G_attribute *getPVAttr(G_vertex v) const,
*getPEAttr(G_edge e) const;
inline const G_type & getVType(G_vertex) const;
inline const G_type & getEType(G_edge) const;
inline int isAV(G_vertex v, const G_type &type) const,
isAE(G_edge e, const G_type &type) const;
int createVTemp(),
createETemp();
void deleteVTemp(), deleteETemp();
int setPVTemp(G_vertex, G_tempAttribute *),
setPETemp(G_edge, G_tempAttribute *);
inline G_tempAttribute *getPVTemp(G_vertex v) const,
*getPETemp(G_edge e) const;
int getVTempLevel() { return vTempLayerId; };
int getETempLevel() { return eTempLayerId; };
ostream &print(ostream &oS) const,
&printVertex(ostream &oS, G_vertex) const,
&printEdge(ostream &oS, G_edge) const;
static G_graph *restore(const char *fileName, G_typeSystem *pTypeSys=0);
void store(const char *fileName) const;
inline void setUndoStack(G_undoStack *undoSt)
{ uS=undoSt; };
int checkEdge(G_edge e);
int checkVertex(G_vertex v);
int checkStructure();
};
inline ostream & operator <<(ostream &oS, const G_graph &g);
# 59 "/home/arthur/benz/Packages/GraLab3/src/include/graph.h" 2
# 1 "/home/arthur/benz/Packages/GraLab3/src/include/grfundo.h" 1
# 13 "/home/arthur/benz/Packages/GraLab3/src/include/grfundo.h"
# 61 "/home/arthur/benz/Packages/GraLab3/src/include/graph.h" 2
# 1 "/home/arthur/benz/Packages/GraLab3/src/include/inline/grftra.h" 1
inline G_vertex G_graph::firstVertex() const
{
return firstGV;
}
inline G_vertex G_graph::nextVertex(G_vertex v) const
{
return nextGV[v];
}
inline G_edge G_graph::firstEdge() const
{
return firstGE;
}
inline G_edge G_graph::nextEdge(G_edge e) const
{
return nextGE[abs(e)];
}
inline G_edge G_graph::first(G_vertex v) const
{
return firstE[v];
}
inline G_edge G_graph::next(G_edge e) const
{
return nextE[e];
}
# 65 "/home/arthur/benz/Packages/GraLab3/src/include/graph.h" 2
# 1 "/home/arthur/benz/Packages/GraLab3/src/include/inline/grfatr.h" 1
inline G_attribute *G_graph::getPVAttr(G_vertex v) const
{
return vAttr[v];
}
inline G_attribute *G_graph::getPEAttr(G_edge e) const
{
return eAttr[abs(e)];
}
inline const G_type & G_graph::getVType(G_vertex v) const
{
if (pTypeSystem)
return pTypeSystem->getType(vType[v]);
else
return G_TypeNull;
}
inline const G_type & G_graph::getEType(G_edge e) const
{
if (pTypeSystem)
return pTypeSystem->getType(eType[abs(e)]);
else
return G_TypeNull;
}
inline int G_graph::isAV(G_vertex v, const G_type &type) const
{
# 82 "/home/arthur/benz/Packages/GraLab3/src/include/inline/grfatr.h"
return pTypeSystem->isA(vType[v], type.getTypeNo());
}
inline int G_graph::isAE(G_edge e, const G_type &type) const
{
# 108 "/home/arthur/benz/Packages/GraLab3/src/include/inline/grfatr.h"
return pTypeSystem->isA(eType[abs(e)], type.getTypeNo());
}
inline G_tempAttribute *G_graph::getPVTemp(G_vertex v) const
{
G_tempAttribute *pAttr=vTemp[v];
if (pAttr && pAttr->layerId==vTempLayerId)
return pAttr;
else
return 0;
}
inline G_tempAttribute *G_graph::getPETemp(G_edge e) const
{
G_tempAttribute *pAttr=eTemp[abs(e)];
if (pAttr && pAttr->layerId==eTempLayerId)
return pAttr;
else
return 0;
}
# 66 "/home/arthur/benz/Packages/GraLab3/src/include/graph.h" 2
# 1 "/home/arthur/benz/Packages/GraLab3/src/include/inline/grfaux.h" 1
inline G_vertex G_graph::alpha(G_edge e) const
{
return node[-abs(e)];
}
inline G_vertex G_graph::omega(G_edge e) const
{
return node[abs(e)];
}
inline G_vertex G_graph::thisV(G_edge e) const
{
return node[-e];
}
inline G_vertex G_graph::thatV(G_edge e) const
{
return node[e];
}
inline G_edge G_graph::normal(G_edge e) const
{
return abs(e);
}
inline G_edge G_graph::reverse(G_edge e) const
{
return -e;
}
# 67 "/home/arthur/benz/Packages/GraLab3/src/include/graph.h" 2
# 1 "/home/arthur/benz/Packages/GraLab3/src/include/inline/grfprt.h" 1
inline ostream &operator << (ostream &oS, const G_graph &g)
{
return g.print(oS);
}
# 68 "/home/arthur/benz/Packages/GraLab3/src/include/graph.h" 2
# 1 "/home/arthur/benz/Packages/GraLab3/src/include/inline/grftst.h" 1
inline int G_graph::isVertex(G_vertex v) const
{
return (v>=1 && v<=vMax && vType[v]!=G_NotUsed);
}
inline int G_graph::isEdge(G_edge e) const
{
return (e>=1 && e<=eMax && eType[e]!=G_NotUsed);
}
inline int G_graph::isVertexNull(G_vertex v) const
{
return v==0;
}
inline int G_graph::isEdgeNull(G_edge e) const
{
return e==0;
}
inline int G_graph::areEqualVertices(G_vertex v1, G_vertex v2) const
{
# 37 "/home/arthur/benz/Packages/GraLab3/src/include/inline/grftst.h"
return v1==v2;
}
inline int G_graph::areEqualEdges(G_edge e1, G_edge e2) const
{
# 56 "/home/arthur/benz/Packages/GraLab3/src/include/inline/grftst.h"
return abs(e1)==abs(e2);
}
# 69 "/home/arthur/benz/Packages/GraLab3/src/include/graph.h" 2
# 1 "/home/arthur/benz/Packages/GraLab3/src/include/inline/grfmsc.h" 1
inline unsigned G_graph::vertexCount() const
{
return vCount;
}
inline unsigned G_graph::edgeCount() const
{
return eCount;
}
inline unsigned G_graph::vertexMax() const
{
return vMax;
}
inline unsigned G_graph::edgeMax() const
{
return eMax;
}
# 70 "/home/arthur/benz/Packages/GraLab3/src/include/graph.h" 2
# 1 "grfall.c" 2
# 1 "/home/arthur/benz/Packages/OpenStep/lib/gcc-lib/sparc-sun-solaris2.4/2.7.0/include/memory.h" 1 3 4
#pragma ident "@(#)memory.h 1.8 92/07/14 SMI"
extern "C" {
extern void *memccpy(void *, const void *, int, size_t);
extern void *memchr(const void *, int, size_t);
extern void *memcpy(void *, const void *, size_t);
extern void *memset(void *, int, size_t);
extern int memcmp(const void *, const void *, size_t);
}
# 2 "grfall.c" 2
int allocVPointers(G_attribute **&vAttr, G_typeNo *&vType, G_vertex *&nextGV,
G_edge *&firstE, G_edge *&lastE, G_tempAttribute **&vTemp,
unsigned vM, G_undoStack *uS)
{
unsigned vSize=(vM+1)*(sizeof(G_attribute *)+sizeof(G_type)
+sizeof(G_vertex)+2*sizeof(G_edge)+sizeof(G_tempAttribute *));
# 22 "grfall.c"
void *newMem=malloc(vSize);
if (newMem==0)
return 0;
;
vAttr=(G_attribute **)newMem;
vType=(G_typeNo*)(vAttr+vM+1);
nextGV=(G_vertex *)(vType+vM+1);
firstE=(G_edge *)(nextGV+vM+1);
lastE=firstE+vM+1;
vTemp=(G_tempAttribute **)(lastE+vM+1);
return 1;
}
int allocEPointers(G_attribute **&eAttr, G_typeNo *&eType, G_edge *&nextGE,
G_edge *&nextE, G_vertex *&node, G_tempAttribute **&eTemp,
unsigned eM, G_undoStack *uS)
{
unsigned eSize= (eM+1)*(sizeof(G_attribute *)+sizeof(G_typeNo)+sizeof(G_edge)
+sizeof(G_tempAttribute *))
+ (eM*2+1)*(sizeof(G_edge)+sizeof(G_vertex));
# 58 "grfall.c"
void *newMem=malloc(eSize);
if (newMem==0)
return 0;
;
eAttr=(G_attribute **)newMem;
eType=(G_typeNo *)(eAttr+eM+1);
nextGE=(G_edge *)(eType+eM+1);
nextE=nextGE+2*eM+1;
node=(G_vertex *)(nextE+eM+1)+eM;
eTemp=(G_tempAttribute **)(node+eM+1);
return 1;
}
int G_graph::vIncrease()
{
int result=0;
;
unsigned vM=vMax*2;
G_attribute **newVAttr;
G_typeNo *newVType;
G_vertex *newNextGV, v;
G_edge *newFirstE, *newLastE;
G_tempAttribute **newVTemp;
if (!allocVPointers(newVAttr, newVType, newNextGV,
newFirstE, newLastE, newVTemp, vM, uS))
{
G_msg::error(5, "grf", "G_graph::vIncrease");
goto exit;
}
memcpy(newVAttr, vAttr, (vMax+1)*sizeof(G_attribute *));
memcpy(newVType, vType, (vMax+1)*sizeof(G_typeNo));
memcpy(newNextGV, nextGV, (vMax+1)*sizeof(G_vertex));
memcpy(newFirstE, firstE, (vMax+1)*sizeof(G_edge));
memcpy(newLastE, lastE, (vMax+1)*sizeof(G_edge));
memcpy(newVTemp, vTemp, (vMax+1)*sizeof(G_tempAttribute *));
free( vAttr ); ;
( vAttr )=( newVAttr ); ;
( vType )=( newVType ); ;
( nextGV )=( newNextGV ); ;
( firstE )=( newFirstE ); ;
( lastE )=( newLastE ); ;
( vTemp )=( newVTemp ); ;
for (v=vMax+1; v<=vM; ++v)
{
vAttr[v]=0;
vType[v]=G_NotUsed;
nextGV[v]=v+1;
firstE[v]=lastE[v]=0;
vTemp[v]=0;
}
( vMax )=( vM ); ;
result=1;
exit:
;
return result;
}
int G_graph::eIncrease()
{
int result=0;
;
unsigned eM=eMax*2;
G_attribute **newEAttr;
G_typeNo *newEType;
G_edge *newNextGE, e;
G_edge *newNextE;
G_vertex *newNode;
G_tempAttribute **newETemp;
if (!allocEPointers(newEAttr, newEType, newNextGE,
newNextE, newNode, newETemp, eM, uS))
{
G_msg::error(5, "grf", "G_graph::eIncrease");
goto exit;
}
memcpy(newEAttr, eAttr, (eMax+1)*sizeof(G_attribute *));
memcpy(newEType, eType, (eMax+1)*sizeof(G_typeNo));
memcpy(newNextGE, nextGE, (eMax+1)*sizeof(G_edge));
memcpy(newNextE-eMax, nextE-eMax, (2*eMax+1)*sizeof(G_edge));
memcpy(newNode-eMax, node-eMax, (2*eMax+1)*sizeof(G_vertex));
memcpy(newETemp, eTemp, (eMax+1)*sizeof(G_tempAttribute *));
free( eAttr ); ;
( eAttr )=( newEAttr ); ;
( eType )=( newEType ); ;
( nextGE )=( newNextGE ); ;
( nextE )=( newNextE ); ;
( node )=( newNode ); ;
( eTemp )=( newETemp ); ;
for (e=eMax+1; e<=eM; ++e)
{
eAttr[e]=0;
eType[e]=G_NotUsed;
nextGE[e]=e+1;
nextE[e]=nextE[-e]=0;
node[e]=node[-e]=0;
eTemp[e]=0;
}
( eMax )=( eM ); ;
result=1;
exit:
return result;
}
G_graph::G_graph(G_typeSystem *pTypeSys, unsigned vM, unsigned eM)
{
;
vMax=vM;
eMax=eM;
vCount=0;
eCount=0;
firstGE=lastGE=0;
pTypeSystem=pTypeSys;
if (!allocVPointers(vAttr, vType, nextGV, firstE, lastE, vTemp, vM, 0))
{
do
{
vMax/=2;
}
while (vMax && !allocVPointers(vAttr, vType, nextGV, firstE, lastE, vTemp, vMax, 0));
G_msg::error(22, "grf", "G_graph::G_graph(%u,%u)",
vM, eM, vMax);
}
for (G_vertex v=1; v<=vMax; ++v)
{
nextGV[v]=v+1;
firstE[v]=lastE[v]=0;
vType[v]=G_NotUsed;
vAttr[v]=0;
vTemp[v]=0;
};
firstFreeV=1;
firstGV=lastGV=0;
if (!allocEPointers(eAttr, eType, nextGE, nextE, node, eTemp, eM, 0))
{
do
{
eMax/=2;
}
while(eMax && !allocEPointers(eAttr, eType, nextGE, nextE, node, eTemp, eMax, 0));
G_msg::error(23, "grf", "G_graph::G_graph(%u,%u)",
vM, eM, eMax);
}
for (G_edge e=1; e<=eMax; ++e)
{
eAttr[e]=0;
eType[e]=G_NotUsed;
nextGE[e]=e+1;
nextE[e]=nextE[-e]=0;
node[e]=node[-e]=0;
eTemp[e]=0;
}
firstFreeE=1;
firstGE=lastGE=0;
vTempLayer=eTempLayer=0;
vTempLayerId=eTempLayerId=0;
uS=0;
;
}
G_graph::~G_graph()
{
;
G_vertex v;
G_edge e;
G_tempAttribute *pAttr, *h;
G_tempLayer *pL, *pL2;
if (uS)
{
uS->clear();
uS=0;
}
for (e=firstGE; e; e=nextGE[e])
{
if (eAttr[e])
{
eAttr[e]->logicalDelete();
delete eAttr[e];
}
for (pAttr=eTemp[e]; pAttr; pAttr=h)
{
h=pAttr->nextInStack;
if (pAttr->layerId>0)
pAttr->logicalDelete();
delete pAttr;
}
}
for (v=firstGV; v; v=nextGV[v])
{
if (vAttr[v])
{
vAttr[v]->logicalDelete();
delete vAttr[v];
}
for (pAttr=vTemp[v]; pAttr; pAttr=h)
{
h=pAttr->nextInStack;
if (pAttr->layerId>0)
pAttr->logicalDelete();
delete pAttr;
}
}
delete vAttr;
delete eAttr;
for (pL=vTempLayer; pL; pL=pL2)
{
pL2=pL->next;
delete pL;
}
for (pL=eTempLayer; pL; pL=pL2)
{
pL2=pL->next;
delete pL;
}
;
}
Thanks for the bug report.
The first problem is not a problem. This is described in great detail
in the gcc info files. gcc uses the extension of the filename to
determine what sort of file you're compiling -
.c "C" code
.cc "C++" code
.C "C++" code
.cxx "C++" code
.cpp" "C++" code
.i "C" preprocessed code
.ii "C++" preprocessed code
.s assembly code
.m "Objective C" code
.S assembly code which must be preprocessed
anything else is considered as a linkable file.
If you want to force a file to be considered as C++ use either the -x
c++ option or use g++ instead of gcc.
The second problem seems to be a problem with default arguments. I
don't know when at this stage it is likely to be fixed :-(
Regards,
Rohan
------------------------------------------------------------------------
Excerpts from BugReport.Gnu: 10-Jul-95 Comment bug and Internal Co..
be...@dbag.ulm.daimlerben (151569*)