diff --git a/crypto777/OS_portable.h b/crypto777/OS_portable.h index d92b66ca4..0c2e17139 100755 --- a/crypto777/OS_portable.h +++ b/crypto777/OS_portable.h @@ -198,8 +198,8 @@ int32_t OS_openmap(struct OS_mappedptr *mp); void *OS_mappedptr(void **ptrp,struct OS_mappedptr *mp,uint64_t allocsize,int32_t rwflag,char *fname); void *OS_filealloc(struct OS_mappedptr *M,char *fname,struct OS_memspace *mem,long size); void *OS_mapfile(char *fname,long *filesizep,int32_t enablewrite); -void *OS_loadfile(char *fname,char **bufp,int64_t *lenp,int64_t *allocsizep); -void *OS_filestr(int64_t *allocsizep,char *fname); +void *OS_loadfile(char *fname,char **bufp,long *lenp,long *allocsizep); +void *OS_filestr(long *allocsizep,char *fname); int32_t OS_syncmap(struct OS_mappedptr *mp,long len); void *OS_tmpalloc(char *dirname,char *name,struct OS_memspace *mem,long origsize); diff --git a/crypto777/iguana_OS.c b/crypto777/iguana_OS.c index 03d524ce9..88ceda0b7 100755 --- a/crypto777/iguana_OS.c +++ b/crypto777/iguana_OS.c @@ -769,10 +769,10 @@ void *OS_filealloc(struct OS_mappedptr *M,char *fname,struct OS_memspace *mem,lo return(M->fileptr); } -void *OS_loadfile(char *fname,char **bufp,int64_t *lenp,int64_t *allocsizep) +void *OS_loadfile(char *fname,char **bufp,long *lenp,long *allocsizep) { FILE *fp; - int64_t filesize,buflen = *allocsizep; + long filesize,buflen = *allocsizep; char *buf = *bufp; *lenp = 0; if ( (fp= fopen(OS_compatible_path(fname),"rb")) != 0 ) @@ -805,9 +805,9 @@ void *OS_loadfile(char *fname,char **bufp,int64_t *lenp,int64_t *allocsizep) return(buf); } -void *OS_filestr(int64_t *allocsizep,char *fname) +void *OS_filestr(long *allocsizep,char *fname) { - int64_t filesize = 0; char *buf = 0; + long filesize = 0; char *buf = 0; *allocsizep = 0; return(OS_loadfile(fname,&buf,&filesize,allocsizep)); } diff --git a/iguana/field.html b/iguana/field.html new file mode 100644 index 000000000..74dceff1c --- /dev/null +++ b/iguana/field.html @@ -0,0 +1,4 @@ +
+ + +
\ No newline at end of file diff --git a/iguana/footer.html b/iguana/footer.html new file mode 100644 index 000000000..7981c335a --- /dev/null +++ b/iguana/footer.html @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/iguana/formfooter.html b/iguana/formfooter.html new file mode 100644 index 000000000..ecc2e5faa --- /dev/null +++ b/iguana/formfooter.html @@ -0,0 +1,19 @@ + + +
+
+ +
+
+                                    
+                                
+
+
+
+ + + + + + + diff --git a/iguana/formheader.html b/iguana/formheader.html new file mode 100644 index 000000000..bb8b84e8f --- /dev/null +++ b/iguana/formheader.html @@ -0,0 +1,16 @@ + +
+
+

+ + %s %s + +

+
+
+
+ +
+
+
+ \ No newline at end of file diff --git a/iguana/forms.html b/iguana/forms.html new file mode 100644 index 000000000..a06db022c --- /dev/null +++ b/iguana/forms.html @@ -0,0 +1,5024 @@ + + + + + + + + SuperNET API> + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ +
+
+ + +
+
+
+ + +
+ + +
+
+
+
+ +
+
+                                    
+                                
+
+
+
+
+ + + +
+
+
+ +
+ +
+
+ +
+
+
+
+ + +
+
+
+
+ +
+
+                                    
+                                
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+
+
+
+ + +
+ + +
+ + +
+ + +
+ + +
+
+
+
+ +
+
+                                    
+                                
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+
+
+
+ + +
+ + +
+ + +
+
+
+
+ +
+
+                                    
+                                
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+
+
+
+ + +
+
+
+
+ +
+
+                                    
+                                
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+
+
+
+ + +
+ + +
+ + +
+
+
+
+ +
+
+                                    
+                                
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+
+
+
+ + +
+ + +
+ + +
+
+
+
+ +
+
+                                    
+                                
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+
+
+
+ + +
+
+
+
+ +
+
+                                    
+                                
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+
+
+
+ + +
+
+
+
+ +
+
+                                    
+                                
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+
+
+
+ + +
+ + +
+
+
+
+ +
+
+                                    
+                                
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+
+
+
+ + +
+ + +
+
+
+
+ +
+
+                                    
+                                
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+
+
+
+ + +
+ + +
+ + +
+
+
+
+ +
+
+                                    
+                                
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+
+
+
+ + +
+ + +
+ + +
+
+
+
+ +
+
+                                    
+                                
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+
+
+
+ + +
+
+
+
+ +
+
+                                    
+                                
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+
+
+
+ + +
+ + +
+
+
+
+ +
+
+                                    
+                                
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+
+
+
+ + +
+ + +
+
+
+
+ +
+
+                                    
+                                
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+
+
+
+ + +
+ + +
+ + +
+
+
+
+ +
+
+                                    
+                                
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+
+
+
+ + +
+ + +
+
+
+
+ +
+
+                                    
+                                
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+
+
+
+ + +
+ + +
+
+
+
+ +
+
+                                    
+                                
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+
+
+
+ + +
+ + +
+
+
+
+ +
+
+                                    
+                                
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+
+
+
+ + +
+ + +
+
+
+
+ +
+
+                                    
+                                
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+
+
+
+ + +
+ + +
+
+
+
+ +
+
+                                    
+                                
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+
+
+
+ + +
+ + +
+
+
+
+ +
+
+                                    
+                                
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+
+
+
+ + +
+ + +
+
+
+
+ +
+
+                                    
+                                
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+
+
+
+ + +
+ + +
+
+
+
+ +
+
+                                    
+                                
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+
+
+
+ + +
+ + +
+
+
+
+ +
+
+                                    
+                                
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+
+
+
+ + +
+ + +
+
+
+
+ +
+
+                                    
+                                
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+
+
+
+ + +
+ + +
+
+
+
+ +
+
+                                    
+                                
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+
+
+
+ + +
+ + +
+
+
+
+ +
+
+                                    
+                                
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+
+
+
+ + +
+ + +
+
+
+
+ +
+
+                                    
+                                
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+
+
+
+ + +
+ + +
+
+
+
+ +
+
+                                    
+                                
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+
+
+
+ + +
+ + +
+
+
+
+ +
+
+                                    
+                                
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+
+
+
+ + +
+ + +
+
+
+
+ +
+
+                                    
+                                
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+
+
+
+ + +
+ + +
+
+
+
+ +
+
+                                    
+                                
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+
+
+
+ + +
+ + +
+
+
+
+ +
+
+                                    
+                                
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+
+
+
+ + +
+ + +
+
+
+
+ +
+
+                                    
+                                
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+
+
+
+ + +
+ + +
+
+
+
+ +
+
+                                    
+                                
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+
+
+
+ + +
+ + +
+
+
+
+ +
+
+                                    
+                                
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+
+
+
+ + +
+ + +
+
+
+
+ +
+
+                                    
+                                
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+
+
+
+ + +
+
+
+
+ +
+
+                                    
+                                
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+
+
+
+ + +
+ + +
+
+
+
+ +
+
+                                    
+                                
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+
+
+
+ + +
+
+
+
+ +
+
+                                    
+                                
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+
+
+
+ + +
+
+
+
+ +
+
+                                    
+                                
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+
+
+
+ + +
+
+
+
+ +
+
+                                    
+                                
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+
+
+
+ + +
+
+
+
+ +
+
+                                    
+                                
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+
+
+
+ + +
+ + +
+
+
+
+ +
+
+                                    
+                                
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+
+
+
+ + +
+ + +
+
+
+
+ +
+
+                                    
+                                
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+
+
+
+ + +
+ + +
+
+
+
+ +
+
+                                    
+                                
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+
+
+
+ + +
+ + +
+
+
+
+ +
+
+                                    
+                                
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+
+
+
+ + +
+ + +
+
+
+
+ +
+
+                                    
+                                
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+
+
+
+ + +
+ + +
+ + +
+
+
+
+ +
+
+                                    
+                                
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+
+
+
+ + +
+ + +
+ + +
+
+
+
+ +
+
+                                    
+                                
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+
+
+
+ + +
+
+
+
+ +
+
+                                    
+                                
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+
+
+
+ + +
+
+
+
+ +
+
+                                    
+                                
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+
+
+
+ + +
+
+
+
+ +
+
+                                    
+                                
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+
+
+
+ + +
+
+
+
+ +
+
+                                    
+                                
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+
+
+
+ + +
+
+
+
+ +
+
+                                    
+                                
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+
+
+
+ + +
+
+
+
+ +
+
+                                    
+                                
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+
+
+
+ + +
+
+
+
+ +
+
+                                    
+                                
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+
+
+
+ + +
+
+
+
+ +
+
+                                    
+                                
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+
+
+
+ + +
+
+
+
+ +
+
+                                    
+                                
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+
+
+
+ + +
+
+
+
+ +
+
+                                    
+                                
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+
+
+
+ + +
+
+
+
+ +
+
+                                    
+                                
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+
+
+
+ + +
+
+
+
+ +
+
+                                    
+                                
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+
+
+
+ + +
+
+
+
+ +
+
+                                    
+                                
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+
+
+
+ + +
+ + +
+
+
+
+ +
+
+                                    
+                                
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+
+
+
+ + +
+ + +
+
+
+
+ +
+
+                                    
+                                
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+
+
+
+ + +
+ + +
+
+
+
+ +
+
+                                    
+                                
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+
+
+
+ + +
+ + +
+ + +
+
+
+
+ +
+
+                                    
+                                
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+
+
+
+ + +
+ + +
+ + +
+
+
+
+ +
+
+                                    
+                                
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+
+
+
+ + +
+ + +
+ + +
+
+
+
+ +
+
+                                    
+                                
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+
+
+
+ + +
+ + +
+ + +
+
+
+
+ +
+
+                                    
+                                
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+
+
+
+ + +
+ + +
+
+
+
+ +
+
+                                    
+                                
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+
+
+
+ + +
+ + +
+
+
+
+ +
+
+                                    
+                                
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+
+
+
+ + +
+ + +
+
+
+
+ +
+
+                                    
+                                
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+
+
+
+ + +
+ + +
+
+
+
+ +
+
+                                    
+                                
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+
+
+
+ + +
+ + +
+ + +
+
+
+
+ +
+
+                                    
+                                
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+
+
+
+ + +
+ + +
+
+
+
+ +
+
+                                    
+                                
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+
+
+
+ + +
+ + +
+ + +
+ + +
+
+
+
+ +
+
+                                    
+                                
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+
+
+
+ + +
+ + +
+ + +
+
+
+
+ +
+
+                                    
+                                
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+
+
+
+ + +
+
+
+
+ +
+
+                                    
+                                
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+
+
+
+ + +
+ + +
+
+
+
+ +
+
+                                    
+                                
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+
+
+
+ + +
+ + +
+ + +
+
+
+
+ +
+
+                                    
+                                
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+
+
+
+ + +
+ + +
+
+
+
+ +
+
+                                    
+                                
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+
+
+
+ + +
+ + +
+ + +
+
+
+
+ +
+
+                                    
+                                
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+
+
+
+ + +
+ + +
+ + +
+ + +
+ + +
+
+
+
+ +
+
+                                    
+                                
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+
+
+
+ + +
+ + +
+ + +
+ + +
+ + +
+ + +
+
+
+
+ +
+
+                                    
+                                
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+
+
+
+ + +
+ + +
+ + +
+ + +
+
+
+
+ +
+
+                                    
+                                
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+
+
+
+ + +
+ + +
+ + +
+ + +
+
+
+
+ +
+
+                                    
+                                
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+
+
+
+ + +
+ + +
+
+
+
+ +
+
+                                    
+                                
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+
+
+
+ + +
+
+
+
+ +
+
+                                    
+                                
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+
+
+
+ + +
+
+
+
+ +
+
+                                    
+                                
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+
+
+
+ + +
+
+
+
+ +
+
+                                    
+                                
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+
+
+
+ + +
+
+
+
+ +
+
+                                    
+                                
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+
+
+
+ + +
+
+
+
+ +
+
+                                    
+                                
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+
+
+
+ + +
+
+
+
+ +
+
+                                    
+                                
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+
+
+
+ + +
+
+
+
+ +
+
+                                    
+                                
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+
+
+
+ + +
+
+
+
+ +
+
+                                    
+                                
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+
+
+
+ + +
+
+
+
+ +
+
+                                    
+                                
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+
+
+
+ + +
+
+
+
+ +
+
+                                    
+                                
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+
+
+
+ + +
+
+
+
+ +
+
+                                    
+                                
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+
+
+
+ + +
+
+
+
+ +
+
+                                    
+                                
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+
+
+
+ + +
+
+
+
+ +
+
+                                    
+                                
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+
+
+
+ + +
+
+
+
+ +
+
+                                    
+                                
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+
+
+
+ + +
+
+
+
+ +
+
+                                    
+                                
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+
+
+
+ + +
+
+
+
+ +
+
+                                    
+                                
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+
+
+
+ + +
+
+
+
+ +
+
+                                    
+                                
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+
+
+
+ + +
+
+
+
+ +
+
+                                    
+                                
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+
+
+
+ + +
+
+
+
+ +
+
+                                    
+                                
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+
+
+
+ + +
+
+
+
+ +
+
+                                    
+                                
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+
+
+
+ + +
+
+
+
+ +
+
+                                    
+                                
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+
+
+
+ + +
+ + +
+
+
+
+ +
+
+                                    
+                                
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+
+
+
+ + +
+ + +
+
+
+
+ +
+
+                                    
+                                
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+
+
+
+ + +
+ + +
+
+
+
+ +
+
+                                    
+                                
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+
+
+
+ + +
+ + +
+
+
+
+ +
+
+                                    
+                                
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+
+
+
+ + +
+ + +
+
+
+
+ +
+
+                                    
+                                
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+
+
+
+ + +
+ + +
+
+
+
+ +
+
+                                    
+                                
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+
+
+
+ + +
+ + +
+
+
+
+ +
+
+                                    
+                                
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+
+
+
+ + +
+ + +
+
+
+
+ +
+
+                                    
+                                
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+
+
+
+ + +
+ + +
+
+
+
+ +
+
+                                    
+                                
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+
+
+
+ + +
+ + +
+
+
+
+ +
+
+                                    
+                                
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+
+
+
+ + +
+ + +
+
+
+
+ +
+
+                                    
+                                
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+
+
+
+ + +
+ + +
+
+
+
+ +
+
+                                    
+                                
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+
+
+
+ + +
+ + +
+
+
+
+ +
+
+                                    
+                                
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+
+
+
+ + +
+ + +
+
+
+
+ +
+
+                                    
+                                
+
+
+
+
+ +
+ +
+
+
+
+ +
+ + + + + + + + + + diff --git a/iguana/header.html b/iguana/header.html new file mode 100644 index 000000000..bbe8403f1 --- /dev/null +++ b/iguana/header.html @@ -0,0 +1,49 @@ + + + + + + + + SuperNET API> + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + diff --git a/iguana/iguana_json.c b/iguana/iguana_json.c index d1b6ad072..cdb139adb 100755 --- a/iguana/iguana_json.c +++ b/iguana/iguana_json.c @@ -213,26 +213,150 @@ int32_t agentform(FILE *fp,char *form,int32_t max,char *agent,cJSON *methoditem) return((int32_t)strlen(form)); } -/*
- 0 - - 100 + - - = - -

- -
*/ - -char *SuperNET_htmlstr(FILE *fp,char *htmlstr,int32_t max,char *agentstr) +#define HTML_EMIT(str,n) memcpy(&retbuf[size],str,n), size += (n) +int32_t template_emit(char *retbuf,int32_t maxsize,char *template,char *varname,char *value) { - int32_t i,n,len,size = 0; cJSON *helpjson,*item,*array; char *str; + int32_t offset,valuelen,varnamelen,position,size = 0; char *match; + offset = 0; + valuelen = (int32_t)strlen(value); + varnamelen = (int32_t)strlen(varname); + while ( (match= strstr(varname,&template[offset])) != 0 ) + { + position = (int32_t)((long)match - (long)&template[offset]); + printf("found match.(%s) at %d offset.%d\n",varname,position,offset); + if ( size + (valuelen + position) > maxsize ) + return(-1); + HTML_EMIT(&template[offset],position), offset += position + varnamelen; + HTML_EMIT(value,valuelen); + } + HTML_EMIT(&template[offset],strlen(&template[offset])+1); + return(size); +} + +#define MAX_TEMPLATESIZE 32768 +int32_t templates_emit(char *retbuf,int32_t maxsize,char *template,char *agent,char *method,char *fieldnames,char *fieldnames2) +{ + char buf[MAX_TEMPLATESIZE+4096]; + strcpy(buf,template); + template_emit(retbuf,maxsize,buf,"$AGENT",agent), strcpy(buf,retbuf); + template_emit(retbuf,maxsize,buf,"$METHOD",method), strcpy(buf,retbuf); + template_emit(retbuf,maxsize,buf,"$FIELDNAMES",fieldnames), strcpy(buf,retbuf); + return(template_emit(retbuf,maxsize,buf,"$FIELDNAMES2",fieldnames2)); +} + +int32_t pretty_form(FILE *fp,char *formheader,char *formfooter,char *fieldtemplate,char *agent,cJSON *methoditem) +{ + cJSON *item,*fieldsarray; int32_t j,m,formsize,fieldsize,iter,width,size = 0; + char *methodstr,*typestr,*fieldname; + char outstr[2048],outstr2[2048],str[2],widthstr[16]; + if ( (methodstr= jstr(methoditem,"method")) == 0 ) + methodstr = "method"; + if ( agent == 0 ) + agent = "agent"; + outstr[0] = outstr2[0] = str[1] = 0; + formsize = fieldsize = 0; + if ( (fieldsarray= jarray(&m,methoditem,"fields")) != 0 ) + { + for (iter=0; iter<2; iter++) + { + if ( iter == 1 ) + fprintf(fp,formheader,methodstr,methodstr,methodstr,agent,methodstr,methodstr,methodstr,agent,methodstr,outstr); + for (j=0; j 0 ) + { + strcat(outstr,"+"); + strcat(outstr2," "); + } + strcat(outstr,fieldname); + strcat(outstr2,fieldname); + } + else + { + if ( (typestr= jstr(item,fieldname)) != 0 ) + { + if ( strcmp(typestr,"string") == 0 ) + width = 44; + else if ( strcmp(typestr,"hash") == 0 ) + width = 65; + else if ( strcmp(typestr,"int") == 0 ) + width = 12; + else if ( strcmp(typestr,"float") == 0 ) + width = 24; + else if ( strcmp(typestr,"u64bits") == 0 ) + width = 24; + else width = 0; + } + sprintf(widthstr,"%d",width); + fprintf(fp,fieldtemplate,fieldname,fieldname,fieldname,widthstr,fieldname); + } + } + if ( iter == 1 ) + fprintf(fp,formfooter,outstr2,methodstr,methodstr); + } + } + return(size); +} + +int32_t pretty_forms(char *fname,char *agentstr) +{ + char *str,*header,*footer,*formheader,*formfooter,*field; long allocsize; FILE *fp; + int32_t i,n,len,err=0,size = 0; cJSON *helpjson,*array,*item; + header = OS_filestr(&allocsize,"header.html"); if ( allocsize > MAX_TEMPLATESIZE ) err++; + footer = OS_filestr(&allocsize,"footer.html"); if ( allocsize > MAX_TEMPLATESIZE ) err++; + formheader = OS_filestr(&allocsize,"formheader.html"); if ( allocsize > MAX_TEMPLATESIZE ) err++; + formfooter = OS_filestr(&allocsize,"formfooter.html"); if ( allocsize > MAX_TEMPLATESIZE ) err++; + field = OS_filestr(&allocsize,"field.html"); if ( allocsize > MAX_TEMPLATESIZE ) err++; + fp = fopen(fname,"w"); + if ( fp != 0 && err == 0 && header != 0 && footer != 0 && formheader != 0 && formfooter != 0 && field != 0 ) + { + //HTML_EMIT(header,strlen(header)); + fprintf(fp,"%s\n",header); + if ( (helpjson= SuperNET_helpjson()) != 0 ) + { + if ( (array= jarray(&n,helpjson,"API")) != 0 ) + { + for (i=0; i SuperUGLY GUI> "); - if ( fp != 0 ) - fprintf(fp,"%s\n",htmlstr); - printf("%s\n",htmlstr); size = (int32_t)strlen(htmlstr); if ( (helpjson= SuperNET_helpjson()) != 0 ) { @@ -244,7 +368,7 @@ char *SuperNET_htmlstr(FILE *fp,char *htmlstr,int32_t max,char *agentstr) str = jstr(item,"agent"); if ( agentstr == 0 || agentstr[0] == 0 || (str != 0 && strcmp(str,agentstr) == 0) ) { - len = agentform(fp,&htmlstr[size],max - size,str!=0?str:"agent",item); + len = agentform(fp,&htmlstr[size],maxsize - size,str!=0?str:"agent",item); size += len; } //else printf("agentstr.%p (%s) (%s) str.%p \n",agentstr,agentstr,str,str); } @@ -252,8 +376,6 @@ char *SuperNET_htmlstr(FILE *fp,char *htmlstr,int32_t max,char *agentstr) free_json(helpjson); } strcat(htmlstr,"



"); - if ( fp != 0 ) - fprintf(fp,"



\n"); printf("



\n"); return(htmlstr); } @@ -549,19 +671,18 @@ ZERO_ARGS(SuperNET,help) TWO_STRINGS(SuperNET,html,agentform,htmlfile) { - char *htmlstr; cJSON *retjson; FILE *fp; int32_t max = 4*1024*1024; + char *htmlstr; cJSON *retjson; int32_t max = 4*1024*1024; if ( htmlfile == 0 || htmlfile[0] == 0 ) - htmlfile = "uglyform.html"; - if ( (fp= fopen(htmlfile,"w")) == 0 ) - printf("error opening htmlfile.(%s)\n",htmlfile); + htmlfile = "forms.html"; + //if ( (fp= fopen(htmlfile,"w")) == 0 ) + // printf("error opening htmlfile.(%s)\n",htmlfile); htmlstr = malloc(max); - htmlstr = SuperNET_htmlstr(fp,htmlstr,max,agentform); + htmlstr = SuperNET_htmlstr(htmlfile,htmlstr,max,agentform); retjson = cJSON_CreateObject(); jaddstr(retjson,"result",htmlstr); - jaddstr(retjson,"htmlfile",htmlfile); free(htmlstr); - if ( fp != 0 ) - fclose(fp); + //if ( fp != 0 ) + // fclose(fp); return(jprint(retjson,1)); } diff --git a/iguana/main.c b/iguana/main.c index 095593b23..b762fe3e2 100644 --- a/iguana/main.c +++ b/iguana/main.c @@ -270,7 +270,7 @@ void sigcontinue_func() { printf("\nSIGCONT\n"); signal(SIGCONT,sigcontinue_func void iguana_main(void *arg) { - FILE *fp; cJSON *json; uint8_t *space,secretbuf[512]; uint32_t r; int64_t allocsize; + FILE *fp; cJSON *json; uint8_t *space,secretbuf[512]; uint32_t r; long allocsize; char helperstr[64],fname[512],*wallet2,*wallet2str,*tmpstr,*confstr,*helperargs,*ipaddr,*coinargs=0,*secret,*jsonstr = arg; int32_t i,len,flag,c; bits256 acct,seed,checkhash,wallethash,walletpub,wallet2shared,wallet2priv,wallet2pub; memset(&MYINFO,0,sizeof(MYINFO)); @@ -461,7 +461,7 @@ void iguana_main(void *arg) iguana_launch(iguana_coinadd("BTCD"),"rpcloop",iguana_rpcloop,iguana_coinadd("BTCD"),IGUANA_PERMTHREAD); if ( coinargs != 0 ) iguana_launch(iguana_coinadd("BTCD"),"iguana_coins",iguana_coins,coinargs,IGUANA_PERMTHREAD); - else if ( 0 ) + else if ( 1 ) { #ifdef __APPLE__ sleep(1); diff --git a/pnacl_main.h b/pnacl_main.h index b1d3ca9d5..2d14143e0 100644 --- a/pnacl_main.h +++ b/pnacl_main.h @@ -24,7 +24,7 @@ void PNACL_message(const char* format, ...); #endif void OS_init(); -void *OS_filestr(int64_t *allocsizep,char *fname); +void *OS_filestr(long *allocsizep,char *fname); char *clonestr(char *); void CHROMEAPP_MAIN(void *arg);