some prelimanary work - will not compile
[svn/Cll1h/.git] / cll1.h
diff --git a/cll1.h b/cll1.h
index cb66f6fda918bfbc6616a772c6df17e1d58b6d63..261cd81b9b8527e25801f5140789ab5503689476 100644 (file)
--- a/cll1.h
+++ b/cll1.h
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    Lesser General Public License for more details.
 
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, write to 
-   Michael Polak, Svojsikova 7, 169 00 Praha 6 Czech Republic          */
-/* ------------------------------------------------------------------- */
-#ifndef __CLL1H__
-#define __CLL1H__
+   You should have received a copy of the GNU Lesser General Public License
+   along with C<<1 header file; if not, write to the Free Software
+   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+
+*/
+
+#ifndef _CLL1_H
+#define _CLL1_H
 
 #include <string.h>
 #include <malloc.h>
@@ -59,7 +61,7 @@
 /* ------------------------------------------------------------------- */
 #define loop while(TRUE)
 #define repeat(N) if(N>0) _NEW_I for_range(_I,1,N)
-#define for_range(VAR,FROM,TO) for( VAR=FROM ; FROM<=TO?(VAR<=TO):(VAR>=TO) ; FROM<=TO?(VAR++):(VAR--))
+#define for_range(VAR,FROM,TO) for( VAR=FROM ; FROM<=TO?VAR<=TO:VAR>=TO ; FROM<=TO?VAR++:VAR--)
 #define for_each(A,B) for(A=B; A; A=A->_next)
 #define for_search(A,B,C) for_each(A,B) if(C)
 /*to do: #define for_file_lines(STR,F) _NEW_F for() */
 #define textfile(TYPE,LINE) struct TYPE { char *LINE; char _eoln; list(TYPE); }
 #define date(S) { time_t _T; _T=time(NULL); duplicate(ctime(&_T),S); }
 
-#ifdef USE_LIBRARY_MYSQL
 /* ------------------------------------------------------------------- */
 /* MySQL Infrastructure and basic macros -  updated 2007-12-19 by xCh. */
 /* ------------------------------------------------------------------- */
+#ifdef USE_LIBRARY_MYSQL
 #define mysql_connect(S,U,P,D) (create(_Matom,_MStack) && push(_Matom,_Mstack) && (_Matom->M=mysql_init(NULL)),(_Matom->M && mysql_real_connect(_Matom->M,S,U,P,D,0,NULL,0)?_Matom->M:NULL))
 #endif
-
+/* ------------------------------------------------------------------- */
+/* Object infrastructure and basic macros - updated 2008-01-13 by xCh. */
+/* unfinished */ 
+#define uses_interface(TYPE) struct TYPE *__class
+#define method(NAME)
+#define interface_implementation(IFACE,TYPE) struct TYPE *__get_##_##IFACE(void) { struct TYPE *_FACE=get_mem(TYPE); __bind_##_##IFACE(_FACE); return _IFC; } void __bind_##_##IFACE(struct TYPE *_FACE)
+#define bind_method(METHOD,FUNCTION) _IFACE->METHOD=FUNCTION
+#define get_interface(IFACE) __get_##_##IFACE(void)
+// must be function #define get_object(TYPE) (_CLL1_MALLOC(TYPE),CLL1_ASSERT(),)
+#define _(OBJECT,FUNCTION) OBJECT==NULL?NULL::(*(OBJECT->__class->METHOD))(OBJECT
 #endif
+/* ------------------------------------------------------------------- */
+/* some general ideas, unfinished */
+#define _CLL1_THROW(ERR)
+#define _CLL1_TRY _NEW_E for(;;) if () {.... if(_Eatom->SYS) { if(_Eatom->RET) return; else break;} else { }
+#define _CLL1_ASSERT(EXPR) assert(EXPR)
+#define _CLL1_MALLOC(TYPE) malloc(sizeof(TYPE))
This page took 0.132214 seconds and 4 git commands to generate.