|KWEBAPP-C-SOURCE(1)||General Commands Manual||KWEBAPP-C-SOURCE(1)|
kwebapp-c-sourceutility accepts a kwebapp(5) config (defaulting to standard input) and produces an implementation of the C API generated by kwebapp-c-header(1). The configuration may be broken apart into several files. Its arguments are as follows:
-hinclusion. This may include d for database input declarations, j for JSON export declarations, and/or (v) for data validators.
-Iis to allow for multiple headers with multiple implementations. For example, a header with the JSON API requires
-Ij, but the implementation may not specify
-jitself, although it must include dependent headers for the JSON API. By default, the database input and data structures definitions are output with a header file of db.h. All C code produced by
kwebapp-c-sourceconforms with the style(9) manual of OpenBSD. kwebapp(5) is implemented differently on different systems. On OpenBSD, it uses the crypt_newhash(3) and crypt_checkpass(3) functionality. On all other systems, it uses the traditional crypt(3) with an MD5 (“$1”) setting. The seed is generated using random(3), so the calling application should invoke srandom(3).
kwebapp-c-sourceis currently not portable between systems. This is due to code being generated that is available on the system where
kwebapp-c-sourceis executed, for example, whether
b64_ntop() are usable. Future version of the system may have flags for generating portable code that bundles in all non-portable functions.
kwebapp-c-sourceutility exits 0 on success, and >0 if an error occurs. foo.kwbp be the configuration file.
kwebapp-c-header -jvs foo.kwbp > db.h kwebapp-c-source -jvs foo.kwbp > db.c
kwebapp-c-header -s foo.kwbp > db.h kwebapp-c-header -s -g JSON_H -j -Nbd foo.kwbp > json.h kwebapp-c-source -s -h db.h > db.c kwebapp-c-source -s -j -Nd -Idj -h db.h,json.h > json.c
-thenjson.c needs to include both database and JSON headers (in name,
-h, and in the headers those stipulated in source,
-I) also while inhibiting database routine creation with
|September 28, 2018||OpenBSD 6.4|