diff options
Diffstat (limited to 'tools')
-rw-r--r-- | tools/cmerge.nim | 6 | ||||
-rw-r--r-- | tools/detect/detect.nim | 234 | ||||
-rw-r--r-- | tools/detect/windows_i386_consts.nim | 192 | ||||
-rw-r--r-- | tools/fakedeps.nim | 2 | ||||
-rw-r--r-- | tools/nimgrep.nim | 90 | ||||
-rw-r--r-- | tools/niminst/buildbat.tmpl | 6 | ||||
-rw-r--r-- | tools/niminst/buildsh.tmpl | 2 | ||||
-rw-r--r-- | tools/niminst/debcreation.nim | 60 | ||||
-rw-r--r-- | tools/niminst/deinstall.tmpl | 2 | ||||
-rw-r--r-- | tools/niminst/inno.tmpl | 2 | ||||
-rw-r--r-- | tools/niminst/install.tmpl | 2 | ||||
-rw-r--r-- | tools/niminst/makefile.tmpl | 2 | ||||
-rw-r--r-- | tools/niminst/niminst.nim | 70 | ||||
-rw-r--r-- | tools/niminst/nsis.tmpl | 20 | ||||
-rw-r--r-- | tools/nimrepl.nim | 170 | ||||
-rw-r--r-- | tools/nimweb.nim | 12 | ||||
-rw-r--r-- | tools/noprefix.nim | 4 | ||||
-rw-r--r-- | tools/restorecc.nim | 12 | ||||
-rw-r--r-- | tools/website.tmpl | 10 |
19 files changed, 470 insertions, 428 deletions
diff --git a/tools/cmerge.nim b/tools/cmerge.nim index d2e540481..15fbd8a76 100644 --- a/tools/cmerge.nim +++ b/tools/cmerge.nim @@ -5,7 +5,7 @@ import os, sets, pegs type ProcessResult = enum prSkipIncludeDir, prAddIncludeDir -proc process(dir, infile: string, outfile: File, +proc process(dir, infile: string, outfile: File, processed: var HashSet[string]): ProcessResult = if processed.containsOrIncl(infile): return prSkipIncludeDir let toProcess = dir / infile @@ -19,9 +19,9 @@ proc process(dir, infile: string, outfile: File, ig <- (comment / \s+)* """: # follow the include file: if process(dir, matches[0], outfile, processed) == prAddIncludeDir: - writeln(outfile, line) + writeLine(outfile, line) else: - writeln(outfile, line) + writeLine(outfile, line) proc main(dir, outfile: string) = var o: File diff --git a/tools/detect/detect.nim b/tools/detect/detect.nim index 77efdaacd..0470257ee 100644 --- a/tools/detect/detect.nim +++ b/tools/detect/detect.nim @@ -29,18 +29,18 @@ int main() { """ type - TTypeKind = enum + TTypeKind = enum cint, cshort, clong, cstring, pointer var hd = "" tl = "" -proc myExec(cmd: string): bool = +proc myExec(cmd: string): bool = echo "CMD ", cmd return execShellCmd(cmd) == 0 -proc header(s: string): bool = +proc header(s: string): bool = const testh = "testh" var f: TFile if open(f, addFileExt(testh, "c"), fmWrite): @@ -55,10 +55,10 @@ proc header(s: string): bool = else: echo("Not found: ", s) -proc main = +proc main = const gen = "genconsts" var f: TFile - if open(f, addFileExt(gen, "c"), fmWrite): + if open(f, addFileExt(gen, "c"), fmWrite): f.write(cfile % [hd, tl, system.hostOS, system.hostCPU]) close(f) if not myExec(cc % [gen.addFileExt(ExeExt), gen]): quit(1) @@ -69,26 +69,26 @@ proc main = #removeFile(addFileExt(gen, "c")) echo("Success") -proc v(name: string, typ: TTypeKind=cint) = +proc v(name: string, typ: TTypeKind=cint) = var n = if name[0] == '_': substr(name, 1) else: name var t = $typ case typ - of pointer: - addf(tl, - "#ifdef $3\n fprintf(f, \" $1* = cast[$2](%p)\\n\", $3);\n#endif\n", + of pointer: + addf(tl, + "#ifdef $3\n fprintf(f, \" $1* = cast[$2](%p)\\n\", $3);\n#endif\n", n, t, name) - + of cstring: - addf(tl, + addf(tl, "#ifdef $3\n fprintf(f, \" $1* = $2(\\\"%s\\\")\\n\", $3);\n#endif\n", n, t, name) of clong: - addf(tl, - "#ifdef $3\n fprintf(f, \" $1* = $2(%ld)\\n\", $3);\n#endif\n", - n, t, name) - else: - addf(tl, - "#ifdef $3\n fprintf(f, \" $1* = $2(%d)\\n\", $3);\n#endif\n", + addf(tl, + "#ifdef $3\n fprintf(f, \" $1* = $2(%ld)\\n\", $3);\n#endif\n", + n, t, name) + else: + addf(tl, + "#ifdef $3\n fprintf(f, \" $1* = $2(%d)\\n\", $3);\n#endif\n", n, t, name) if header("<aio.h>"): @@ -187,7 +187,7 @@ if header("<errno.h>"): v("ETXTBSY") v("EWOULDBLOCK") v("EXDEV") - + if header("<fcntl.h>"): v("F_DUPFD") v("F_GETFD") @@ -346,7 +346,7 @@ if header("<langinfo.h>"): v("YESEXPR") v("NOEXPR") v("CRNCYSTR") - + if header("<locale.h>"): v("LC_ALL") #{.importc, header: .}: cint v("LC_COLLATE") #{.importc, header: "<locale.h>".}: cint @@ -358,20 +358,20 @@ if header("<locale.h>"): if header("<pthread.h>"): v("PTHREAD_BARRIER_SERIAL_THREAD") - v("PTHREAD_CANCEL_ASYNCHRONOUS") - v("PTHREAD_CANCEL_ENABLE") + v("PTHREAD_CANCEL_ASYNCHRONOUS") + v("PTHREAD_CANCEL_ENABLE") v("PTHREAD_CANCEL_DEFERRED") - v("PTHREAD_CANCEL_DISABLE") + v("PTHREAD_CANCEL_DISABLE") #v("PTHREAD_CANCELED") - #v("PTHREAD_COND_INITIALIZER") + #v("PTHREAD_COND_INITIALIZER") v("PTHREAD_CREATE_DETACHED") v("PTHREAD_CREATE_JOINABLE") v("PTHREAD_EXPLICIT_SCHED") - v("PTHREAD_INHERIT_SCHED") - v("PTHREAD_MUTEX_DEFAULT") + v("PTHREAD_INHERIT_SCHED") + v("PTHREAD_MUTEX_DEFAULT") v("PTHREAD_MUTEX_ERRORCHECK") - #v("PTHREAD_MUTEX_INITIALIZER") - v("PTHREAD_MUTEX_NORMAL") + #v("PTHREAD_MUTEX_INITIALIZER") + v("PTHREAD_MUTEX_NORMAL") v("PTHREAD_MUTEX_RECURSIVE") #{.importc, header: "<pthread.h>".}: cint #v("PTHREAD_ONCE_INIT") #{.importc, header: "<pthread.h>".}: cint v("PTHREAD_PRIO_INHERIT") #{.importc, header: "<pthread.h>".}: cint @@ -392,28 +392,28 @@ if header("<unistd.h>"): v("X_OK") v("_CS_PATH") - v("_CS_POSIX_V6_ILP32_OFF32_CFLAGS") - v("_CS_POSIX_V6_ILP32_OFF32_LDFLAGS") - v("_CS_POSIX_V6_ILP32_OFF32_LIBS") - v("_CS_POSIX_V6_ILP32_OFFBIG_CFLAGS") - v("_CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS") - v("_CS_POSIX_V6_ILP32_OFFBIG_LIBS") - v("_CS_POSIX_V6_LP64_OFF64_CFLAGS") + v("_CS_POSIX_V6_ILP32_OFF32_CFLAGS") + v("_CS_POSIX_V6_ILP32_OFF32_LDFLAGS") + v("_CS_POSIX_V6_ILP32_OFF32_LIBS") + v("_CS_POSIX_V6_ILP32_OFFBIG_CFLAGS") + v("_CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS") + v("_CS_POSIX_V6_ILP32_OFFBIG_LIBS") + v("_CS_POSIX_V6_LP64_OFF64_CFLAGS") v("_CS_POSIX_V6_LP64_OFF64_LDFLAGS") - v("_CS_POSIX_V6_LP64_OFF64_LIBS") - v("_CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS") - v("_CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS") - v("_CS_POSIX_V6_LPBIG_OFFBIG_LIBS") + v("_CS_POSIX_V6_LP64_OFF64_LIBS") + v("_CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS") + v("_CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS") + v("_CS_POSIX_V6_LPBIG_OFFBIG_LIBS") v("_CS_POSIX_V6_WIDTH_RESTRICTED_ENVS") - v("F_LOCK") + v("F_LOCK") v("F_TEST") #{.importc: "F_TEST", header: "<unistd.h>".}: cint v("F_TLOCK") #{.importc: "F_TLOCK", header: "<unistd.h>".}: cint v("F_ULOCK") #{.importc: "F_ULOCK", header: "<unistd.h>".}: cint v("_PC_2_SYMLINKS") #{.importc: "_PC_2_SYMLINKS", header: "<unistd.h>".}: cint - v("_PC_ALLOC_SIZE_MIN") + v("_PC_ALLOC_SIZE_MIN") v("_PC_ASYNC_IO") #{.importc: "_PC_ASYNC_IO", header: "<unistd.h>".}: cint - v("_PC_CHOWN_RESTRICTED") + v("_PC_CHOWN_RESTRICTED") v("_PC_FILESIZEBITS") #{.importc: "_PC_FILESIZEBITS", header: "<unistd.h>".}: cint v("_PC_LINK_MAX") #{.importc: "_PC_LINK_MAX", header: "<unistd.h>".}: cint v("_PC_MAX_CANON") #{.importc: "_PC_MAX_CANON", header: "<unistd.h>".}: cint @@ -423,9 +423,9 @@ if header("<unistd.h>"): v("_PC_PATH_MAX") #{.importc: "_PC_PATH_MAX", header: "<unistd.h>".}: cint v("_PC_PIPE_BUF") #{.importc: "_PC_PIPE_BUF", header: "<unistd.h>".}: cint v("_PC_PRIO_IO") #{.importc: "_PC_PRIO_IO", header: "<unistd.h>".}: cint - v("_PC_REC_INCR_XFER_SIZE") - v("_PC_REC_MIN_XFER_SIZE") - v("_PC_REC_XFER_ALIGN") + v("_PC_REC_INCR_XFER_SIZE") + v("_PC_REC_MIN_XFER_SIZE") + v("_PC_REC_XFER_ALIGN") v("_PC_SYMLINK_MAX") #{.importc: "_PC_SYMLINK_MAX", header: "<unistd.h>".}: cint v("_PC_SYNC_IO") #{.importc: "_PC_SYNC_IO", header: "<unistd.h>".}: cint v("_PC_VDISABLE") #{.importc: "_PC_VDISABLE", header: "<unistd.h>".}: cint @@ -436,8 +436,8 @@ if header("<unistd.h>"): v("_SC_2_FORT_RUN") #{.importc: "_SC_2_FORT_RUN", header: "<unistd.h>".}: cint v("_SC_2_LOCALEDEF") #{.importc: "_SC_2_LOCALEDEF", header: "<unistd.h>".}: cint v("_SC_2_PBS") #{.importc: "_SC_2_PBS", header: "<unistd.h>".}: cint - v("_SC_2_PBS_ACCOUNTING") - v("_SC_2_PBS_CHECKPOINT") + v("_SC_2_PBS_ACCOUNTING") + v("_SC_2_PBS_CHECKPOINT") v("_SC_2_PBS_LOCATE") #{.importc: "_SC_2_PBS_LOCATE", header: "<unistd.h>".}: cint v("_SC_2_PBS_MESSAGE") #{.importc: "_SC_2_PBS_MESSAGE", header: "<unistd.h>".}: cint v("_SC_2_PBS_TRACK") #{.importc: "_SC_2_PBS_TRACK", header: "<unistd.h>".}: cint @@ -445,11 +445,11 @@ if header("<unistd.h>"): v("_SC_2_UPE") #{.importc: "_SC_2_UPE", header: "<unistd.h>".}: cint v("_SC_2_VERSION") #{.importc: "_SC_2_VERSION", header: "<unistd.h>".}: cint v("_SC_ADVISORY_INFO") #{.importc: "_SC_ADVISORY_INFO", header: "<unistd.h>".}: cint - v("_SC_AIO_LISTIO_MAX") + v("_SC_AIO_LISTIO_MAX") v("_SC_AIO_MAX") #{.importc: "_SC_AIO_MAX", header: "<unistd.h>".}: cint - v("_SC_AIO_PRIO_DELTA_MAX") + v("_SC_AIO_PRIO_DELTA_MAX") v("_SC_ARG_MAX") #{.importc: "_SC_ARG_MAX", header: "<unistd.h>".}: cint - v("_SC_ASYNCHRONOUS_IO") + v("_SC_ASYNCHRONOUS_IO") v("_SC_ATEXIT_MAX") #{.importc: "_SC_ATEXIT_MAX", header: "<unistd.h>".}: cint v("_SC_BARRIERS") #{.importc: "_SC_BARRIERS", header: "<unistd.h>".}: cint v("_SC_BC_BASE_MAX") #{.importc: "_SC_BC_BASE_MAX", header: "<unistd.h>".}: cint @@ -458,10 +458,10 @@ if header("<unistd.h>"): v("_SC_BC_STRING_MAX") #{.importc: "_SC_BC_STRING_MAX", header: "<unistd.h>".}: cint v("_SC_CHILD_MAX") #{.importc: "_SC_CHILD_MAX", header: "<unistd.h>".}: cint v("_SC_CLK_TCK") #{.importc: "_SC_CLK_TCK", header: "<unistd.h>".}: cint - v("_SC_CLOCK_SELECTION") + v("_SC_CLOCK_SELECTION") v("_SC_COLL_WEIGHTS_MAX") v("_SC_CPUTIME") #{.importc: "_SC_CPUTIME", header: "<unistd.h>".}: cint - v("_SC_DELAYTIMER_MAX") + v("_SC_DELAYTIMER_MAX") v("_SC_EXPR_NEST_MAX") #{.importc: "_SC_EXPR_NEST_MAX", header: "<unistd.h>".}: cint v("_SC_FSYNC") #{.importc: "_SC_FSYNC", header: "<unistd.h>".}: cint v("_SC_GETGR_R_SIZE_MAX") @@ -471,82 +471,82 @@ if header("<unistd.h>"): v("_SC_IPV6") #{.importc: "_SC_IPV6", header: "<unistd.h>".}: cint v("_SC_JOB_CONTROL") #{.importc: "_SC_JOB_CONTROL", header: "<unistd.h>".}: cint v("_SC_LINE_MAX") #{.importc: "_SC_LINE_MAX", header: "<unistd.h>".}: cint - v("_SC_LOGIN_NAME_MAX") + v("_SC_LOGIN_NAME_MAX") v("_SC_MAPPED_FILES") #{.importc: "_SC_MAPPED_FILES", header: "<unistd.h>".}: cint v("_SC_MEMLOCK") #{.importc: "_SC_MEMLOCK", header: "<unistd.h>".}: cint v("_SC_MEMLOCK_RANGE") #{.importc: "_SC_MEMLOCK_RANGE", header: "<unistd.h>".}: cint v("_SC_MEMORY_PROTECTION") - v("_SC_MESSAGE_PASSING") - v("_SC_MONOTONIC_CLOCK") + v("_SC_MESSAGE_PASSING") + v("_SC_MONOTONIC_CLOCK") v("_SC_MQ_OPEN_MAX") #{.importc: "_SC_MQ_OPEN_MAX", header: "<unistd.h>".}: cint v("_SC_MQ_PRIO_MAX") #{.importc: "_SC_MQ_PRIO_MAX", header: "<unistd.h>".}: cint v("_SC_NGROUPS_MAX") #{.importc: "_SC_NGROUPS_MAX", header: "<unistd.h>".}: cint v("_SC_OPEN_MAX") #{.importc: "_SC_OPEN_MAX", header: "<unistd.h>".}: cint v("_SC_PAGE_SIZE") #{.importc: "_SC_PAGE_SIZE", header: "<unistd.h>".}: cint - v("_SC_PRIORITIZED_IO") - v("_SC_PRIORITY_SCHEDULING") + v("_SC_PRIORITIZED_IO") + v("_SC_PRIORITY_SCHEDULING") v("_SC_RAW_SOCKETS") #{.importc: "_SC_RAW_SOCKETS", header: "<unistd.h>".}: cint v("_SC_RE_DUP_MAX") #{.importc: "_SC_RE_DUP_MAX", header: "<unistd.h>".}: cint - v("_SC_READER_WRITER_LOCKS") - v("_SC_REALTIME_SIGNALS") + v("_SC_READER_WRITER_LOCKS") + v("_SC_REALTIME_SIGNALS") v("_SC_REGEXP") #{.importc: "_SC_REGEXP", header: "<unistd.h>".}: cint v("_SC_RTSIG_MAX") #{.importc: "_SC_RTSIG_MAX", header: "<unistd.h>".}: cint v("_SC_SAVED_IDS") #{.importc: "_SC_SAVED_IDS", header: "<unistd.h>".}: cint v("_SC_SEM_NSEMS_MAX") #{.importc: "_SC_SEM_NSEMS_MAX", header: "<unistd.h>".}: cint v("_SC_SEM_VALUE_MAX") #{.importc: "_SC_SEM_VALUE_MAX", header: "<unistd.h>".}: cint v("_SC_SEMAPHORES") #{.importc: "_SC_SEMAPHORES", header: "<unistd.h>".}: cint - v("_SC_SHARED_MEMORY_OBJECTS") + v("_SC_SHARED_MEMORY_OBJECTS") v("_SC_SHELL") #{.importc: "_SC_SHELL", header: "<unistd.h>".}: cint v("_SC_SIGQUEUE_MAX") #{.importc: "_SC_SIGQUEUE_MAX", header: "<unistd.h>".}: cint v("_SC_SPAWN") #{.importc: "_SC_SPAWN", header: "<unistd.h>".}: cint v("_SC_SPIN_LOCKS") #{.importc: "_SC_SPIN_LOCKS", header: "<unistd.h>".}: cint - v("_SC_SPORADIC_SERVER") + v("_SC_SPORADIC_SERVER") v("_SC_SS_REPL_MAX") #{.importc: "_SC_SS_REPL_MAX", header: "<unistd.h>".}: cint v("_SC_STREAM_MAX") #{.importc: "_SC_STREAM_MAX", header: "<unistd.h>".}: cint v("_SC_SYMLOOP_MAX") #{.importc: "_SC_SYMLOOP_MAX", header: "<unistd.h>".}: cint - v("_SC_SYNCHRONIZED_IO") - v("_SC_THREAD_ATTR_STACKADDR") - v("_SC_THREAD_ATTR_STACKSIZE") - v("_SC_THREAD_CPUTIME") - v("_SC_THREAD_DESTRUCTOR_ITERATIONS") - v("_SC_THREAD_KEYS_MAX") - v("_SC_THREAD_PRIO_INHERIT") - v("_SC_THREAD_PRIO_PROTECT") - v("_SC_THREAD_PRIORITY_SCHEDULING") - v("_SC_THREAD_PROCESS_SHARED") - v("_SC_THREAD_SAFE_FUNCTIONS") + v("_SC_SYNCHRONIZED_IO") + v("_SC_THREAD_ATTR_STACKADDR") + v("_SC_THREAD_ATTR_STACKSIZE") + v("_SC_THREAD_CPUTIME") + v("_SC_THREAD_DESTRUCTOR_ITERATIONS") + v("_SC_THREAD_KEYS_MAX") + v("_SC_THREAD_PRIO_INHERIT") + v("_SC_THREAD_PRIO_PROTECT") + v("_SC_THREAD_PRIORITY_SCHEDULING") + v("_SC_THREAD_PROCESS_SHARED") + v("_SC_THREAD_SAFE_FUNCTIONS") v("_SC_THREAD_SPORADIC_SERVER") - v("_SC_THREAD_STACK_MIN") - v("_SC_THREAD_THREADS_MAX") + v("_SC_THREAD_STACK_MIN") + v("_SC_THREAD_THREADS_MAX") v("_SC_THREADS") #{.importc: "_SC_THREADS", header: "<unistd.h>".}: cint v("_SC_TIMEOUTS") #{.importc: "_SC_TIMEOUTS", header: "<unistd.h>".}: cint v("_SC_TIMER_MAX") #{.importc: "_SC_TIMER_MAX", header: "<unistd.h>".}: cint v("_SC_TIMERS") #{.importc: "_SC_TIMERS", header: "<unistd.h>".}: cint v("_SC_TRACE") #{.importc: "_SC_TRACE", header: "<unistd.h>".}: cint - v("_SC_TRACE_EVENT_FILTER") + v("_SC_TRACE_EVENT_FILTER") v("_SC_TRACE_EVENT_NAME_MAX") v("_SC_TRACE_INHERIT") #{.importc: "_SC_TRACE_INHERIT", header: "<unistd.h>".}: cint v("_SC_TRACE_LOG") #{.importc: "_SC_TRACE_LOG", header: "<unistd.h>".}: cint - v("_SC_TRACE_NAME_MAX") + v("_SC_TRACE_NAME_MAX") v("_SC_TRACE_SYS_MAX") #{.importc: "_SC_TRACE_SYS_MAX", header: "<unistd.h>".}: cint - v("_SC_TRACE_USER_EVENT_MAX") + v("_SC_TRACE_USER_EVENT_MAX") v("_SC_TTY_NAME_MAX") #{.importc: "_SC_TTY_NAME_MAX", header: "<unistd.h>".}: cint - v("_SC_TYPED_MEMORY_OBJECTS") + v("_SC_TYPED_MEMORY_OBJECTS") v("_SC_TZNAME_MAX") #{.importc: "_SC_TZNAME_MAX", header: "<unistd.h>".}: cint - v("_SC_V6_ILP32_OFF32") - v("_SC_V6_ILP32_OFFBIG") + v("_SC_V6_ILP32_OFF32") + v("_SC_V6_ILP32_OFFBIG") v("_SC_V6_LP64_OFF64") #{.importc: "_SC_V6_LP64_OFF64", header: "<unistd.h>".}: cint - v("_SC_V6_LPBIG_OFFBIG") + v("_SC_V6_LPBIG_OFFBIG") v("_SC_VERSION") #{.importc: "_SC_VERSION", header: "<unistd.h>".}: cint - v("_SC_XBS5_ILP32_OFF32") - v("_SC_XBS5_ILP32_OFFBIG") - v("_SC_XBS5_LP64_OFF64") - v("_SC_XBS5_LPBIG_OFFBIG") + v("_SC_XBS5_ILP32_OFF32") + v("_SC_XBS5_ILP32_OFFBIG") + v("_SC_XBS5_LP64_OFF64") + v("_SC_XBS5_LPBIG_OFFBIG") v("_SC_XOPEN_CRYPT") #{.importc: "_SC_XOPEN_CRYPT", header: "<unistd.h>".}: cint - v("_SC_XOPEN_ENH_I18N") + v("_SC_XOPEN_ENH_I18N") v("_SC_XOPEN_LEGACY") #{.importc: "_SC_XOPEN_LEGACY", header: "<unistd.h>".}: cint - v("_SC_XOPEN_REALTIME") - v("_SC_XOPEN_REALTIME_THREADS") + v("_SC_XOPEN_REALTIME") + v("_SC_XOPEN_REALTIME_THREADS") v("_SC_XOPEN_SHM") #{.importc: "_SC_XOPEN_SHM", header: "<unistd.h>".}: cint v("_SC_XOPEN_STREAMS") #{.importc: "_SC_XOPEN_STREAMS", header: "<unistd.h>".}: cint v("_SC_XOPEN_UNIX") #{.importc: "_SC_XOPEN_UNIX", header: "<unistd.h>".}: cint @@ -597,7 +597,7 @@ if header("<sys/stat.h>"): if header("<sys/statvfs.h>"): v("ST_RDONLY") #{.importc, header: .}: cint v("ST_NOSUID") #{.importc, header: "<sys/statvfs.h>".}: cint - + if header("<sys/mman.h>"): v("PROT_READ") #{.importc, header: .}: cint v("PROT_WRITE") #{.importc, header: "<sys/mman.h>".}: cint @@ -623,31 +623,31 @@ if header("<sys/mman.h>"): v("POSIX_TYPED_MEM_MAP_ALLOCATABLE") #{.importc, header: "<sys/mman.h>".}: cint if header("<time.h>"): - v("CLOCKS_PER_SEC", clong) + v("CLOCKS_PER_SEC", clong) v("CLOCK_PROCESS_CPUTIME_ID") v("CLOCK_THREAD_CPUTIME_ID") v("CLOCK_REALTIME") - v("TIMER_ABSTIME") - v("CLOCK_MONOTONIC") + v("TIMER_ABSTIME") + v("CLOCK_MONOTONIC") if header("<sys/wait.h>"): v("WNOHANG") #{.importc, header: .}: cint v("WUNTRACED") #{.importc, header: "<sys/wait.h>".}: cint - #v("WEXITSTATUS") - #v("WIFCONTINUED") - #v("WIFEXITED") + #v("WEXITSTATUS") + #v("WIFCONTINUED") + #v("WIFEXITED") #v("WIFSIGNALED") - #v("WIFSTOPPED") - #v("WSTOPSIG") - #v("WTERMSIG") + #v("WIFSTOPPED") + #v("WSTOPSIG") + #v("WTERMSIG") v("WEXITED") #{.importc, header: "<sys/wait.h>".}: cint v("WSTOPPED") #{.importc, header: "<sys/wait.h>".}: cint v("WCONTINUED") #{.importc, header: "<sys/wait.h>".}: cint v("WNOWAIT") #{.importc, header: "<sys/wait.h>".}: cint - v("P_ALL") #{.importc, header: "<sys/wait.h>".}: cint - v("P_PID") #{.importc, header: "<sys/wait.h>".}: cint + v("P_ALL") #{.importc, header: "<sys/wait.h>".}: cint + v("P_PID") #{.importc, header: "<sys/wait.h>".}: cint v("P_PGID") #{.importc, header: "<sys/wait.h>".}: cint - + if header("<signal.h>"): v("SIGEV_NONE") #{.importc, header: "<signal.h>".}: cint v("SIGEV_SIGNAL") #{.importc, header: "<signal.h>".}: cint @@ -776,23 +776,23 @@ if header("<netdb.h>"): v("HOST_NOT_FOUND") v("NO_DATA") - v("NO_RECOVERY") - v("TRY_AGAIN") - - v("AI_PASSIVE") - v("AI_CANONNAME") - v("AI_NUMERICHOST") - v("AI_NUMERICSERV") - v("AI_V4MAPPED") - v("AI_ALL") - v("AI_ADDRCONFIG") - - v("NI_NOFQDN") - v("NI_NUMERICHOST") - v("NI_NAMEREQD") - v("NI_NUMERICSERV") - v("NI_NUMERICSCOPE") - v("NI_DGRAM") + v("NO_RECOVERY") + v("TRY_AGAIN") + + v("AI_PASSIVE") + v("AI_CANONNAME") + v("AI_NUMERICHOST") + v("AI_NUMERICSERV") + v("AI_V4MAPPED") + v("AI_ALL") + v("AI_ADDRCONFIG") + + v("NI_NOFQDN") + v("NI_NUMERICHOST") + v("NI_NAMEREQD") + v("NI_NUMERICSERV") + v("NI_NUMERICSCOPE") + v("NI_DGRAM") v("EAI_AGAIN") v("EAI_BADFLAGS") v("EAI_FAIL") diff --git a/tools/detect/windows_i386_consts.nim b/tools/detect/windows_i386_consts.nim index cd6c475f4..221251f81 100644 --- a/tools/detect/windows_i386_consts.nim +++ b/tools/detect/windows_i386_consts.nim @@ -1,96 +1,96 @@ -# Generated by detect.nim -const - E2BIG* = cint(7) - EACCES* = cint(13) - EAGAIN* = cint(11) - EBADF* = cint(9) - EBUSY* = cint(16) - ECHILD* = cint(10) - EDEADLK* = cint(36) - EDOM* = cint(33) - EEXIST* = cint(17) - EFAULT* = cint(14) - EFBIG* = cint(27) - EILSEQ* = cint(42) - EINTR* = cint(4) - EINVAL* = cint(22) - EIO* = cint(5) - EISDIR* = cint(21) - EMFILE* = cint(24) - EMLINK* = cint(31) - ENAMETOOLONG* = cint(38) - ENFILE* = cint(23) - ENODEV* = cint(19) - ENOENT* = cint(2) - ENOEXEC* = cint(8) - ENOLCK* = cint(39) - ENOMEM* = cint(12) - ENOSPC* = cint(28) - ENOSYS* = cint(40) - ENOTDIR* = cint(20) - ENOTEMPTY* = cint(41) - ENOTSUP* = cint(48) - ENOTTY* = cint(25) - ENXIO* = cint(6) - EPERM* = cint(1) - EPIPE* = cint(32) - ERANGE* = cint(34) - EROFS* = cint(30) - ESPIPE* = cint(29) - ESRCH* = cint(3) - ETIMEDOUT* = cint(10060) - EXDEV* = cint(18) - O_CREAT* = cint(256) - O_EXCL* = cint(1024) - O_TRUNC* = cint(512) - O_APPEND* = cint(8) - O_ACCMODE* = cint(3) - O_RDONLY* = cint(0) - O_RDWR* = cint(2) - O_WRONLY* = cint(1) - FE_DIVBYZERO* = cint(4) - FE_INEXACT* = cint(32) - FE_INVALID* = cint(1) - FE_OVERFLOW* = cint(8) - FE_UNDERFLOW* = cint(16) - FE_ALL_EXCEPT* = cint(63) - FE_DOWNWARD* = cint(1024) - FE_TONEAREST* = cint(0) - FE_TOWARDZERO* = cint(3072) - FE_UPWARD* = cint(2048) - FE_DFL_ENV* = pointer(nil) - LC_ALL* = cint(0) - LC_COLLATE* = cint(1) - LC_CTYPE* = cint(2) - LC_MONETARY* = cint(3) - LC_NUMERIC* = cint(4) - LC_TIME* = cint(5) - F_OK* = cint(0) - R_OK* = cint(4) - W_OK* = cint(2) - X_OK* = cint(1) - SEEK_SET* = cint(0) - SEEK_CUR* = cint(1) - SEEK_END* = cint(2) - S_IFMT* = cint(61440) - S_IFBLK* = cint(12288) - S_IFCHR* = cint(8192) - S_IFIFO* = cint(4096) - S_IFREG* = cint(32768) - S_IFDIR* = cint(16384) - S_IRWXU* = cint(448) - S_IRUSR* = cint(256) - S_IWUSR* = cint(128) - S_IXUSR* = cint(64) - CLOCKS_PER_SEC* = clong(1000) - SIGABRT* = cint(22) - SIGFPE* = cint(8) - SIGILL* = cint(4) - SIGINT* = cint(2) - SIGSEGV* = cint(11) - SIGTERM* = cint(15) - SIG_BLOCK* = cint(0) - SIG_UNBLOCK* = cint(1) - SIG_SETMASK* = cint(2) - IOFBF* = cint(0) - IONBF* = cint(4) +# Generated by detect.nim +const + E2BIG* = cint(7) + EACCES* = cint(13) + EAGAIN* = cint(11) + EBADF* = cint(9) + EBUSY* = cint(16) + ECHILD* = cint(10) + EDEADLK* = cint(36) + EDOM* = cint(33) + EEXIST* = cint(17) + EFAULT* = cint(14) + EFBIG* = cint(27) + EILSEQ* = cint(42) + EINTR* = cint(4) + EINVAL* = cint(22) + EIO* = cint(5) + EISDIR* = cint(21) + EMFILE* = cint(24) + EMLINK* = cint(31) + ENAMETOOLONG* = cint(38) + ENFILE* = cint(23) + ENODEV* = cint(19) + ENOENT* = cint(2) + ENOEXEC* = cint(8) + ENOLCK* = cint(39) + ENOMEM* = cint(12) + ENOSPC* = cint(28) + ENOSYS* = cint(40) + ENOTDIR* = cint(20) + ENOTEMPTY* = cint(41) + ENOTSUP* = cint(48) + ENOTTY* = cint(25) + ENXIO* = cint(6) + EPERM* = cint(1) + EPIPE* = cint(32) + ERANGE* = cint(34) + EROFS* = cint(30) + ESPIPE* = cint(29) + ESRCH* = cint(3) + ETIMEDOUT* = cint(10060) + EXDEV* = cint(18) + O_CREAT* = cint(256) + O_EXCL* = cint(1024) + O_TRUNC* = cint(512) + O_APPEND* = cint(8) + O_ACCMODE* = cint(3) + O_RDONLY* = cint(0) + O_RDWR* = cint(2) + O_WRONLY* = cint(1) + FE_DIVBYZERO* = cint(4) + FE_INEXACT* = cint(32) + FE_INVALID* = cint(1) + FE_OVERFLOW* = cint(8) + FE_UNDERFLOW* = cint(16) + FE_ALL_EXCEPT* = cint(63) + FE_DOWNWARD* = cint(1024) + FE_TONEAREST* = cint(0) + FE_TOWARDZERO* = cint(3072) + FE_UPWARD* = cint(2048) + FE_DFL_ENV* = pointer(nil) + LC_ALL* = cint(0) + LC_COLLATE* = cint(1) + LC_CTYPE* = cint(2) + LC_MONETARY* = cint(3) + LC_NUMERIC* = cint(4) + LC_TIME* = cint(5) + F_OK* = cint(0) + R_OK* = cint(4) + W_OK* = cint(2) + X_OK* = cint(1) + SEEK_SET* = cint(0) + SEEK_CUR* = cint(1) + SEEK_END* = cint(2) + S_IFMT* = cint(61440) + S_IFBLK* = cint(12288) + S_IFCHR* = cint(8192) + S_IFIFO* = cint(4096) + S_IFREG* = cint(32768) + S_IFDIR* = cint(16384) + S_IRWXU* = cint(448) + S_IRUSR* = cint(256) + S_IWUSR* = cint(128) + S_IXUSR* = cint(64) + CLOCKS_PER_SEC* = clong(1000) + SIGABRT* = cint(22) + SIGFPE* = cint(8) + SIGILL* = cint(4) + SIGINT* = cint(2) + SIGSEGV* = cint(11) + SIGTERM* = cint(15) + SIG_BLOCK* = cint(0) + SIG_UNBLOCK* = cint(1) + SIG_SETMASK* = cint(2) + IOFBF* = cint(0) + IONBF* = cint(4) diff --git a/tools/fakedeps.nim b/tools/fakedeps.nim index 80623fafb..6963579dc 100644 --- a/tools/fakedeps.nim +++ b/tools/fakedeps.nim @@ -15,4 +15,4 @@ proc fakedeps() = proc main = fakedeps() when isMainModule: - main() \ No newline at end of file + main() diff --git a/tools/nimgrep.nim b/tools/nimgrep.nim index 72e4adc07..221181f66 100644 --- a/tools/nimgrep.nim +++ b/tools/nimgrep.nim @@ -21,10 +21,10 @@ Options: --find, -f find the pattern (default) --replace, -r replace the pattern --peg pattern is a peg - --re pattern is a regular expression (default); extended + --re pattern is a regular expression (default); extended syntax for the regular expression is always turned on --recursive process directories recursively - --confirm confirm each occurrence/replacement; there is a chance + --confirm confirm each occurrence/replacement; there is a chance to abort any time without touching the file --stdin read pattern from stdin (to avoid the shell's confusing quoting rules) @@ -39,13 +39,13 @@ Options: """ type - TOption = enum + TOption = enum optFind, optReplace, optPeg, optRegex, optRecursive, optConfirm, optStdin, optWord, optIgnoreCase, optIgnoreStyle, optVerbose TOptions = set[TOption] - TConfirmEnum = enum + TConfirmEnum = enum ceAbort, ceYes, ceAll, ceNo, ceNone - + var filenames: seq[string] = @[] pattern = "" @@ -58,34 +58,34 @@ proc ask(msg: string): string = stdout.write(msg) result = stdin.readLine() -proc confirm: TConfirmEnum = +proc confirm: TConfirmEnum = while true: case normalize(ask(" [a]bort; [y]es, a[l]l, [n]o, non[e]: ")) - of "a", "abort": return ceAbort + of "a", "abort": return ceAbort of "y", "yes": return ceYes of "l", "all": return ceAll of "n", "no": return ceNo of "e", "none": return ceNone else: discard -proc countLines(s: string, first, last: int): int = +proc countLines(s: string, first, last: int): int = var i = first while i <= last: - if s[i] == '\13': + if s[i] == '\13': inc result if i < last and s[i+1] == '\10': inc(i) - elif s[i] == '\10': + elif s[i] == '\10': inc result inc i -proc beforePattern(s: string, first: int): int = +proc beforePattern(s: string, first: int): int = result = first-1 while result >= 0: if s[result] in NewLines: break dec(result) inc(result) -proc afterPattern(s: string, last: int): int = +proc afterPattern(s: string, last: int): int = result = last+1 while result < s.len: if s[result] in NewLines: break @@ -99,7 +99,7 @@ proc writeColored(s: string) = stdout.write(s) proc highlight(s, match, repl: string, t: tuple[first, last: int], - line: int, showRepl: bool) = + line: int, showRepl: bool) = const alignment = 6 stdout.write(line.`$`.align(alignment), ": ") var x = beforePattern(s, t.first) @@ -118,17 +118,17 @@ proc highlight(s, match, repl: string, t: tuple[first, last: int], proc processFile(filename: string) = var filenameShown = false template beforeHighlight = - if not filenameShown and optVerbose notin options: - stdout.writeln(filename) + if not filenameShown and optVerbose notin options: + stdout.writeLine(filename) filenameShown = true - + var buffer: string try: buffer = system.readFile(filename) - except IOError: + except IOError: echo "cannot open file: ", filename return - if optVerbose in options: stdout.writeln(filename) + if optVerbose in options: stdout.writeLine(filename) var pegp: TPeg var rep: Regex var result: string @@ -140,10 +140,10 @@ proc processFile(filename: string) = rep = re(pattern) else: pegp = peg(pattern) - + if optReplace in options: result = newStringOfCap(buffer.len) - + var line = 1 var i = 0 var matches: array[0..re.MaxSubpatterns-1, string] @@ -157,24 +157,24 @@ proc processFile(filename: string) = t = findBounds(buffer, rep, matches, i) if t.first <= 0: break inc(line, countLines(buffer, i, t.first-1)) - + var wholeMatch = buffer.substr(t.first, t.last) - + beforeHighlight() - if optReplace notin options: + if optReplace notin options: highlight(buffer, wholeMatch, "", t, line, showRepl=false) else: var r: string if optRegex notin options: r = replace(wholeMatch, pegp, replacement % matches) - else: + else: r = replace(wholeMatch, rep, replacement % matches) - if optConfirm in options: + if optConfirm in options: highlight(buffer, wholeMatch, r, t, line, showRepl=true) case confirm() of ceAbort: quit(0) - of ceYes: reallyReplace = true - of ceAll: + of ceYes: reallyReplace = true + of ceAll: reallyReplace = true options.excl(optConfirm) of ceNo: @@ -203,11 +203,11 @@ proc processFile(filename: string) = proc hasRightExt(filename: string, exts: seq[string]): bool = var y = splitFile(filename).ext.substr(1) # skip leading '.' - for x in items(exts): + for x in items(exts): if os.cmpPaths(x, y) == 0: return true -proc styleInsensitive(s: string): string = - template addx: stmt = +proc styleInsensitive(s: string): string = + template addx: stmt = result.add(s[i]) inc(i) result = "" @@ -215,7 +215,7 @@ proc styleInsensitive(s: string): string = var brackets = 0 while i < s.len: case s[i] - of 'A'..'Z', 'a'..'z', '0'..'9': + of 'A'..'Z', 'a'..'z', '0'..'9': addx() if brackets == 0: result.add("_?") of '_': @@ -234,29 +234,29 @@ proc styleInsensitive(s: string): string = while s[i] != '>' and s[i] != '\0': addx() of '\\': addx() - if s[i] in strutils.Digits: + if s[i] in strutils.Digits: while s[i] in strutils.Digits: addx() else: addx() else: addx() -proc walker(dir: string) = +proc walker(dir: string) = for kind, path in walkDir(dir): case kind - of pcFile: + of pcFile: if extensions.len == 0 or path.hasRightExt(extensions): processFile(path) - of pcDir: + of pcDir: if optRecursive in options: walker(path) else: discard if existsFile(dir): processFile(dir) -proc writeHelp() = +proc writeHelp() = stdout.write(Usage) quit(0) -proc writeVersion() = +proc writeVersion() = stdout.write(Version & "\n") quit(0) @@ -267,9 +267,9 @@ proc checkOptions(subset: TOptions, a, b: string) = for kind, key, val in getopt(): case kind of cmdArgument: - if options.contains(optStdin): + if options.contains(optStdin): filenames.add(key) - elif pattern.len == 0: + elif pattern.len == 0: pattern = key elif options.contains(optReplace) and replacement.len == 0: replacement = key @@ -306,7 +306,7 @@ checkOptions({optFind, optReplace}, "find", "replace") checkOptions({optPeg, optRegex}, "peg", "re") checkOptions({optIgnoreCase, optIgnoreStyle}, "ignore_case", "ignore_style") -if optStdin in options: +if optStdin in options: pattern = ask("pattern [ENTER to exit]: ") if isNil(pattern) or pattern.len == 0: quit(0) if optReplace in options: @@ -314,18 +314,18 @@ if optStdin in options: if pattern.len == 0: writeHelp() -else: - if filenames.len == 0: +else: + if filenames.len == 0: filenames.add(os.getCurrentDir()) - if optRegex notin options: + if optRegex notin options: if optWord in options: pattern = r"(^ / !\letter)(" & pattern & r") !\letter" - if optIgnoreStyle in options: + if optIgnoreStyle in options: pattern = "\\y " & pattern elif optIgnoreCase in options: pattern = "\\i " & pattern else: - if optIgnoreStyle in options: + if optIgnoreStyle in options: pattern = styleInsensitive(pattern) if optWord in options: pattern = r"\b (:?" & pattern & r") \b" diff --git a/tools/niminst/buildbat.tmpl b/tools/niminst/buildbat.tmpl index 3a11715bf..2a8da144d 100644 --- a/tools/niminst/buildbat.tmpl +++ b/tools/niminst/buildbat.tmpl @@ -1,4 +1,4 @@ -#! stdtmpl(subsChar='?') | standard +#? stdtmpl(subsChar='?') | standard #proc generateBuildBatchScript(c: ConfigData, winIndex, cpuIndex: int): string = # result = "@echo off\nREM Generated by niminst\n" SET CC=gcc @@ -18,13 +18,13 @@ REM call the compiler: # for ff in items(c.cfiles[winIndex][cpuIndex]): # let f = ff.toWin ECHO %CC% %COMP_FLAGS% -Ic_code -c ?{f} -o ?{changeFileExt(f, "o")} -%CC% %COMP_FLAGS% -Ic_code -c ?{f} -o ?{changeFileExt(f, "o")} +CALL %CC% %COMP_FLAGS% -Ic_code -c ?{f} -o ?{changeFileExt(f, "o")} # linkCmd.add(" " & changeFileExt(f, "o")) IF ERRORLEVEL 1 (GOTO:END) # end for ECHO %LINKER% -o ?{"%BIN_DIR%"\toLower(c.name)}.exe ?linkCmd %LINK_FLAGS% -%LINKER% -o ?{"%BIN_DIR%"\toLower(c.name)}.exe ?linkCmd %LINK_FLAGS% +CALL %LINKER% -o ?{"%BIN_DIR%"\toLower(c.name)}.exe ?linkCmd %LINK_FLAGS% # end block diff --git a/tools/niminst/buildsh.tmpl b/tools/niminst/buildsh.tmpl index 52da351be..463a1ad52 100644 --- a/tools/niminst/buildsh.tmpl +++ b/tools/niminst/buildsh.tmpl @@ -1,4 +1,4 @@ -#! stdtmpl(subsChar='?') | standard +#? stdtmpl(subsChar='?') | standard #proc generateBuildShellScript(c: ConfigData): string = # result = "#! /bin/sh\n# Generated from niminst\n" & # "# Template is in tools/niminst/buildsh.tmpl\n" & diff --git a/tools/niminst/debcreation.nim b/tools/niminst/debcreation.nim index bbd997981..36b2a29ec 100644 --- a/tools/niminst/debcreation.nim +++ b/tools/niminst/debcreation.nim @@ -38,33 +38,33 @@ proc createControl(pkgName, maintainer, shortDesc, desc: string, ## Multiple dependencies should be separated by commas. ## pkgDepends: Same as buildDepends except that this specifies the ## dependencies that the compiled application depends on. - - + + result = "" - + addN("Source: " & pkgName) addN("Maintainer: " & maintainer) addN("Section: misc") addN("Priority: optional") addN("Standards-Version: 3.9.2") - addN("Build-Depends: debhelper (>= 8)" & + addN("Build-Depends: debhelper (>= 8)" & (if buildDepends != "": ", " & buildDepends else: "")) addN("\n") addN("Package: " & pkgName) addN("Architecture: any") addN("Depends: ${shlibs:Depends}, ${misc:Depends}" & (if pkgDepends != "": ", " & pkgDepends else: "")) - + var formattedDesc = "" for line in splitLines(desc): if line == "": formattedDesc.add(" .\n") else: formattedDesc.add(" " & line & "\n") - + addN("Description: " & shortDesc & "\n" & formattedDesc) -proc createCopyright(pkgName, mtnName, mtnEmail, version: string, +proc createCopyright(pkgName, mtnName, mtnEmail, version: string, licenses: seq[tuple[files, license: string]]): string = ## pkgName: Package name ## mtnName: Maintainer name @@ -73,7 +73,7 @@ proc createCopyright(pkgName, mtnName, mtnEmail, version: string, ## licenses: files: This specifies the files that the `license` covers, ## for example, it might be ``lib/*`` to cover the whole ``lib`` dir ## license: This specifies the license, for example gpl2, or lgpl. - + result = "" addN("Maintainer name: " & mtnName) addN("Email-Address: " & mtnEmail) @@ -86,7 +86,7 @@ proc createCopyright(pkgName, mtnName, mtnEmail, version: string, proc formatDateTime(t: TimeInfo, timezone: string): string = var day = ($t.weekday)[0..2] & ", " - + return "$1$2 $3 $4 $5:$6:$7 $8" % [day, intToStr(t.monthday, 2), ($t.month)[0..2], $t.year, intToStr(t.hour, 2), intToStr(t.minute, 2), intToStr(t.second, 2), timezone] @@ -147,41 +147,41 @@ proc prepDeb*(packName, version, mtnName, mtnEmail, shortDesc, desc: string, buildDepends, pkgDepends = "") = ## binaries/config/docs/lib: files relative to nim's root, that need to ## be installed. - + let pkgName = packName.toLower() - + var workingDir = getTempDir() / "niminst" / "deb" var upstreamSource = (pkgName & "-" & version) - + echo("Making sure build.sh and install.sh are +x") - assertSuccess execCmd("chmod +x \"" & + assertSuccess execCmd("chmod +x \"" & (workingDir / upstreamSource / "build.sh") & "\"") - assertSuccess execCmd("chmod +x \"" & + assertSuccess execCmd("chmod +x \"" & (workingDir / upstreamSource / "install.sh") & "\"") - - var tarCmd = "tar pczf \"" & + + var tarCmd = "tar pczf \"" & (pkgName & "_" & version & ".orig.tar.gz") & - "\" \"" & upstreamSource & "\"" + "\" \"" & upstreamSource & "\"" echo(tarCmd) assertSuccess execCmd("cd \"" & workingDir & "\" && " & tarCmd) - + echo("Creating necessary files in debian/") createDir(workingDir / upstreamSource / "debian") - + template writeDebian(f, s: string): expr = writeFile(workingDir / upstreamSource / "debian" / f, s) - + var controlFile = createControl(pkgName, makeMtn(mtnName, mtnEmail), shortDesc, desc, buildDepends, pkgDepends) echo("debian/control") writeDebian("control", controlFile) - + var copyrightFile = createCopyright(pkgName, mtnName, mtnEmail, version, licenses) echo("debian/copyright") writeDebian("copyright", copyrightFile) - var changelogFile = createChangelog(pkgName, version, + var changelogFile = createChangelog(pkgName, version, makeMtn(mtnName, mtnEmail)) echo("debian/changelog") writeDebian("changelog", changelogFile) @@ -206,7 +206,7 @@ proc prepDeb*(packName, version, mtnName, mtnEmail, shortDesc, desc: string, createIncludeBinaries(binaries)) echo("All done, you can now build.") - echo("Before you do however, make sure the files in " & + echo("Before you do however, make sure the files in " & workingDir / upstreamSource / "debian" & " are correct.") echo("Change your directory to: " & workingDir / upstreamSource) echo("And execute `debuild -us -uc` to build the .deb") @@ -214,22 +214,22 @@ proc prepDeb*(packName, version, mtnName, mtnEmail, shortDesc, desc: string, when isMainModule: #var controlFile = createControl("nim", "Dominik Picheta <morfeusz8@gmail.com>", # "The Nim compiler", "Compiler for the Nim programming language", "gcc (>= 4:4.3.2)", "gcc (>= 4:4.3.2)") - + #echo(controlFile) - + #var copyrightFile = createCopyright("nim", "Dominik Picheta", "morfeusz8@a.b", "0.8.14", # @[("bin/nim", "gpl2"), ("lib/*", "lgpl")]) - + #echo copyrightFile - + #var changelogFile = createChangelog("nim", "0.8.14", "Dom P <m@b.c>") #echo(changelogFile) - + #echo(createRules()) - prepDeb("nim", "0.9.2", "Dominik Picheta", "morfeusz8@gmail.com", + prepDeb("nim", "0.9.2", "Dominik Picheta", "morfeusz8@gmail.com", "The Nim compiler", "Compiler for the Nim programming language", - @[("bin/nim", "MIT"), ("lib/*", "MIT")], + @[("bin/nim", "MIT"), ("lib/*", "MIT")], @["bin/nim"], @["config/*"], @["doc/*"], @["lib/*"], "gcc (>= 4:4.3.2)", "gcc (>= 4:4.3.2)") diff --git a/tools/niminst/deinstall.tmpl b/tools/niminst/deinstall.tmpl index c4717a257..7349abcb4 100644 --- a/tools/niminst/deinstall.tmpl +++ b/tools/niminst/deinstall.tmpl @@ -1,4 +1,4 @@ -#! stdtmpl(subsChar='?') | standard +#? stdtmpl(subsChar='?') | standard #proc generateDeinstallScript(c: ConfigData): string = # result = "#! /bin/sh\n# Generated by niminst\n" # var proj = c.name.toLower diff --git a/tools/niminst/inno.tmpl b/tools/niminst/inno.tmpl index 4acf0557c..ef2da8a75 100644 --- a/tools/niminst/inno.tmpl +++ b/tools/niminst/inno.tmpl @@ -1,4 +1,4 @@ -#! stdtmpl | standard +#? stdtmpl | standard #proc generateInnoSetup(c: ConfigData): string = # result = "" ; Default Template for NimInst diff --git a/tools/niminst/install.tmpl b/tools/niminst/install.tmpl index 3ec42c287..14d88e07d 100644 --- a/tools/niminst/install.tmpl +++ b/tools/niminst/install.tmpl @@ -1,4 +1,4 @@ -#! stdtmpl(subsChar = '?') | standard +#? stdtmpl(subsChar = '?') | standard #proc generateInstallScript(c: ConfigData): string = # result = "#! /bin/sh\n# Generated by niminst\n" # var proj = c.name.toLower diff --git a/tools/niminst/makefile.tmpl b/tools/niminst/makefile.tmpl index 8ab3b89d1..6615ddc02 100644 --- a/tools/niminst/makefile.tmpl +++ b/tools/niminst/makefile.tmpl @@ -1,4 +1,4 @@ -#! stdtmpl(subsChar='?') | standard +#? stdtmpl(subsChar='?') | standard #proc generateMakefile(c: ConfigData): string = # result = "# Generated from niminst\n" & # "# Template is in tools/niminst/makefile.tmpl\n" & diff --git a/tools/niminst/niminst.nim b/tools/niminst/niminst.nim index e50b251d3..d1216701f 100644 --- a/tools/niminst/niminst.nim +++ b/tools/niminst/niminst.nim @@ -8,7 +8,7 @@ # const - haveZipLib = defined(unix) + haveZipLib = false # zip not in stdlib anymore when haveZipLib: import zipfiles @@ -35,6 +35,7 @@ type actionNsis, # action: create NSIS installer actionScripts # action: create install and deinstall scripts actionZip, # action: create zip file + actionXz, # action: create xz file actionDeb # action: prepare deb package FileCategory = enum @@ -171,6 +172,7 @@ proc parseCmdLine(c: var ConfigData) = of "csource": incl(c.actions, actionCSource) of "scripts": incl(c.actions, actionScripts) of "zip": incl(c.actions, actionZip) + of "xz": incl(c.actions, actionXz) of "inno": incl(c.actions, actionInno) of "nsis": incl(c.actions, actionNsis) of "deb": incl(c.actions, actionDeb) @@ -181,10 +183,10 @@ proc parseCmdLine(c: var ConfigData) = break of cmdLongoption, cmdShortOption: case normalize(key.string) - of "help", "h": + of "help", "h": stdout.write(Usage) quit(0) - of "version", "v": + of "version", "v": stdout.write(Version & "\n") quit(0) of "o", "output": c.outdir = val @@ -240,7 +242,7 @@ proc incl(s: var seq[string], x: string): int = for i in 0.. <s.len: if cmpIgnoreStyle(s[i], x) == 0: return i s.add(x) - result = s.len-1 + result = s.len-1 proc platforms(c: var ConfigData, v: string) = for line in splitLines(v): @@ -277,17 +279,17 @@ proc parseIniFile(c: var ConfigData) = of "name": c.name = v of "displayname": c.displayName = v of "version": c.version = v - of "os": + of "os": c.oses = split(v, {';'}) hasCpuOs = true if c.explicitPlatforms: quit(errorStr(p, "you cannot have both 'platforms' and 'os'")) - of "cpu": + of "cpu": c.cpus = split(v, {';'}) hasCpuOs = true if c.explicitPlatforms: quit(errorStr(p, "you cannot have both 'platforms' and 'cpu'")) - of "platforms": + of "platforms": platforms(c, v) c.explicitPlatforms = true if hasCpuOs: @@ -389,7 +391,7 @@ proc readCFiles(c: var ConfigData, osA, cpuA: int) = of cfgKeyValuePair: case section of "ccompiler": pathFlags(p, k.key, k.value, c.ccompiler) - of "linker": + of "linker": pathFlags(p, k.key, k.value, c.linker) # HACK: we conditionally add ``-lm -ldl``, so remove them from the # linker flags: @@ -536,7 +538,7 @@ when haveZipLib: var n = "$#.zip" % proj if c.outdir.len == 0: n = "build" / n else: n = c.outdir / n - var z: TZipArchive + var z: ZipArchive if open(z, n, fmWrite): addFile(z, proj / buildBatFile32, "build" / buildBatFile32) addFile(z, proj / buildBatFile64, "build" / buildBatFile64) @@ -558,28 +560,66 @@ when haveZipLib: else: quit("Cannot open for writing: " & n) +proc xzDist(c: var ConfigData) = + let proj = toLower(c.name) & "-" & c.version + var n = "$#.tar.xz" % proj + let tmpDir = if c.outdir.len == 0: "build" else: c.outdir + + template processFile(z, dest, src) = + let s = src + let d = dest + echo "Copying ", s, " to ", tmpDir / d + let destdir = tmpdir / d.splitFile.dir + if not dirExists(destdir): createDir(destdir) + copyFileWithPermissions(s, tmpDir / d) + + processFile(z, proj / buildBatFile32, "build" / buildBatFile32) + processFile(z, proj / buildBatFile64, "build" / buildBatFile64) + processFile(z, proj / buildShFile, "build" / buildShFile) + processFile(z, proj / makeFile, "build" / makeFile) + processFile(z, proj / installShFile, installShFile) + processFile(z, proj / deinstallShFile, deinstallShFile) + for f in walkFiles(c.libpath / "lib/*.h"): + processFile(z, proj / "c_code" / extractFilename(f), f) + for osA in 1..c.oses.len: + for cpuA in 1..c.cpus.len: + var dir = buildDir(osA, cpuA) + for k, f in walkDir("build" / dir): + if k == pcFile: processFile(z, proj / dir / extractFilename(f), f) + + for cat in items({fcConfig..fcOther, fcUnix}): + for f in items(c.cat[cat]): processFile(z, proj / f, f) + + let oldDir = getCurrentDir() + setCurrentDir(tmpDir) + try: + if execShellCmd("XZ_OPT=-9 tar Jcf $1.tar.xz $1" % proj) != 0: + echo("External program failed") + finally: + setCurrentDir(oldDir) + # -- prepare build files for .deb creation proc debDist(c: var ConfigData) = if not existsFile(getOutputDir(c) / "build.sh"): quit("No build.sh found.") if not existsFile(getOutputDir(c) / "install.sh"): quit("No install.sh found.") - + if c.debOpts.shortDesc == "": quit("shortDesc must be set in the .ini file.") if c.debOpts.licenses.len == 0: echo("[Warning] No licenses specified for .deb creation.") - + # -- Copy files into /tmp/.. echo("Copying source to tmp/niminst/deb/") var currentSource = getCurrentDir() var workingDir = getTempDir() / "niminst" / "deb" var upstreamSource = (c.name.toLower() & "-" & c.version) - + createDir(workingDir / upstreamSource) - + template copyNimDist(f, dest: string): stmt = createDir((workingDir / upstreamSource / dest).splitFile.dir) copyFile(currentSource / f, workingDir / upstreamSource / dest) - + # Don't copy all files, only the ones specified in the config: copyNimDist(buildShFile, buildShFile) copyNimDist(makeFile, makeFile) @@ -624,5 +664,7 @@ if actionZip in c.actions: zipDist(c) else: quit("libzip is not installed") +if actionXz in c.actions: + xzDist(c) if actionDeb in c.actions: debDist(c) diff --git a/tools/niminst/nsis.tmpl b/tools/niminst/nsis.tmpl index c21bfb9d5..abf462388 100644 --- a/tools/niminst/nsis.tmpl +++ b/tools/niminst/nsis.tmpl @@ -1,5 +1,5 @@ -#! stdtmpl(subsChar='?') | standard -#proc generateNsisSetup(c: ConfigData): string = +#? stdtmpl(subsChar='?') | standard +#proc generateNsisSetup(c: ConfigData): string = # result = "; NSIS script generated by niminst\n" & # "; To regenerate run ``niminst nsis`` or ``koch nsis``\n" @@ -35,8 +35,8 @@ ; Default installation folder ; This is changed later (in .onInit) to the root directory, if possible. - InstallDir "$LOCALAPPDATA\?{c.name}" - + InstallDir "$LOCALAPPDATA\?{c.name}-?{c.version}" + ; Get installation folder from registry if available InstallDirRegKey HKCU "Software\c.name\c.version" "" @@ -86,14 +86,14 @@ !insertmacro MUI_PAGE_INSTFILES !insertmacro MUI_PAGE_FINISH - + ; Setup the uninstaller pages !insertmacro MUI_UNPAGE_CONFIRM !insertmacro MUI_UNPAGE_INSTFILES - + ;-------------------------------- ;Languages - + !insertmacro MUI_LANGUAGE "English" ;-------------------------------- @@ -104,7 +104,7 @@ ; Nim binary. Section "Core Files" CoreSection ; This is a mandotory section - SectionIn RO + SectionIn RO ; Output files to the base installation directory SetOutPath "$INSTDIR" @@ -164,7 +164,7 @@ ; The downloadable sections. These sections are automatically generated by ; niminst and the template filters. - #var i = 0 + #var i = 0 #for download in c.downloads: # inc i # let d = download.split('|') @@ -207,7 +207,7 @@ CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\?{e}.lnk" "$INSTDIR\?dir\?{startMenuEntry.toWin}" !insertmacro MUI_STARTMENU_WRITE_END # end if - + ignore: SectionEnd #end diff --git a/tools/nimrepl.nim b/tools/nimrepl.nim index 3d818a556..ac82d8b75 100644 --- a/tools/nimrepl.nim +++ b/tools/nimrepl.nim @@ -15,10 +15,10 @@ else: const runCmd = "c -r" var nimExe = findExe("nim") -if nimExe.len == 0: nimExe = "../bin" / addFileExt("nim", os.exeExt) +if nimExe.len == 0: nimExe = "../bin" / addFileExt("nim", os.ExeExt) proc execCode(code: string): string = - var f: TFile + var f: File if open(f, "temp.nim", fmWrite): f.write(code) f.close() @@ -28,145 +28,145 @@ proc execCode(code: string): string = else: result = "cannot open file 'temp.nim'" -var shiftPressed = False +var shiftPressed = false var w: gtk2.PWindow -var InputTextBuffer: PTextBuffer -var OutputTextBuffer: PTextBuffer +var inputTextBuffer: PTextBuffer +var outputTextBuffer: PTextBuffer -proc destroy(widget: PWidget, data: pgpointer){.cdecl.} = +proc destroy(widget: PWidget, data: pointer){.cdecl.} = main_quit() -proc fileOpenClicked(menuitem: PMenuItem, userdata: pgpointer) {.cdecl.} = - var path = ChooseFileToOpen(w) +proc fileOpenClicked(menuitem: PMenuItem, userdata: pointer) {.cdecl.} = + var path = chooseFileToOpen(w) if path != "": var file = readFile(path) if file != nil: - set_text(InputTextBuffer, file, len(file).gint) + set_text(inputTextBuffer, file, len(file).gint) else: error(w, "Unable to read from file") -proc fileSaveClicked(menuitem: PMenuItem, userdata: pgpointer) {.cdecl.} = - var path = ChooseFileToSave(w) - +proc fileSaveClicked(menuitem: PMenuItem, userdata: pointer) {.cdecl.} = + var path = chooseFileToSave(w) + if path == "": return var startIter: TTextIter var endIter: TTextIter - get_start_iter(InputTextBuffer, addr(startIter)) - get_end_iter(InputTextBuffer, addr(endIter)) - var InputText = get_text(InputTextBuffer, addr(startIter), - addr(endIter), False) - var f: TFile + get_start_iter(inputTextBuffer, addr(startIter)) + get_end_iter(inputTextBuffer, addr(endIter)) + var inputText = get_text(inputTextBuffer, addr(startIter), + addr(endIter), false) + var f: File if open(f, path, fmWrite): - f.write(InputText) + f.write(inputText) f.close() else: error(w, "Unable to write to file") -proc inputKeyPressed(widget: PWidget, event: PEventKey, - userdata: pgpointer): bool {.cdecl.} = +proc inputKeyPressed(widget: PWidget, event: PEventKey, + userdata: pointer): bool {.cdecl.} = if ($keyval_name(event.keyval)).tolower() == "shift_l": # SHIFT is pressed - shiftPressed = True - -proc setError(msg: string) = + shiftPressed = true + +proc setError(msg: string) = outputTextBuffer.setText(msg, msg.len.gint) - -proc inputKeyReleased(widget: PWidget, event: PEventKey, - userdata: pgpointer): bool {.cdecl.} = + +proc inputKeyReleased(widget: PWidget, event: PEventKey, + userdata: pointer): bool {.cdecl.} = #echo(keyval_name(event.keyval)) if ($keyval_name(event.keyval)).tolower() == "shift_l": # SHIFT is released - shiftPressed = False - + shiftPressed = false + if ($keyval_name(event.keyval)).tolower() == "return": #echo($keyval_name(event.keyval), "Shift_L") # Enter pressed - if shiftPressed == False: + if not shiftPressed: var startIter: TTextIter var endIter: TTextIter - get_start_iter(InputTextBuffer, addr(startIter)) - get_end_iter(InputTextBuffer, addr(endIter)) - var InputText = get_text(InputTextBuffer, addr(startIter), - addr(endIter), False) + get_start_iter(inputTextBuffer, addr(startIter)) + get_end_iter(inputTextBuffer, addr(endIter)) + var inputText = get_text(inputTextBuffer, addr(startIter), + addr(endIter), false) try: - var r = execCode($InputText) - set_text(OutputTextBuffer, r, len(r).gint) - except EIO: + var r = execCode($inputText) + set_text(outputTextBuffer, r, len(r).gint) + except IOError: setError("Error: Could not open file temp.nim") proc initControls() = w = window_new(gtk2.WINDOW_TOPLEVEL) set_default_size(w, 500, 600) - set_title(w, "Nimrod REPL") + set_title(w, "Nim REPL") discard signal_connect(w, "destroy", SIGNAL_FUNC(nimrepl.destroy), nil) - + # MainBox (vbox) - var MainBox = vbox_new(False, 0) - add(w, MainBox) - + var mainBox = vbox_new(false, 0) + add(w, mainBox) + # TopMenu (MenuBar) - var TopMenu = menu_bar_new() - show(TopMenu) - - var FileMenu = menu_new() - var OpenMenuItem = menu_item_new("Open") - append(FileMenu, OpenMenuItem) - show(OpenMenuItem) - discard signal_connect(OpenMenuItem, "activate", + var topMenu = menu_bar_new() + show(topMenu) + + var fileMenu = menu_new() + var openMenuItem = menu_item_new("Open") + append(fileMenu, openMenuItem) + show(openMenuItem) + discard signal_connect(openMenuItem, "activate", SIGNAL_FUNC(fileOpenClicked), nil) - var SaveMenuItem = menu_item_new("Save...") - append(FileMenu, SaveMenuItem) - show(SaveMenuItem) - discard signal_connect(SaveMenuItem, "activate", + var saveMenuItem = menu_item_new("Save...") + append(fileMenu, saveMenuItem) + show(saveMenuItem) + discard signal_connect(saveMenuItem, "activate", SIGNAL_FUNC(fileSaveClicked), nil) - var FileMenuItem = menu_item_new("File") + var fileMenuItem = menu_item_new("File") - - set_submenu(FileMenuItem, FileMenu) - show(FileMenuItem) - append(TopMenu, FileMenuItem) - - pack_start(MainBox, TopMenu, False, False, 0) + + set_submenu(fileMenuItem, fileMenu) + show(fileMenuItem) + append(topMenu, fileMenuItem) + + pack_start(mainBox, topMenu, false, false, 0) # VPaned - Separates the InputTextView and the OutputTextView var paned = vpaned_new() set_position(paned, 450) - pack_start(MainBox, paned, True, True, 0) + pack_start(mainBox, paned, true, true, 0) show(paned) # Init the TextBuffers - InputTextBuffer = text_buffer_new(nil) - OutputTextBuffer = text_buffer_new(nil) + inputTextBuffer = text_buffer_new(nil) + outputTextBuffer = text_buffer_new(nil) # InputTextView (TextView) - var InputScrolledWindow = scrolled_window_new(nil, nil) - set_policy(InputScrolledWindow, POLICY_AUTOMATIC, POLICY_AUTOMATIC) - var InputTextView = text_view_new(InputTextBuffer) - add_with_viewport(InputScrolledWindow, InputTextView) - add1(paned, InputScrolledWindow) - show(InputScrolledWindow) - show(InputTextView) - - discard signal_connect(InputTextView, "key-release-event", + var inputScrolledWindow = scrolled_window_new(nil, nil) + set_policy(inputScrolledWindow, POLICY_AUTOMATIC, POLICY_AUTOMATIC) + var inputTextView = text_view_new(inputTextBuffer) + add_with_viewport(inputScrolledWindow, inputTextView) + add1(paned, inputScrolledWindow) + show(inputScrolledWindow) + show(inputTextView) + + discard signal_connect(inputTextView, "key-release-event", SIGNAL_FUNC(inputKeyReleased), nil) - discard signal_connect(InputTextView, "key-press-event", + discard signal_connect(inputTextView, "key-press-event", SIGNAL_FUNC(inputKeyPressed), nil) - + # OutputTextView (TextView) - var OutputScrolledWindow = scrolled_window_new(nil, nil) - set_policy(OutputScrolledWindow, POLICY_AUTOMATIC, POLICY_AUTOMATIC) - var OutputTextView = text_view_new(OutputTextBuffer) - add_with_viewport(OutputScrolledWindow, OutputTextView) - add2(paned, OutputScrolledWindow) - show(OutputScrolledWindow) - show(OutputTextView) - + var outputScrolledWindow = scrolled_window_new(nil, nil) + set_policy(outputScrolledWindow, POLICY_AUTOMATIC, POLICY_AUTOMATIC) + var outputTextView = text_view_new(outputTextBuffer) + add_with_viewport(outputScrolledWindow, outputTextView) + add2(paned, outputScrolledWindow) + show(outputScrolledWindow) + show(outputTextView) + show(w) - show(MainBox) - -nimrod_init() + show(mainBox) + +nim_init() initControls() main() diff --git a/tools/nimweb.nim b/tools/nimweb.nim index a7301195e..d94a75162 100644 --- a/tools/nimweb.nim +++ b/tools/nimweb.nim @@ -48,7 +48,7 @@ proc initConfigData(c: var TConfigData) = c.logo = "" c.ticker = "" c.vars = newStringTable(modeStyleInsensitive) - c.gitRepo = "https://github.com/Araq/Nim/tree" + c.gitRepo = "https://github.com/nim-lang/Nim/tree" c.gitCommit = "master" c.numProcessors = countProcessors() # Attempts to obtain the git current commit. @@ -126,10 +126,10 @@ proc parseCmdLine(c: var TConfigData) = break of cmdLongOption, cmdShortOption: case normalize(key) - of "help", "h": + of "help", "h": stdout.write(usage) quit(0) - of "version", "v": + of "version", "v": stdout.write(version & "\n") quit(0) of "o", "output": c.outdir = val @@ -334,7 +334,7 @@ proc parseNewsTitles(inputFilename: string): seq[TRssItem] = result = @[] if not open(input, inputFilename): quit("Could not read $1 for rss generation" % [inputFilename]) - finally: input.close() + defer: input.close() while input.readLine(line): if line =~ reYearMonthDayTitle: result.add(TRssItem(year: matches[0], month: matches[1], day: matches[2], @@ -368,7 +368,7 @@ proc generateRss(outputFilename: string, news: seq[TRssItem]) = if not open(output, outputFilename, mode = fmWrite): quit("Could not write to $1 for rss generation" % [outputFilename]) - finally: output.close() + defer: output.close() output.write("""<?xml version="1.0" encoding="utf-8"?> <feed xmlns="http://www.w3.org/2005/Atom"> @@ -431,7 +431,7 @@ proc buildWebsite(c: var TConfigData) = if not existsDir("web/upload"): createDir("web/upload") if open(f, outfile, fmWrite): - writeln(f, generateHTMLPage(c, file, content, rss)) + writeLine(f, generateHTMLPage(c, file, content, rss)) close(f) else: quit("[Error] cannot write file: " & outfile) diff --git a/tools/noprefix.nim b/tools/noprefix.nim index fe03a9efc..d16c2b520 100644 --- a/tools/noprefix.nim +++ b/tools/noprefix.nim @@ -13,12 +13,12 @@ const ("sdl/sdl_mixer", "sdl"), ("sdl/sdl_ttf", "sdl"), ("sdl/smpeg", "sdl"), - + ("libcurl", "curl"), ("mysql", "mysql"), ("postgres", ""), ("sqlite3", "sqlite3"), - + ("pcre/pcre", "pcre") ] diff --git a/tools/restorecc.nim b/tools/restorecc.nim index f5d8f0bb3..ff95427d8 100644 --- a/tools/restorecc.nim +++ b/tools/restorecc.nim @@ -1,16 +1,16 @@ import os, strutils -proc main(dir: string, wanted: string) = - for kind, path in walkDir(dir): - case kind +proc main(dir: string, wanted: string) = + for kind, path in walkDir(dir): + case kind of pcFile: let name = extractFilename(path) if name == wanted: let newLoc = path.replace("mingw_backup", "mingw") echo "creating ", newLoc - copyFile(path, newLoc) - of pcDir: main(path, wanted) - else: discard + copyFile(path, newLoc) + of pcDir: main(path, wanted) + else: discard main("dist/mingw_backup", paramStr(1)) diff --git a/tools/website.tmpl b/tools/website.tmpl index bc3ed8e2c..3209aac51 100644 --- a/tools/website.tmpl +++ b/tools/website.tmpl @@ -1,5 +1,5 @@ -#! stdtmpl | standard -#proc generateHTMLPage(c: var TConfigData, currentTab, content, rss: string): string = +#? stdtmpl | standard +#proc generateHTMLPage(c: var TConfigData, currentTab, content, rss: string): string = # result = "" <!DOCTYPE html> <html> @@ -23,7 +23,7 @@ # if t != "index" and t != "community" and t != "news": # let name = c.tabs[i].key # if currentTab == t: - <a class="active" + <a class="active" # else: <a # end if @@ -104,7 +104,7 @@ p.greet() <span class="cmt"># or greet(p)</span> <span class="cmt"># declare a C procedure..</span> <span class="kwd">proc</span> <span class="def">unsafeScanf</span>(f: <span class="typ">File</span>, s: <span class="typ">cstring</span>) <span class="tab"> </span>{.varargs, -<span class="tab"> </span>importc: <span class="val">"fscanf"</span>, +<span class="tab"> </span>importc: <span class="val">"fscanf"</span>, <span class="tab end"> </span>header: <span class="val">"<stdio.h>"</span>.} <span class="cmt"># ..and use it...</span> @@ -191,7 +191,7 @@ runForever() </div> </div> </footer> - + # if currentTab == "index": <script src="assets/index.js"></script> # end if |