public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* gcc-bug-report- Tuesday May 08 - Portugal
@ 2007-05-08  8:18 Miguel Luis
  0 siblings, 0 replies; only message in thread
From: Miguel Luis @ 2007-05-08  8:18 UTC (permalink / raw)
  To: gcc-bugs

[-- Attachment #1: Type: text/plain, Size: 3081 bytes --]

According to http://gcc.gnu.org/bugs.html here is what is requested for 
a bug report.
Regards,
Miguel Luis.

## the exact version of GCC;
$ gcc --version
gcc (GCC) 4.1.2 (Ubuntu 4.1.2-0ubuntu4)
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
$


## the system type;
$ uname -a
Linux m0x 2.6.20-15-386 #2 Sun Apr 15 07:34:00 UTC 2007 i686 GNU/Linux
$

## the options given when GCC was configured/built;
- Sorry but this is a binary package of gcc installed with 
build-essentials package in ubuntu and I don't know how to answer

## the complete command line that triggers the bug;
$gcc -v -save-temps -c -g -ansi -Wall -O3 system.c

## the compiler output (error messages, warnings, etc.);
$ make
gcc -v -save-temps -c -g -ansi -Wall -O3 system.c
Using built-in specs.
Target: i486-linux-gnu
Configured with: ../src/configure -v 
--enable-languages=c,c++,fortran,objc,obj-c++,treelang --prefix=/usr 
--enable-shared --with-system-zlib --libexecdir=/usr/lib 
--without-included-gettext --enable-threads=posix --enable-nls 
--program-suffix=-4.1 --enable-__cxa_atexit --enable-clocale=gnu 
--enable-libstdcxx-debug --enable-mpfr --enable-checking=release 
i486-linux-gnu
Thread model: posix
gcc version 4.1.2 (Ubuntu 4.1.2-0ubuntu4)
/usr/lib/gcc/i486-linux-gnu/4.1.2/cc1 -E -quiet -v system.c 
-mtune=generic -ansi -Wall -fworking-directory -O3 -fpch-preprocess -o 
system.i
ignoring nonexistent directory "/usr/local/include/i486-linux-gnu"
ignoring nonexistent directory 
"/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../i486-linux-gnu/include"
ignoring nonexistent directory "/usr/include/i486-linux-gnu"
#include "..." search starts here:
#include <...> search starts here:
/usr/local/include
/usr/lib/gcc/i486-linux-gnu/4.1.2/include
/usr/include
End of search list.
/usr/lib/gcc/i486-linux-gnu/4.1.2/cc1 -fpreprocessed system.i -quiet 
-dumpbase system.c -mtune=generic -ansi -auxbase system -g -O3 -Wall 
-ansi -version -fstack-protector -fstack-protector -o system.s
GNU C version 4.1.2 (Ubuntu 4.1.2-0ubuntu4) (i486-linux-gnu)
compiled by GNU C version 4.1.2 (Ubuntu 4.1.2-0ubuntu4).
GGC heuristics: --param ggc-min-expand=99 --param ggc-min-heapsize=129470
Compiler executable checksum: c0d954aeefbb96d795ff3f6b3b72ef51
system.c: In function ‘system_verbose’:
system.c:80: warning: implicit declaration of function 
‘get_item_id_max_lenght’
system.c:80: internal compiler error: in fold_convert, at fold-const.c:1956
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.
For Debian GNU/Linux specific bug reporting instructions,
see <URL:file:///usr/share/doc/gcc-4.1/README.Bugs>.
Preprocessed source stored into /tmp/ccWfv49C.out file, please attach 
this to your bugreport.
make: *** [system.o] Error 1
$

## the /preprocessed/ file (|*.i*|) that triggers the bug, generated by 
adding |-save-temps| to the complete compilation command


[-- Attachment #2: system.i --]
[-- Type: text/plain, Size: 52013 bytes --]

# 1 "system.c"
# 1 "/home/myk0n/symlink/xrtdb/current//"
# 1 "<built-in>"
# 1 "<command line>"
# 1 "system.c"
# 1 "/usr/include/stdio.h" 1 3 4
# 28 "/usr/include/stdio.h" 3 4
# 1 "/usr/include/features.h" 1 3 4
# 323 "/usr/include/features.h" 3 4
# 1 "/usr/include/sys/cdefs.h" 1 3 4
# 313 "/usr/include/sys/cdefs.h" 3 4
# 1 "/usr/include/bits/wordsize.h" 1 3 4
# 314 "/usr/include/sys/cdefs.h" 2 3 4
# 324 "/usr/include/features.h" 2 3 4
# 346 "/usr/include/features.h" 3 4
# 1 "/usr/include/gnu/stubs.h" 1 3 4



# 1 "/usr/include/bits/wordsize.h" 1 3 4
# 5 "/usr/include/gnu/stubs.h" 2 3 4


# 1 "/usr/include/gnu/stubs-32.h" 1 3 4
# 8 "/usr/include/gnu/stubs.h" 2 3 4
# 347 "/usr/include/features.h" 2 3 4
# 29 "/usr/include/stdio.h" 2 3 4





# 1 "/usr/lib/gcc/i486-linux-gnu/4.1.2/include/stddef.h" 1 3 4
# 214 "/usr/lib/gcc/i486-linux-gnu/4.1.2/include/stddef.h" 3 4
typedef unsigned int size_t;
# 35 "/usr/include/stdio.h" 2 3 4

# 1 "/usr/include/bits/types.h" 1 3 4
# 28 "/usr/include/bits/types.h" 3 4
# 1 "/usr/include/bits/wordsize.h" 1 3 4
# 29 "/usr/include/bits/types.h" 2 3 4


# 1 "/usr/lib/gcc/i486-linux-gnu/4.1.2/include/stddef.h" 1 3 4
# 32 "/usr/include/bits/types.h" 2 3 4


typedef unsigned char __u_char;
typedef unsigned short int __u_short;
typedef unsigned int __u_int;
typedef unsigned long int __u_long;


typedef signed char __int8_t;
typedef unsigned char __uint8_t;
typedef signed short int __int16_t;
typedef unsigned short int __uint16_t;
typedef signed int __int32_t;
typedef unsigned int __uint32_t;




__extension__ typedef signed long long int __int64_t;
__extension__ typedef unsigned long long int __uint64_t;







__extension__ typedef long long int __quad_t;
__extension__ typedef unsigned long long int __u_quad_t;
# 134 "/usr/include/bits/types.h" 3 4
# 1 "/usr/include/bits/typesizes.h" 1 3 4
# 135 "/usr/include/bits/types.h" 2 3 4


__extension__ typedef __u_quad_t __dev_t;
__extension__ typedef unsigned int __uid_t;
__extension__ typedef unsigned int __gid_t;
__extension__ typedef unsigned long int __ino_t;
__extension__ typedef __u_quad_t __ino64_t;
__extension__ typedef unsigned int __mode_t;
__extension__ typedef unsigned int __nlink_t;
__extension__ typedef long int __off_t;
__extension__ typedef __quad_t __off64_t;
__extension__ typedef int __pid_t;
__extension__ typedef struct { int __val[2]; } __fsid_t;
__extension__ typedef long int __clock_t;
__extension__ typedef unsigned long int __rlim_t;
__extension__ typedef __u_quad_t __rlim64_t;
__extension__ typedef unsigned int __id_t;
__extension__ typedef long int __time_t;
__extension__ typedef unsigned int __useconds_t;
__extension__ typedef long int __suseconds_t;

__extension__ typedef int __daddr_t;
__extension__ typedef long int __swblk_t;
__extension__ typedef int __key_t;


__extension__ typedef int __clockid_t;


__extension__ typedef void * __timer_t;


__extension__ typedef long int __blksize_t;




__extension__ typedef long int __blkcnt_t;
__extension__ typedef __quad_t __blkcnt64_t;


__extension__ typedef unsigned long int __fsblkcnt_t;
__extension__ typedef __u_quad_t __fsblkcnt64_t;


__extension__ typedef unsigned long int __fsfilcnt_t;
__extension__ typedef __u_quad_t __fsfilcnt64_t;

__extension__ typedef int __ssize_t;



typedef __off64_t __loff_t;
typedef __quad_t *__qaddr_t;
typedef char *__caddr_t;


__extension__ typedef int __intptr_t;


__extension__ typedef unsigned int __socklen_t;
# 37 "/usr/include/stdio.h" 2 3 4









typedef struct _IO_FILE FILE;

# 62 "/usr/include/stdio.h" 3 4
typedef struct _IO_FILE __FILE;
# 72 "/usr/include/stdio.h" 3 4
# 1 "/usr/include/libio.h" 1 3 4
# 32 "/usr/include/libio.h" 3 4
# 1 "/usr/include/_G_config.h" 1 3 4
# 14 "/usr/include/_G_config.h" 3 4
# 1 "/usr/lib/gcc/i486-linux-gnu/4.1.2/include/stddef.h" 1 3 4
# 326 "/usr/lib/gcc/i486-linux-gnu/4.1.2/include/stddef.h" 3 4
typedef int wchar_t;
# 355 "/usr/lib/gcc/i486-linux-gnu/4.1.2/include/stddef.h" 3 4
typedef unsigned int wint_t;
# 15 "/usr/include/_G_config.h" 2 3 4
# 24 "/usr/include/_G_config.h" 3 4
# 1 "/usr/include/wchar.h" 1 3 4
# 48 "/usr/include/wchar.h" 3 4
# 1 "/usr/lib/gcc/i486-linux-gnu/4.1.2/include/stddef.h" 1 3 4
# 49 "/usr/include/wchar.h" 2 3 4

# 1 "/usr/include/bits/wchar.h" 1 3 4
# 51 "/usr/include/wchar.h" 2 3 4
# 76 "/usr/include/wchar.h" 3 4
typedef struct
{
  int __count;
  union
  {
    wint_t __wch;
    char __wchb[4];
  } __value;
} __mbstate_t;
# 25 "/usr/include/_G_config.h" 2 3 4

typedef struct
{
  __off_t __pos;
  __mbstate_t __state;
} _G_fpos_t;
typedef struct
{
  __off64_t __pos;
  __mbstate_t __state;
} _G_fpos64_t;
# 44 "/usr/include/_G_config.h" 3 4
# 1 "/usr/include/gconv.h" 1 3 4
# 28 "/usr/include/gconv.h" 3 4
# 1 "/usr/include/wchar.h" 1 3 4
# 48 "/usr/include/wchar.h" 3 4
# 1 "/usr/lib/gcc/i486-linux-gnu/4.1.2/include/stddef.h" 1 3 4
# 49 "/usr/include/wchar.h" 2 3 4
# 29 "/usr/include/gconv.h" 2 3 4


# 1 "/usr/lib/gcc/i486-linux-gnu/4.1.2/include/stddef.h" 1 3 4
# 32 "/usr/include/gconv.h" 2 3 4





enum
{
  __GCONV_OK = 0,
  __GCONV_NOCONV,
  __GCONV_NODB,
  __GCONV_NOMEM,

  __GCONV_EMPTY_INPUT,
  __GCONV_FULL_OUTPUT,
  __GCONV_ILLEGAL_INPUT,
  __GCONV_INCOMPLETE_INPUT,

  __GCONV_ILLEGAL_DESCRIPTOR,
  __GCONV_INTERNAL_ERROR
};



enum
{
  __GCONV_IS_LAST = 0x0001,
  __GCONV_IGNORE_ERRORS = 0x0002
};



struct __gconv_step;
struct __gconv_step_data;
struct __gconv_loaded_object;
struct __gconv_trans_data;



typedef int (*__gconv_fct) (struct __gconv_step *, struct __gconv_step_data *,
       __const unsigned char **, __const unsigned char *,
       unsigned char **, size_t *, int, int);


typedef wint_t (*__gconv_btowc_fct) (struct __gconv_step *, unsigned char);


typedef int (*__gconv_init_fct) (struct __gconv_step *);
typedef void (*__gconv_end_fct) (struct __gconv_step *);



typedef int (*__gconv_trans_fct) (struct __gconv_step *,
      struct __gconv_step_data *, void *,
      __const unsigned char *,
      __const unsigned char **,
      __const unsigned char *, unsigned char **,
      size_t *);


typedef int (*__gconv_trans_context_fct) (void *, __const unsigned char *,
       __const unsigned char *,
       unsigned char *, unsigned char *);


typedef int (*__gconv_trans_query_fct) (__const char *, __const char ***,
     size_t *);


typedef int (*__gconv_trans_init_fct) (void **, const char *);
typedef void (*__gconv_trans_end_fct) (void *);

struct __gconv_trans_data
{

  __gconv_trans_fct __trans_fct;
  __gconv_trans_context_fct __trans_context_fct;
  __gconv_trans_end_fct __trans_end_fct;
  void *__data;
  struct __gconv_trans_data *__next;
};



struct __gconv_step
{
  struct __gconv_loaded_object *__shlib_handle;
  __const char *__modname;

  int __counter;

  char *__from_name;
  char *__to_name;

  __gconv_fct __fct;
  __gconv_btowc_fct __btowc_fct;
  __gconv_init_fct __init_fct;
  __gconv_end_fct __end_fct;



  int __min_needed_from;
  int __max_needed_from;
  int __min_needed_to;
  int __max_needed_to;


  int __stateful;

  void *__data;
};



struct __gconv_step_data
{
  unsigned char *__outbuf;
  unsigned char *__outbufend;



  int __flags;



  int __invocation_counter;



  int __internal_use;

  __mbstate_t *__statep;
  __mbstate_t __state;



  struct __gconv_trans_data *__trans;
};



typedef struct __gconv_info
{
  size_t __nsteps;
  struct __gconv_step *__steps;
  __extension__ struct __gconv_step_data __data [];
} *__gconv_t;
# 45 "/usr/include/_G_config.h" 2 3 4
typedef union
{
  struct __gconv_info __cd;
  struct
  {
    struct __gconv_info __cd;
    struct __gconv_step_data __data;
  } __combined;
} _G_iconv_t;

typedef int _G_int16_t __attribute__ ((__mode__ (__HI__)));
typedef int _G_int32_t __attribute__ ((__mode__ (__SI__)));
typedef unsigned int _G_uint16_t __attribute__ ((__mode__ (__HI__)));
typedef unsigned int _G_uint32_t __attribute__ ((__mode__ (__SI__)));
# 33 "/usr/include/libio.h" 2 3 4
# 53 "/usr/include/libio.h" 3 4
# 1 "/usr/lib/gcc/i486-linux-gnu/4.1.2/include/stdarg.h" 1 3 4
# 43 "/usr/lib/gcc/i486-linux-gnu/4.1.2/include/stdarg.h" 3 4
typedef __builtin_va_list __gnuc_va_list;
# 54 "/usr/include/libio.h" 2 3 4
# 166 "/usr/include/libio.h" 3 4
struct _IO_jump_t; struct _IO_FILE;
# 176 "/usr/include/libio.h" 3 4
typedef void _IO_lock_t;





struct _IO_marker {
  struct _IO_marker *_next;
  struct _IO_FILE *_sbuf;



  int _pos;
# 199 "/usr/include/libio.h" 3 4
};


enum __codecvt_result
{
  __codecvt_ok,
  __codecvt_partial,
  __codecvt_error,
  __codecvt_noconv
};
# 267 "/usr/include/libio.h" 3 4
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 _flags2;

  __off_t _old_offset;



  unsigned short _cur_column;
  signed char _vtable_offset;
  char _shortbuf[1];



  _IO_lock_t *_lock;
# 315 "/usr/include/libio.h" 3 4
  __off64_t _offset;
# 324 "/usr/include/libio.h" 3 4
  void *__pad1;
  void *__pad2;
  void *__pad3;
  void *__pad4;
  size_t __pad5;

  int _mode;

  char _unused2[15 * sizeof (int) - 4 * sizeof (void *) - sizeof (size_t)];

};


typedef struct _IO_FILE _IO_FILE;


struct _IO_FILE_plus;

extern struct _IO_FILE_plus _IO_2_1_stdin_;
extern struct _IO_FILE_plus _IO_2_1_stdout_;
extern struct _IO_FILE_plus _IO_2_1_stderr_;
# 360 "/usr/include/libio.h" 3 4
typedef __ssize_t __io_read_fn (void *__cookie, char *__buf, size_t __nbytes);







typedef __ssize_t __io_write_fn (void *__cookie, __const char *__buf,
     size_t __n);







typedef int __io_seek_fn (void *__cookie, __off64_t *__pos, int __w);


typedef int __io_close_fn (void *__cookie);
# 412 "/usr/include/libio.h" 3 4
extern int __underflow (_IO_FILE *) __attribute__ ((__nothrow__));
extern int __uflow (_IO_FILE *) __attribute__ ((__nothrow__));
extern int __overflow (_IO_FILE *, int) __attribute__ ((__nothrow__));
extern wint_t __wunderflow (_IO_FILE *) __attribute__ ((__nothrow__));
extern wint_t __wuflow (_IO_FILE *) __attribute__ ((__nothrow__));
extern wint_t __woverflow (_IO_FILE *, wint_t) __attribute__ ((__nothrow__));
# 450 "/usr/include/libio.h" 3 4
extern int _IO_getc (_IO_FILE *__fp) __attribute__ ((__nothrow__));
extern int _IO_putc (int __c, _IO_FILE *__fp) __attribute__ ((__nothrow__));
extern int _IO_feof (_IO_FILE *__fp) __attribute__ ((__nothrow__));
extern int _IO_ferror (_IO_FILE *__fp) __attribute__ ((__nothrow__));

extern int _IO_peekc_locked (_IO_FILE *__fp) __attribute__ ((__nothrow__));





extern void _IO_flockfile (_IO_FILE *) __attribute__ ((__nothrow__));
extern void _IO_funlockfile (_IO_FILE *) __attribute__ ((__nothrow__));
extern int _IO_ftrylockfile (_IO_FILE *) __attribute__ ((__nothrow__));
# 480 "/usr/include/libio.h" 3 4
extern int _IO_vfscanf (_IO_FILE * __restrict, const char * __restrict,
   __gnuc_va_list, int *__restrict);
extern int _IO_vfprintf (_IO_FILE *__restrict, const char *__restrict,
    __gnuc_va_list);
extern __ssize_t _IO_padn (_IO_FILE *, int, __ssize_t) __attribute__ ((__nothrow__));
extern size_t _IO_sgetn (_IO_FILE *, void *, size_t) __attribute__ ((__nothrow__));

extern __off64_t _IO_seekoff (_IO_FILE *, __off64_t, int, int) __attribute__ ((__nothrow__));
extern __off64_t _IO_seekpos (_IO_FILE *, __off64_t, int) __attribute__ ((__nothrow__));

extern void _IO_free_backup_area (_IO_FILE *) __attribute__ ((__nothrow__));
# 73 "/usr/include/stdio.h" 2 3 4
# 86 "/usr/include/stdio.h" 3 4


typedef _G_fpos_t fpos_t;




# 138 "/usr/include/stdio.h" 3 4
# 1 "/usr/include/bits/stdio_lim.h" 1 3 4
# 139 "/usr/include/stdio.h" 2 3 4



extern struct _IO_FILE *stdin;
extern struct _IO_FILE *stdout;
extern struct _IO_FILE *stderr;







extern int remove (__const char *__filename) __attribute__ ((__nothrow__));

extern int rename (__const char *__old, __const char *__new) __attribute__ ((__nothrow__));














extern FILE *tmpfile (void);
# 183 "/usr/include/stdio.h" 3 4
extern char *tmpnam (char *__s) __attribute__ ((__nothrow__));

# 206 "/usr/include/stdio.h" 3 4





extern int fclose (FILE *__stream);




extern int fflush (FILE *__stream);

# 240 "/usr/include/stdio.h" 3 4






extern FILE *fopen (__const char *__restrict __filename,
      __const char *__restrict __modes);




extern FILE *freopen (__const char *__restrict __filename,
        __const char *__restrict __modes,
        FILE *__restrict __stream);
# 267 "/usr/include/stdio.h" 3 4

# 298 "/usr/include/stdio.h" 3 4



extern void setbuf (FILE *__restrict __stream, char *__restrict __buf) __attribute__ ((__nothrow__));



extern int setvbuf (FILE *__restrict __stream, char *__restrict __buf,
      int __modes, size_t __n) __attribute__ ((__nothrow__));

# 320 "/usr/include/stdio.h" 3 4





extern int fprintf (FILE *__restrict __stream,
      __const char *__restrict __format, ...);




extern int printf (__const char *__restrict __format, ...);

extern int sprintf (char *__restrict __s,
      __const char *__restrict __format, ...) __attribute__ ((__nothrow__));





extern int vfprintf (FILE *__restrict __s, __const char *__restrict __format,
       __gnuc_va_list __arg);




extern int vprintf (__const char *__restrict __format, __gnuc_va_list __arg);

extern int vsprintf (char *__restrict __s, __const char *__restrict __format,
       __gnuc_va_list __arg) __attribute__ ((__nothrow__));

# 392 "/usr/include/stdio.h" 3 4





extern int fscanf (FILE *__restrict __stream,
     __const char *__restrict __format, ...) ;




extern int scanf (__const char *__restrict __format, ...) ;

extern int sscanf (__const char *__restrict __s,
     __const char *__restrict __format, ...) __attribute__ ((__nothrow__));

# 434 "/usr/include/stdio.h" 3 4





extern int fgetc (FILE *__stream);
extern int getc (FILE *__stream);





extern int getchar (void);

# 473 "/usr/include/stdio.h" 3 4








extern int fputc (int __c, FILE *__stream);
extern int putc (int __c, FILE *__stream);





extern int putchar (int __c);

# 525 "/usr/include/stdio.h" 3 4





extern char *fgets (char *__restrict __s, int __n, FILE *__restrict __stream)
     ;






extern char *gets (char *__s) ;

# 583 "/usr/include/stdio.h" 3 4





extern int fputs (__const char *__restrict __s, FILE *__restrict __stream);





extern int puts (__const char *__s);






extern int ungetc (int __c, FILE *__stream);






extern size_t fread (void *__restrict __ptr, size_t __size,
       size_t __n, FILE *__restrict __stream) ;




extern size_t fwrite (__const void *__restrict __ptr, size_t __size,
        size_t __n, FILE *__restrict __s) ;

# 643 "/usr/include/stdio.h" 3 4





extern int fseek (FILE *__stream, long int __off, int __whence);




extern long int ftell (FILE *__stream) ;




extern void rewind (FILE *__stream);

# 691 "/usr/include/stdio.h" 3 4






extern int fgetpos (FILE *__restrict __stream, fpos_t *__restrict __pos);




extern int fsetpos (FILE *__stream, __const fpos_t *__pos);
# 714 "/usr/include/stdio.h" 3 4

# 723 "/usr/include/stdio.h" 3 4


extern void clearerr (FILE *__stream) __attribute__ ((__nothrow__));

extern int feof (FILE *__stream) __attribute__ ((__nothrow__)) ;

extern int ferror (FILE *__stream) __attribute__ ((__nothrow__)) ;

# 740 "/usr/include/stdio.h" 3 4





extern void perror (__const char *__s);






# 1 "/usr/include/bits/sys_errlist.h" 1 3 4
# 753 "/usr/include/stdio.h" 2 3 4
# 833 "/usr/include/stdio.h" 3 4
# 1 "/usr/include/bits/stdio.h" 1 3 4
# 33 "/usr/include/bits/stdio.h" 3 4
extern __inline int
vprintf (__const char *__restrict __fmt, __gnuc_va_list __arg)
{
  return vfprintf (stdout, __fmt, __arg);
}


extern __inline int
getchar (void)
{
  return _IO_getc (stdin);
}
# 65 "/usr/include/bits/stdio.h" 3 4
extern __inline int
putchar (int __c)
{
  return _IO_putc (__c, stdout);
}
# 834 "/usr/include/stdio.h" 2 3 4
# 842 "/usr/include/stdio.h" 3 4

# 2 "system.c" 2
# 1 "/usr/include/stdlib.h" 1 3 4
# 33 "/usr/include/stdlib.h" 3 4
# 1 "/usr/lib/gcc/i486-linux-gnu/4.1.2/include/stddef.h" 1 3 4
# 34 "/usr/include/stdlib.h" 2 3 4


# 96 "/usr/include/stdlib.h" 3 4


typedef struct
  {
    int quot;
    int rem;
  } div_t;



typedef struct
  {
    long int quot;
    long int rem;
  } ldiv_t;



# 140 "/usr/include/stdlib.h" 3 4
extern size_t __ctype_get_mb_cur_max (void) __attribute__ ((__nothrow__)) ;




extern double atof (__const char *__nptr)
     __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;

extern int atoi (__const char *__nptr)
     __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;

extern long int atol (__const char *__nptr)
     __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;

# 163 "/usr/include/stdlib.h" 3 4


extern double strtod (__const char *__restrict __nptr,
        char **__restrict __endptr)
     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ;

# 182 "/usr/include/stdlib.h" 3 4


extern long int strtol (__const char *__restrict __nptr,
   char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ;

extern unsigned long int strtoul (__const char *__restrict __nptr,
      char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ;

# 279 "/usr/include/stdlib.h" 3 4
extern double __strtod_internal (__const char *__restrict __nptr,
     char **__restrict __endptr, int __group)
     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ;
extern float __strtof_internal (__const char *__restrict __nptr,
    char **__restrict __endptr, int __group)
     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ;
extern long double __strtold_internal (__const char *__restrict __nptr,
           char **__restrict __endptr,
           int __group)
     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ;

extern long int __strtol_internal (__const char *__restrict __nptr,
       char **__restrict __endptr,
       int __base, int __group)
     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ;



extern unsigned long int __strtoul_internal (__const char *__restrict __nptr,
          char **__restrict __endptr,
          int __base, int __group)
     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ;




__extension__
extern long long int __strtoll_internal (__const char *__restrict __nptr,
      char **__restrict __endptr,
      int __base, int __group)
     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ;



__extension__
extern unsigned long long int __strtoull_internal (__const char *
         __restrict __nptr,
         char **__restrict __endptr,
         int __base, int __group)
     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ;








extern __inline double
__attribute__ ((__nothrow__)) strtod (__const char *__restrict __nptr, char **__restrict __endptr)
{
  return __strtod_internal (__nptr, __endptr, 0);
}
extern __inline long int
__attribute__ ((__nothrow__)) strtol (__const char *__restrict __nptr, char **__restrict __endptr, int __base)

{
  return __strtol_internal (__nptr, __endptr, __base, 0);
}
extern __inline unsigned long int
__attribute__ ((__nothrow__)) strtoul (__const char *__restrict __nptr, char **__restrict __endptr, int __base)

{
  return __strtoul_internal (__nptr, __endptr, __base, 0);
}

# 395 "/usr/include/stdlib.h" 3 4

extern __inline double
__attribute__ ((__nothrow__)) atof (__const char *__nptr)
{
  return strtod (__nptr, (char **) ((void *)0));
}
extern __inline int
__attribute__ ((__nothrow__)) atoi (__const char *__nptr)
{
  return (int) strtol (__nptr, (char **) ((void *)0), 10);
}
extern __inline long int
__attribute__ ((__nothrow__)) atol (__const char *__nptr)
{
  return strtol (__nptr, (char **) ((void *)0), 10);
}

# 496 "/usr/include/stdlib.h" 3 4


extern int rand (void) __attribute__ ((__nothrow__));

extern void srand (unsigned int __seed) __attribute__ ((__nothrow__));

# 587 "/usr/include/stdlib.h" 3 4


extern void *malloc (size_t __size) __attribute__ ((__nothrow__)) __attribute__ ((__malloc__)) ;

extern void *calloc (size_t __nmemb, size_t __size)
     __attribute__ ((__nothrow__)) __attribute__ ((__malloc__)) ;







extern void *realloc (void *__ptr, size_t __size)
     __attribute__ ((__nothrow__)) __attribute__ ((__malloc__)) __attribute__ ((__warn_unused_result__));

extern void free (void *__ptr) __attribute__ ((__nothrow__));

# 626 "/usr/include/stdlib.h" 3 4


extern void abort (void) __attribute__ ((__nothrow__)) __attribute__ ((__noreturn__));



extern int atexit (void (*__func) (void)) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));

# 642 "/usr/include/stdlib.h" 3 4




extern void exit (int __status) __attribute__ ((__nothrow__)) __attribute__ ((__noreturn__));

# 658 "/usr/include/stdlib.h" 3 4


extern char *getenv (__const char *__name) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ;




extern char *__secure_getenv (__const char *__name)
     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ;
# 733 "/usr/include/stdlib.h" 3 4





extern int system (__const char *__command) ;

# 765 "/usr/include/stdlib.h" 3 4
typedef int (*__compar_fn_t) (__const void *, __const void *);









extern void *bsearch (__const void *__key, __const void *__base,
        size_t __nmemb, size_t __size, __compar_fn_t __compar)
     __attribute__ ((__nonnull__ (1, 2, 5))) ;



extern void qsort (void *__base, size_t __nmemb, size_t __size,
     __compar_fn_t __compar) __attribute__ ((__nonnull__ (1, 4)));



extern int abs (int __x) __attribute__ ((__nothrow__)) __attribute__ ((__const__)) ;
extern long int labs (long int __x) __attribute__ ((__nothrow__)) __attribute__ ((__const__)) ;












extern div_t div (int __numer, int __denom)
     __attribute__ ((__nothrow__)) __attribute__ ((__const__)) ;
extern ldiv_t ldiv (long int __numer, long int __denom)
     __attribute__ ((__nothrow__)) __attribute__ ((__const__)) ;

# 871 "/usr/include/stdlib.h" 3 4



extern int mblen (__const char *__s, size_t __n) __attribute__ ((__nothrow__)) ;


extern int mbtowc (wchar_t *__restrict __pwc,
     __const char *__restrict __s, size_t __n) __attribute__ ((__nothrow__)) ;


extern int wctomb (char *__s, wchar_t __wchar) __attribute__ ((__nothrow__)) ;



extern size_t mbstowcs (wchar_t *__restrict __pwcs,
   __const char *__restrict __s, size_t __n) __attribute__ ((__nothrow__));

extern size_t wcstombs (char *__restrict __s,
   __const wchar_t *__restrict __pwcs, size_t __n)
     __attribute__ ((__nothrow__));

# 978 "/usr/include/stdlib.h" 3 4

# 3 "system.c" 2

# 1 "/usr/include/string.h" 1 3 4
# 28 "/usr/include/string.h" 3 4





# 1 "/usr/lib/gcc/i486-linux-gnu/4.1.2/include/stddef.h" 1 3 4
# 34 "/usr/include/string.h" 2 3 4




extern void *memcpy (void *__restrict __dest,
       __const void *__restrict __src, size_t __n)
     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));


extern void *memmove (void *__dest, __const void *__src, size_t __n)
     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));

# 57 "/usr/include/string.h" 3 4


extern void *memset (void *__s, int __c, size_t __n) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));


extern int memcmp (__const void *__s1, __const void *__s2, size_t __n)
     __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));


extern void *memchr (__const void *__s, int __c, size_t __n)
      __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));

# 82 "/usr/include/string.h" 3 4


extern char *strcpy (char *__restrict __dest, __const char *__restrict __src)
     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));

extern char *strncpy (char *__restrict __dest,
        __const char *__restrict __src, size_t __n)
     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));


extern char *strcat (char *__restrict __dest, __const char *__restrict __src)
     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));

extern char *strncat (char *__restrict __dest, __const char *__restrict __src,
        size_t __n) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));


extern int strcmp (__const char *__s1, __const char *__s2)
     __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));

extern int strncmp (__const char *__s1, __const char *__s2, size_t __n)
     __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));


extern int strcoll (__const char *__s1, __const char *__s2)
     __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));

extern size_t strxfrm (char *__restrict __dest,
         __const char *__restrict __src, size_t __n)
     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2)));

# 165 "/usr/include/string.h" 3 4


extern char *strchr (__const char *__s, int __c)
     __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));

extern char *strrchr (__const char *__s, int __c)
     __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));

# 181 "/usr/include/string.h" 3 4



extern size_t strcspn (__const char *__s, __const char *__reject)
     __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));


extern size_t strspn (__const char *__s, __const char *__accept)
     __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));

extern char *strpbrk (__const char *__s, __const char *__accept)
     __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));

extern char *strstr (__const char *__haystack, __const char *__needle)
     __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));



extern char *strtok (char *__restrict __s, __const char *__restrict __delim)
     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2)));




extern char *__strtok_r (char *__restrict __s,
    __const char *__restrict __delim,
    char **__restrict __save_ptr)
     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2, 3)));
# 240 "/usr/include/string.h" 3 4


extern size_t strlen (__const char *__s)
     __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));

# 254 "/usr/include/string.h" 3 4


extern char *strerror (int __errnum) __attribute__ ((__nothrow__));

# 288 "/usr/include/string.h" 3 4
extern void __bzero (void *__s, size_t __n) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
# 414 "/usr/include/string.h" 3 4
# 1 "/usr/include/bits/string.h" 1 3 4
# 415 "/usr/include/string.h" 2 3 4


# 1 "/usr/include/bits/string2.h" 1 3 4
# 52 "/usr/include/bits/string2.h" 3 4
# 1 "/usr/include/endian.h" 1 3 4
# 37 "/usr/include/endian.h" 3 4
# 1 "/usr/include/bits/endian.h" 1 3 4
# 38 "/usr/include/endian.h" 2 3 4
# 53 "/usr/include/bits/string2.h" 2 3 4
# 394 "/usr/include/bits/string2.h" 3 4
extern void *__rawmemchr (const void *__s, int __c);
# 969 "/usr/include/bits/string2.h" 3 4
extern __inline size_t __strcspn_c1 (__const char *__s, int __reject);
extern __inline size_t
__strcspn_c1 (__const char *__s, int __reject)
{
  register size_t __result = 0;
  while (__s[__result] != '\0' && __s[__result] != __reject)
    ++__result;
  return __result;
}

extern __inline size_t __strcspn_c2 (__const char *__s, int __reject1,
         int __reject2);
extern __inline size_t
__strcspn_c2 (__const char *__s, int __reject1, int __reject2)
{
  register size_t __result = 0;
  while (__s[__result] != '\0' && __s[__result] != __reject1
  && __s[__result] != __reject2)
    ++__result;
  return __result;
}

extern __inline size_t __strcspn_c3 (__const char *__s, int __reject1,
         int __reject2, int __reject3);
extern __inline size_t
__strcspn_c3 (__const char *__s, int __reject1, int __reject2,
       int __reject3)
{
  register size_t __result = 0;
  while (__s[__result] != '\0' && __s[__result] != __reject1
  && __s[__result] != __reject2 && __s[__result] != __reject3)
    ++__result;
  return __result;
}
# 1045 "/usr/include/bits/string2.h" 3 4
extern __inline size_t __strspn_c1 (__const char *__s, int __accept);
extern __inline size_t
__strspn_c1 (__const char *__s, int __accept)
{
  register size_t __result = 0;

  while (__s[__result] == __accept)
    ++__result;
  return __result;
}

extern __inline size_t __strspn_c2 (__const char *__s, int __accept1,
        int __accept2);
extern __inline size_t
__strspn_c2 (__const char *__s, int __accept1, int __accept2)
{
  register size_t __result = 0;

  while (__s[__result] == __accept1 || __s[__result] == __accept2)
    ++__result;
  return __result;
}

extern __inline size_t __strspn_c3 (__const char *__s, int __accept1,
        int __accept2, int __accept3);
extern __inline size_t
__strspn_c3 (__const char *__s, int __accept1, int __accept2, int __accept3)
{
  register size_t __result = 0;

  while (__s[__result] == __accept1 || __s[__result] == __accept2
  || __s[__result] == __accept3)
    ++__result;
  return __result;
}
# 1121 "/usr/include/bits/string2.h" 3 4
extern __inline char *__strpbrk_c2 (__const char *__s, int __accept1,
         int __accept2);
extern __inline char *
__strpbrk_c2 (__const char *__s, int __accept1, int __accept2)
{

  while (*__s != '\0' && *__s != __accept1 && *__s != __accept2)
    ++__s;
  return *__s == '\0' ? ((void *)0) : (char *) (size_t) __s;
}

extern __inline char *__strpbrk_c3 (__const char *__s, int __accept1,
         int __accept2, int __accept3);
extern __inline char *
__strpbrk_c3 (__const char *__s, int __accept1, int __accept2,
       int __accept3)
{

  while (*__s != '\0' && *__s != __accept1 && *__s != __accept2
  && *__s != __accept3)
    ++__s;
  return *__s == '\0' ? ((void *)0) : (char *) (size_t) __s;
}
# 1173 "/usr/include/bits/string2.h" 3 4
extern __inline char *__strtok_r_1c (char *__s, char __sep, char **__nextp);
extern __inline char *
__strtok_r_1c (char *__s, char __sep, char **__nextp)
{
  char *__result;
  if (__s == ((void *)0))
    __s = *__nextp;
  while (*__s == __sep)
    ++__s;
  __result = ((void *)0);
  if (*__s != '\0')
    {
      __result = __s++;
      while (*__s != '\0')
 if (*__s++ == __sep)
   {
     __s[-1] = '\0';
     break;
   }
      *__nextp = __s;
    }
  return __result;
}
# 1205 "/usr/include/bits/string2.h" 3 4
extern char *__strsep_g (char **__stringp, __const char *__delim);
# 1223 "/usr/include/bits/string2.h" 3 4
extern __inline char *__strsep_1c (char **__s, char __reject);
extern __inline char *
__strsep_1c (char **__s, char __reject)
{
  register char *__retval = *__s;
  if (__retval != ((void *)0) && (*__s = (__extension__ (__builtin_constant_p (__reject) && !__builtin_constant_p (__retval) && (__reject) == '\0' ? (char *) __rawmemchr (__retval, __reject) : __builtin_strchr (__retval, __reject)))) != ((void *)0))
    *(*__s)++ = '\0';
  return __retval;
}

extern __inline char *__strsep_2c (char **__s, char __reject1, char __reject2);
extern __inline char *
__strsep_2c (char **__s, char __reject1, char __reject2)
{
  register char *__retval = *__s;
  if (__retval != ((void *)0))
    {
      register char *__cp = __retval;
      while (1)
 {
   if (*__cp == '\0')
     {
       __cp = ((void *)0);
   break;
     }
   if (*__cp == __reject1 || *__cp == __reject2)
     {
       *__cp++ = '\0';
       break;
     }
   ++__cp;
 }
      *__s = __cp;
    }
  return __retval;
}

extern __inline char *__strsep_3c (char **__s, char __reject1, char __reject2,
       char __reject3);
extern __inline char *
__strsep_3c (char **__s, char __reject1, char __reject2, char __reject3)
{
  register char *__retval = *__s;
  if (__retval != ((void *)0))
    {
      register char *__cp = __retval;
      while (1)
 {
   if (*__cp == '\0')
     {
       __cp = ((void *)0);
   break;
     }
   if (*__cp == __reject1 || *__cp == __reject2 || *__cp == __reject3)
     {
       *__cp++ = '\0';
       break;
     }
   ++__cp;
 }
      *__s = __cp;
    }
  return __retval;
}
# 418 "/usr/include/string.h" 2 3 4
# 426 "/usr/include/string.h" 3 4

# 5 "system.c" 2
# 1 "system.h" 1



# 1 "TAgentList.h" 1



extern char *program_name;
extern int warnmode;
extern int hintmode;

extern char *yytext;
extern int yylineno;
extern int yycolno;

typedef struct _TAgentList TAgentList;

struct _TAgentList {
  char **list;
  int num;
};

void reset_agentlist(TAgentList *);
int is_agent(const TAgentList *const, const char *const);
int add_agent(TAgentList *, const char *const);
# 5 "system.h" 2
# 1 "TItemList.h" 1





extern char *program_name;
extern int warnmode;
extern int hintmode;

extern char *yytext;
extern int yylineno;
extern int yycolno;

typedef struct _TItem TItem;
typedef struct _TItemList TItemList;

struct _TItem {
  char *id,
        *datatype,
        *period,
        *headerfile;
};

struct _TItemList {
  TItem **list;
  int num;
};

int is_item(const TItemList const *itemlist, const TItem const *item);
TItem * new_item (void);
void reset_itemlist (TItemList *);
void reset_item (TItem *);
int save_item (TItemList *, TItem *);
int save_item_id (TItem *, const char *const);
int save_item_datatype (TItem *, const char *const);
int save_item_period (TItem *, const char *const);
int save_item_headerfile (TItem *, const char *const);
# 6 "system.h" 2
# 1 "TSchemaList.h" 1



extern char *program_name;
extern int warnmode;
extern int hintmode;

extern char *yytext;
extern int yylineno;
extern int yycolno;

typedef struct _TSchema TSchema;
typedef struct _TSchemaList TSchemaList;

struct _TSchema {
  char *id;
  char **locallist;
  char **sharedlist;
  char **agentlist;
  int numlocal;
  int numshared;
  int numagents;
};

struct _TSchemaList {
  TSchema **list;
  int num;
};

TSchema * new_schema (void);
void reset_schema (TSchema *);
void reset_schemalist (TSchemaList *);
int save_schema (TSchemaList *, TSchema *);
int save_schema_id (TSchema *,const char const *);
int add_schema_local (TSchema *,const char const *);
int add_schema_shared (TSchema *,const char const *);
int add_schema_agent (TSchema *,const char const *);
# 7 "system.h" 2
# 29 "system.h"
extern char *program_name;
extern int warnmode;
extern int hintmode;
extern int verbose;

extern char *yytext;
extern int yylineno;
extern int yycolno;
extern int yyleng;

extern TAgentList agentlist;
extern TItemList itemlist;
extern TSchemaList schemalist;
extern TItem *currentitem;
extern TSchema *currentschema;

typedef struct _AgentInfo AgentInfo;

struct _AgentInfo{
  int num;
  int schema;
};

static
const char * const
xrtdbkeywords[] = { "AGENTS","ITEM","SCHEMA", "id",
                    "datatype", "period", "headerfile",
                    "shared", "local", "agents" };

void system_init(void);
void system_verbose(void);
void update_yycolno(void);
void yes_user_needs_help(int);
int get_maxleng(char**, int);
int is_keyword(const char * const);
char *string_assign(const char const*);
AgentInfo agent_is_unique(char*, TSchemaList* );
int make_h(TAgentList*, TItemList* );
int make_ini(TAgentList*, TItemList*, TSchemaList*);
# 6 "system.c" 2
# 1 "error.h" 1
# 53 "error.h"
extern int errormode;
extern int warnmode;
extern int hintmode;
extern int errorsfound;

void error (int line, int col, const char* const , const char* const , const char* const );
void warn (int line, int col, const char* const , const char* const , const char* const );
void hint (int line, int col, const char* const , const char* const , const char* const );
# 7 "system.c" 2

void system_init(void)
{
  reset_agentlist(&agentlist);
  reset_itemlist(&itemlist);
  reset_schemalist(&schemalist);

  currentitem = new_item();
  reset_item(currentitem);

  currentschema = new_schema();
  reset_schema(currentschema);
}

void yes_user_needs_help(int n)
{
    fprintf(stderr, "Usage: %s [OPTION]... [FILE_CONF]\n", program_name);
  if(n < 2){
    fprintf(stderr, "Try `%s -h' for more information.\n", program_name);
  }
  if(n > 1){
    printf("Example: %s -wn rtdb.conf\n\nOptions:\n -w Display some warnings\n -n Display some hints\n -f Same as -wn -h This help text\n -q force to don't output unless more flags \n"
# 37 "system.c"
   ,program_name);
 }
}


int get_maxleng(char **str, int num)
{
  int i = 0, leng = 0;
  while( i < num ){
    if (leng < strlen(*str)) leng = strlen(*str);
    ++str;
    ++i;
  }
  return leng;
}


void system_verbose (void)
{
if (verbose == 1){


  printf("[+] AGENTS\n");
  int i=0;
  while(i< agentlist.num)
    { printf(" | %s\n",agentlist.list[i]); ++i; }
  printf("  `");

  i = get_maxleng(agentlist.list, agentlist.num);
  while(i!=1)
    { printf("-"); --i; }

  i=0;
  while(i< agentlist.num) ++i;
  printf(" [%d]\n",i);


  printf("\n[%d] ITEMS\n",i);
  i=0;
  while(i< itemlist.num)
    { printf(" | %s\n",itemlist.list[i]->id); ++i; }
  printf("  `");

  i = get_item_id_max_lenght(itemlist);
  while(i!=1)
    { printf("-"); --i; }

  i=0;
  while(i< itemlist.num) ++i;
  printf(" [%d]\n",i);


  while(i< schemalist.num) ++i;
  printf("\n[%d] SCHEMAS\n",i);
  i=0;
  while(i< schemalist.num)
  { printf(" | %s\n",schemalist.list[i]->id); ++i; }
}
}


int get_item_id_max_lenght(TItemList *itemlist)
{
  int i=0;
  int ret=0;
  while( i < (itemlist->num) ){
    if (ret < strlen((itemlist->list)[i]->id))
      ret = strlen((itemlist->list)[i]->id);
    ++i;
  }
  if (ret == 0) exit(-9);
  return (ret);
}

int get_agent_max_lenght(TAgentList *agentlist)
{
  int i=0;
  int ret=0;
  while( i < (agentlist->num) ){
    if (ret < strlen(agentlist->list[i]))
      ret = strlen(agentlist->list[i]);
    ++i;
  }
  if (ret == 0) exit(-9);
  return (ret);
}


int make_h(TAgentList *agentlist, TItemList *itemlist)
{
  FILE *out = 0;

  if(!(out = fopen("rtdb_user.h", "w"))){
    fprintf(stderr, "%s: cannot open file %s for write\n",
            program_name, "rtdb_user.h");
    return (-1);
  }

  fprintf(out, "/*AUTOGEN FILE : %s */\n\n#ifndef _CAMBADA_RTDB_USER_\n#define _CAMBADA_RTDB_USER_\n\n/* agents section */\n\n", "rtdb_user.h");

  int max_strlght = get_agent_max_lenght(agentlist);
  int spaces = 0;
  int i=0;
  while (i < (agentlist->num)){
    fprintf(out, "#define %s", (agentlist->list)[i]);
    spaces = (max_strlght - strlen((agentlist->list)[i]));
    while (spaces+2){ fprintf(out,(" ")); spaces--; }
    fprintf(out, "%d\n", i);
    ++i;
  }
  fprintf(out, "\n#define %s", "N_AGENTS");
  spaces = (max_strlght - strlen("N_AGENTS"));
  while (spaces+2){ fprintf(out, " "); spaces--; }
  fprintf(out, "%d\n\n", agentlist->num);

  fprintf(out, "/* items section */\n\n");

  max_strlght = get_item_id_max_lenght(itemlist);
  spaces = 0;
  i = 0;
  while(i < (itemlist->num)) {
    fprintf(out, "#define %s", (itemlist->list)[i]->id);
    spaces = (max_strlght - strlen((itemlist->list)[i]->id));
    while (spaces+2){ fprintf(out, " "); spaces--; }
    fprintf(out, "%d\n", i);
    ++i;
  }
  fprintf(out, "\n#define %s", "N_ITEMS");
  spaces = (max_strlght - strlen("N_ITEMS"));
  while(spaces+2) { fprintf(out, " "); spaces--; }
  fprintf(out, "%d\n\n", itemlist->num);

  fprintf(out, "/* EOF : %s */", "rtdb_user.h");

  fclose(out);
  return (0);
}


AgentInfo agent_is_unique(char *agentname, TSchemaList *schemalist)
{
  AgentInfo ag;
  ag.num = 0;
  ag.schema = 0;
  int save = 1;
  int b = 0;
  int k = 0;
  while(b < (schemalist->num)){
    while (k < (schemalist->list[b]->numagents)){
      if (0 == __extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p (agentname) && __builtin_constant_p (schemalist->list[b]->agentlist[k]) && (__s1_len = strlen (agentname), __s2_len = strlen (schemalist->list[b]->agentlist[k]), (!((size_t)(const void *)((agentname) + 1) - (size_t)(const void *)(agentname) == 1) || __s1_len >= 4) && (!((size_t)(const void *)((schemalist->list[b]->agentlist[k]) + 1) - (size_t)(const void *)(schemalist->list[b]->agentlist[k]) == 1) || __s2_len >= 4)) ? __builtin_strcmp (agentname, schemalist->list[b]->agentlist[k]) : (__builtin_constant_p (agentname) && ((size_t)(const void *)((agentname) + 1) - (size_t)(const void *)(agentname) == 1) && (__s1_len = strlen (agentname), __s1_len < 4) ? (__builtin_constant_p (schemalist->list[b]->agentlist[k]) && ((size_t)(const void *)((schemalist->list[b]->agentlist[k]) + 1) - (size_t)(const void *)(schemalist->list[b]->agentlist[k]) == 1) ? __builtin_strcmp (agentname, schemalist->list[b]->agentlist[k]) : (__extension__ ({ __const unsigned char *__s2 = (__const unsigned char *) (__const char *) (schemalist->list[b]->agentlist[k]); register int __result = (((__const unsigned char *) (__const char *) (agentname))[0] - __s2[0]); if (__s1_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (agentname))[1] - __s2[1]); if (__s1_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (agentname))[2] - __s2[2]); if (__s1_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) (agentname))[3] - __s2[3]); } } __result; }))) : (__builtin_constant_p (schemalist->list[b]->agentlist[k]) && ((size_t)(const void *)((schemalist->list[b]->agentlist[k]) + 1) - (size_t)(const void *)(schemalist->list[b]->agentlist[k]) == 1) && (__s2_len = strlen (schemalist->list[b]->agentlist[k]), __s2_len < 4) ? (__builtin_constant_p (agentname) && ((size_t)(const void *)((agentname) + 1) - (size_t)(const void *)(agentname) == 1) ? __builtin_strcmp (agentname, schemalist->list[b]->agentlist[k]) : (__extension__ ({ __const unsigned char *__s1 = (__const unsigned char *) (__const char *) (agentname); register int __result = __s1[0] - ((__const unsigned char *) (__const char *) (schemalist->list[b]->agentlist[k]))[0]; if (__s2_len > 0 && __result == 0) { __result = (__s1[1] - ((__const unsigned char *) (__const char *) (schemalist->list[b]->agentlist[k]))[1]); if (__s2_len > 1 && __result == 0) { __result = (__s1[2] - ((__const unsigned char *) (__const char *) (schemalist->list[b]->agentlist[k]))[2]); if (__s2_len > 2 && __result == 0) __result = (__s1[3] - ((__const unsigned char *) (__const char *) (schemalist->list[b]->agentlist[k]))[3]); } } __result; }))) : __builtin_strcmp (agentname, schemalist->list[b]->agentlist[k])))); })){
        if(save) ag.schema = b;
        save = 0;
        ++(ag.num);
      }
      ++k;
    }
    ++b;
  }
  if(ag.num > 1){
    error(0, 0, "multiple schemas for agent `", agentname, "'");
    hint(0, 0, "make sure agent is associated with only one schema", "", "");
  }
  return (ag);
}


int make_ini(TAgentList* agentlist, TItemList* itemlist, TSchemaList* schemalist)
{
  FILE *out = 0;

  if(!(out = fopen("rtdb.ini", "w"))){
    fprintf(stderr, "%s: cannot open file %s for write\n",
            program_name, "rtdb.ini");
    return (-13);
  }

  AgentInfo ag;
  int k;
  int j;
  int i=0;
  while(i < (agentlist->num)){
    fprintf(out, "#%d %s\n", i,(agentlist->list)[i]);
    ag = agent_is_unique((agentlist->list)[i], schemalist);
    if( ag.num ) {
      j=0;
      while(j < (schemalist->list[ag.schema]->numshared)){
        k=0;
        while(k < (itemlist->num)){
          if ( 0 == __extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p (itemlist->list[k]->id) && __builtin_constant_p (schemalist->list[ag.schema]->sharedlist[j]) && (__s1_len = strlen (itemlist->list[k]->id), __s2_len = strlen (schemalist->list[ag.schema]->sharedlist[j]), (!((size_t)(const void *)((itemlist->list[k]->id) + 1) - (size_t)(const void *)(itemlist->list[k]->id) == 1) || __s1_len >= 4) && (!((size_t)(const void *)((schemalist->list[ag.schema]->sharedlist[j]) + 1) - (size_t)(const void *)(schemalist->list[ag.schema]->sharedlist[j]) == 1) || __s2_len >= 4)) ? __builtin_strcmp (itemlist->list[k]->id, schemalist->list[ag.schema]->sharedlist[j]) : (__builtin_constant_p (itemlist->list[k]->id) && ((size_t)(const void *)((itemlist->list[k]->id) + 1) - (size_t)(const void *)(itemlist->list[k]->id) == 1) && (__s1_len = strlen (itemlist->list[k]->id), __s1_len < 4) ? (__builtin_constant_p (schemalist->list[ag.schema]->sharedlist[j]) && ((size_t)(const void *)((schemalist->list[ag.schema]->sharedlist[j]) + 1) - (size_t)(const void *)(schemalist->list[ag.schema]->sharedlist[j]) == 1) ? __builtin_strcmp (itemlist->list[k]->id, schemalist->list[ag.schema]->sharedlist[j]) : (__extension__ ({ __const unsigned char *__s2 = (__const unsigned char *) (__const char *) (schemalist->list[ag.schema]->sharedlist[j]); register int __result = (((__const unsigned char *) (__const char *) (itemlist->list[k]->id))[0] - __s2[0]); if (__s1_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (itemlist->list[k]->id))[1] - __s2[1]); if (__s1_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (itemlist->list[k]->id))[2] - __s2[2]); if (__s1_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) (itemlist->list[k]->id))[3] - __s2[3]); } } __result; }))) : (__builtin_constant_p (schemalist->list[ag.schema]->sharedlist[j]) && ((size_t)(const void *)((schemalist->list[ag.schema]->sharedlist[j]) + 1) - (size_t)(const void *)(schemalist->list[ag.schema]->sharedlist[j]) == 1) && (__s2_len = strlen (schemalist->list[ag.schema]->sharedlist[j]), __s2_len < 4) ? (__builtin_constant_p (itemlist->list[k]->id) && ((size_t)(const void *)((itemlist->list[k]->id) + 1) - (size_t)(const void *)(itemlist->list[k]->id) == 1) ? __builtin_strcmp (itemlist->list[k]->id, schemalist->list[ag.schema]->sharedlist[j]) : (__extension__ ({ __const unsigned char *__s1 = (__const unsigned char *) (__const char *) (itemlist->list[k]->id); register int __result = __s1[0] - ((__const unsigned char *) (__const char *) (schemalist->list[ag.schema]->sharedlist[j]))[0]; if (__s2_len > 0 && __result == 0) { __result = (__s1[1] - ((__const unsigned char *) (__const char *) (schemalist->list[ag.schema]->sharedlist[j]))[1]); if (__s2_len > 1 && __result == 0) { __result = (__s1[2] - ((__const unsigned char *) (__const char *) (schemalist->list[ag.schema]->sharedlist[j]))[2]); if (__s2_len > 2 && __result == 0) __result = (__s1[3] - ((__const unsigned char *) (__const char *) (schemalist->list[ag.schema]->sharedlist[j]))[3]); } } __result; }))) : __builtin_strcmp (itemlist->list[k]->id, schemalist->list[ag.schema]->sharedlist[j])))); }) )
            break;
          ++k;
        }
        fprintf(out,"%d   \n", k);

        ++j;
      }
    }
    ag.num = 0;
    ++i;
  }

  fclose(out);
  return (0);
}


char * string_assign(const char const *string)
{
  char *ptr;
  if(! (ptr = malloc(strlen(string)+1) )){
    fprintf(stderr, "%s: error: could not allocate memory in string_assign()\n", program_name);
    exit(-10);
  }
  __builtin_strncpy (ptr, string, strlen(string));
  return ptr;
}

void update_yycolno(void)
{
  if((__extension__ (__builtin_constant_p ('\n') && !__builtin_constant_p (yytext) && ('\n') == '\0' ? (char *) __rawmemchr (yytext, '\n') : __builtin_strchr (yytext, '\n')))) {
    yycolno = strlen( strrchr(yytext,'\n') );
  }
  else yycolno += yyleng;
}

int is_keyword(const char * const word)
{

  int i=0;

  while(i<(sizeof(xrtdbkeywords)/sizeof(char*))){
    if ( __extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p (xrtdbkeywords[i]) && __builtin_constant_p (word) && (__s1_len = strlen (xrtdbkeywords[i]), __s2_len = strlen (word), (!((size_t)(const void *)((xrtdbkeywords[i]) + 1) - (size_t)(const void *)(xrtdbkeywords[i]) == 1) || __s1_len >= 4) && (!((size_t)(const void *)((word) + 1) - (size_t)(const void *)(word) == 1) || __s2_len >= 4)) ? __builtin_strcmp (xrtdbkeywords[i], word) : (__builtin_constant_p (xrtdbkeywords[i]) && ((size_t)(const void *)((xrtdbkeywords[i]) + 1) - (size_t)(const void *)(xrtdbkeywords[i]) == 1) && (__s1_len = strlen (xrtdbkeywords[i]), __s1_len < 4) ? (__builtin_constant_p (word) && ((size_t)(const void *)((word) + 1) - (size_t)(const void *)(word) == 1) ? __builtin_strcmp (xrtdbkeywords[i], word) : (__extension__ ({ __const unsigned char *__s2 = (__const unsigned char *) (__const char *) (word); register int __result = (((__const unsigned char *) (__const char *) (xrtdbkeywords[i]))[0] - __s2[0]); if (__s1_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (xrtdbkeywords[i]))[1] - __s2[1]); if (__s1_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (xrtdbkeywords[i]))[2] - __s2[2]); if (__s1_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) (xrtdbkeywords[i]))[3] - __s2[3]); } } __result; }))) : (__builtin_constant_p (word) && ((size_t)(const void *)((word) + 1) - (size_t)(const void *)(word) == 1) && (__s2_len = strlen (word), __s2_len < 4) ? (__builtin_constant_p (xrtdbkeywords[i]) && ((size_t)(const void *)((xrtdbkeywords[i]) + 1) - (size_t)(const void *)(xrtdbkeywords[i]) == 1) ? __builtin_strcmp (xrtdbkeywords[i], word) : (__extension__ ({ __const unsigned char *__s1 = (__const unsigned char *) (__const char *) (xrtdbkeywords[i]); register int __result = __s1[0] - ((__const unsigned char *) (__const char *) (word))[0]; if (__s2_len > 0 && __result == 0) { __result = (__s1[1] - ((__const unsigned char *) (__const char *) (word))[1]); if (__s2_len > 1 && __result == 0) { __result = (__s1[2] - ((__const unsigned char *) (__const char *) (word))[2]); if (__s2_len > 2 && __result == 0) __result = (__s1[3] - ((__const unsigned char *) (__const char *) (word))[3]); } } __result; }))) : __builtin_strcmp (xrtdbkeywords[i], word)))); }) == 0 )
      return 1;
    ++i;
  }

  return 0;
}

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2007-05-08  8:18 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-05-08  8:18 gcc-bug-report- Tuesday May 08 - Portugal Miguel Luis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).