From 65133ff9e93628931f1deadfc87a188f3fc039b1 Mon Sep 17 00:00:00 2001 From: Ganesh Viswanathan Date: Sun, 20 Jan 2019 16:17:08 -0600 Subject: [PATCH] Update documentation --- .nojekyll | 0 cimport.html | 1386 ++++++++++++++++++++++++++++++++++++++++++++++++++ cimport.idx | 8 + types.html | 1298 ++++++++++++++++++++++++++++++++++++++++++++++ types.idx | 3 + 5 files changed, 2695 insertions(+) create mode 100644 .nojekyll create mode 100644 cimport.html create mode 100644 cimport.idx create mode 100644 types.html create mode 100644 types.idx diff --git a/.nojekyll b/.nojekyll new file mode 100644 index 0000000..e69de29 diff --git a/cimport.html b/cimport.html new file mode 100644 index 0000000..5f22587 --- /dev/null +++ b/cimport.html @@ -0,0 +1,1386 @@ + + + + + + + + + + + + + + + + + +cimport + + + + + + + + +
+
+

cimport

+
+
+ +
+ Search: +
+
+ Group by: + +
+ + +
+
+
+

+ +
+

Imports

+
+types +
+
+

Procs

+
+ +
proc cSearchPath(path: string): string {...}{.compileTime, raises: [], tags: [ReadDirEffect].}
+
+

Return a file or directory found in search path configured using cSearchPath()

+

This proc can be used to locate files or directories in calls to cCompile(), cIncludeDir() and cImport().

+ + +
+ +
+
+

Macros

+
+ +
macro cDebug(): untyped
+
+Enable debug messages and display the generated Nim code + +
+ +
macro cDefine(name: static string; val: static string = ""): untyped
+
+#define an identifer that is forwarded to the C/C++ compiler using {.passC: "-DXXX".} + +
+ +
macro cAddSearchDir(dir: static string): untyped
+
+

Add directory dir to the search path used in calls to cSearchPath()

+

This allows something like this:

+
cAddSearchDir("path/to/includes")
+cImport cSearchPath("file.h")
+ +
+ +
macro cIncludeDir(dir: static string): untyped
+
+Add an include directory that is forwarded to the C/C++ compiler using {.passC: "-IXXX".} + +
+ +
macro cAddStdDir(mode = "c"): untyped
+
+

Add the standard c [default] or cpp include paths to search path used in calls to cSearchPath()

+

This allows something like this:

+
cAddStdDir()
+cImport cSearchPath("math.h")
+ +
+ +
macro cCompile(path: static string; mode = "c"): untyped
+
+

Compile and link C/C++ implementation into resulting binary using {.compile.}

+

path can be a specific file or contain wildcards:

+
cCompile("file.c")
+cCompile("path/to/*.c")

mode recursively searches for code files in path.

+

c searches for *.c whereas cpp searches for *.C *.cpp *.c++ *.cc *.cxx

+
cCompile("path/to/dir", "cpp")
+ +
+ +
macro cImport(filename: static string; recurse: static bool = false): untyped
+
+

Import all supported definitions from specified header file. Generated content is cached in nimcache until filename changes. If files imported by filename change and affect the generated content, use nim -f to force regeneration of Nim code.

+

recurse can be used to generate Nim wrappers from #include files referenced in filename. This is only done for files in the same directory as filename or in a directory added using cIncludeDir().

+ + +
+ +
+ +
+
+ +
+ +
+
+
+ + + diff --git a/cimport.idx b/cimport.idx new file mode 100644 index 0000000..f9daf49 --- /dev/null +++ b/cimport.idx @@ -0,0 +1,8 @@ +cSearchPath cimport.html#cSearchPath,string cimport: cSearchPath(path: string): string +cDebug cimport.html#cDebug.m, cimport: cDebug(): untyped +cDefine cimport.html#cDefine.m,,string cimport: cDefine(name: static string; val: static string = ""): untyped +cAddSearchDir cimport.html#cAddSearchDir.m, cimport: cAddSearchDir(dir: static string): untyped +cIncludeDir cimport.html#cIncludeDir.m, cimport: cIncludeDir(dir: static string): untyped +cAddStdDir cimport.html#cAddStdDir.m,string cimport: cAddStdDir(mode = "c"): untyped +cCompile cimport.html#cCompile.m,,string cimport: cCompile(path: static string; mode = "c"): untyped +cImport cimport.html#cImport.m, cimport: cImport(filename: static string; recurse: static bool = false): untyped diff --git a/types.html b/types.html new file mode 100644 index 0000000..03d8438 --- /dev/null +++ b/types.html @@ -0,0 +1,1298 @@ + + + + + + + + + + + + + + + + + +types + + + + + + + + +
+
+

types

+
+
+ +
+ Search: +
+
+ Group by: + +
+ + +
+
+
+

+
+

Types

+
+ +
time_t = int32
+
+ + +
+ +
ptrdiff_t = ByteAddress
+
+ + +
+ +
va_list {...}{.importc: "va_list", header: "<stdarg.h>".} = object
+
+ + +
+ +
+ +
+
+ +
+ +
+
+
+ + + diff --git a/types.idx b/types.idx new file mode 100644 index 0000000..d641285 --- /dev/null +++ b/types.idx @@ -0,0 +1,3 @@ +time_t types.html#time_t types: time_t +ptrdiff_t types.html#ptrdiff_t types: ptrdiff_t +va_list types.html#va_list types: va_list