Qucs-core  0.0.19
check_mdl.h
Go to the documentation of this file.
00001 /*
00002  * check_mdl.h - checker definitions for an IC-CAP MDL file
00003  *
00004  * Copyright (C) 2006 Stefan Jahn <stefan@lkcc.org>
00005  *
00006  * This is free software; you can redistribute it and/or modify
00007  * it under the terms of the GNU General Public License as published by
00008  * the Free Software Foundation; either version 2, or (at your option)
00009  * any later version.
00010  *
00011  * This software is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  * GNU General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU General Public License
00017  * along with this package; see the file COPYING.  If not, write to
00018  * the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor,
00019  * Boston, MA 02110-1301, USA.
00020  *
00021  * $Id$
00022  *
00023  */
00024 
00025 #ifndef __CHECK_MDL_H__
00026 #define __CHECK_MDL_H__
00027 
00028 namespace qucs {
00029   class dataset;
00030 }
00031 
00032 /* Externalize variables used by the scanner and parser. */
00033 extern int mdl_lineno;
00034 extern FILE * mdl_in;
00035 void mdl_restart (FILE *);
00036 
00037 __BEGIN_DECLS
00038 
00039 /* Available functions of the checker. */
00040 int  mdl_check (void);
00041 int  mdl_parse (void);
00042 int  mdl_error (const char *);
00043 int  mdl_lex (void);
00044 int  mdl_lex_destroy (void);
00045 void mdl_destroy (void);
00046 void mdl_init (void);
00047 
00048 __END_DECLS
00049 
00050 /* Declaration of MDL data structures. */
00051 extern qucs::dataset * mdl_result;
00052 extern struct mdl_link_t * mdl_root;
00053 extern struct mdl_sync_t * mdl_sync_root;
00054 
00055 struct mdl_point_t {
00056   int n;
00057   int x;
00058   int y;
00059   double r;
00060   double i;
00061   struct mdl_point_t * next;
00062 };
00063 
00064 struct mdl_datasize_t {
00065   char * type;
00066   int size;
00067   int x;
00068   int y;
00069 };
00070 
00071 struct mdl_element_t {
00072   int number;
00073   char * name;
00074   char * value;
00075   char * attr;
00076   struct mdl_element_t * next;
00077 };
00078 
00079 struct mdl_hyptable_t {
00080   char * name;
00081   struct mdl_element_t * data;
00082 };
00083 
00084 struct mdl_table_t {
00085   char * name;
00086   struct mdl_element_t * data;
00087 };
00088 
00089 struct mdl_dataset_t {
00090   char * type1;
00091   struct mdl_point_t * data1;
00092   char * type2;
00093   struct mdl_point_t * data2;
00094   struct mdl_datasize_t * dsize;
00095 };
00096 
00097 struct mdl_link_t {
00098   struct mdl_link_t * parent;
00099   char * name;
00100   char * type;
00101   struct mdl_lcontent_t * content;
00102   struct mdl_link_t * next;
00103 };
00104 
00105 struct mdl_lcontent_t {
00106   int type;
00107   union {
00108     struct mdl_link_t * link;
00109     struct mdl_data_t * data;
00110     struct mdl_table_t * table;
00111   };
00112   struct mdl_lcontent_t * next;
00113 };
00114 
00115 struct mdl_data_t {
00116   struct mdl_dcontent_t * content;
00117 };
00118 
00119 struct mdl_dcontent_t {
00120   int type;
00121   union {
00122     struct mdl_dataset_t * data;
00123     struct mdl_hyptable_t * hyptable;
00124   };
00125   struct mdl_dcontent_t * next;
00126 };
00127 
00128 struct mdl_sync_t {
00129   char * master;
00130   char * name;
00131   double ratio;
00132   double offset;
00133   struct mdl_sync_t * next;
00134 };
00135 
00136 #endif /* __CHECK_MDL_H__ */