advanced hello world
authorxchaos <xchaos@4bb87942-c103-4e5a-b51c-0ebff58f8515>
Thu, 24 Jan 2008 15:05:41 +0000 (15:05 +0000)
committerxchaos <xchaos@4bb87942-c103-4e5a-b51c-0ebff58f8515>
Thu, 24 Jan 2008 15:05:41 +0000 (15:05 +0000)
git-svn-id: https://dev.arachne.cz/repos/cll1h/trunk@37 4bb87942-c103-4e5a-b51c-0ebff58f8515

cll1.h
demos/advanced-hello-world.c

diff --git a/cll1.h b/cll1.h
index 68053d698f9c7aa1606baf082e7f0045b4f6f3bd..4dc23e16256b87fee09e2e2df7affd85ff917463 100644 (file)
--- a/cll1.h
+++ b/cll1.h
@@ -46,7 +46,8 @@
 #define or ||
 #define TRUE 1
 #define FALSE 0
-#define MAYBE (int)(srandom(time(NULL)),random()%2)
+#define MAYBE (int)((_srtime?0:(time(&_srtime),srandom(_srtime))),random()%2)
+#define WHOKNOWS (int)(srandom(time(NULL)),random()%2)
 #define bool_str(I) (I?"TRUE":"FALSE")
 #define boolean int
 #define mem struct
@@ -189,7 +190,7 @@ obsolete
 #define _ISTACK struct _IStack { int I; int _23; list(_IStack); } *_Iatom,*_Istack=NULL;
 #define _SSTACK struct _SStack { char *S; int _23; list(_SSTACK); } *_Satom,*_Sstack=NULL;
 #define _FSTACK struct _FStack { FILE *F; int _23; list(_FSTACK); } *_Fatom,*_Fstack=NULL;
-
+#define _SRTIME time_t _srtime=0;
 
 #define _NEW_(ATOM,STACK,TYPE) (create(ATOM,TYPE),ATOM->_23=1,push(ATOM,STACK);ATOM->_23||pop(ATOM,STACK)&&0;ATOM->_23--)
 #define _NEW_I for _NEW_(_Iatom,_Istack,_IStack)
@@ -261,9 +262,10 @@ obsolete
 /* ------------------------------------------------------------------- */
 /* Voila - here we go !                                                */
 /* ------------------------------------------------------------------- */
-#define define_cll1_globals _ISTACK _SSTACK _FSTACK _MSTACK _RSTACK //_QSTACK
-#define implement_cll1_functions _ECHO /* _GET_STR _GET_MEM */
-#define implement_cll1_library define_cll1_globals implement_cll1_functions
+#define define_cll1_globals _SRTIME _ISTACK _SSTACK _FSTACK _MSTACK _RSTACK //_QSTACK
+#define implement_cll1_functions _ECHO // _GET_STR _GET_MEM
+#define define_cll1_interfaces //_CAKE
+#define implement_cll1_library define_cll1_globals implement_cll1_functions define_cll1_interfaces
 #define program implement_cll1_library int main(int argc, char **argv)
 /* ------------------------------------------------------------------- */
 #endif
index 1212211d5f2378680cb28b482e43668bc3fcffc0..0c166659e4eefe610f379ae802ef95b5d622be32 100644 (file)
@@ -2,6 +2,8 @@
 
 program
 {
- echo("Hello ",NULL,"world","  ! ");
- print("Hello","world",NULL,"!");
+ echo("Hello ",NULL," ","world","  ! ");
+ print("Hello", "world",NULL,"!");
+ print(MAYBE ? "Hello" : "Hi", WHOKNOWS ? "world" : "friend", MAYBE ? "!" : "?");
 }
This page took 0.299761 seconds and 4 git commands to generate.