1
0
mirror of https://github.com/janet-lang/janet synced 2025-07-07 20:42:54 +00:00

Rename the header <janet/janet.h> to <janet.h>

Makes it easier to use and remember, and makes the
variable `module/*headerpath*` make more sense.
This commit is contained in:
Calvin Rose 2019-02-18 20:13:35 -05:00
parent 9480ad24cc
commit ed72dcf82d
54 changed files with 64 additions and 56 deletions

View File

@ -24,7 +24,7 @@
PREFIX?=/usr/local PREFIX?=/usr/local
INCLUDEDIR=$(PREFIX)/include/janet INCLUDEDIR=$(PREFIX)/include
BINDIR=$(PREFIX)/bin BINDIR=$(PREFIX)/bin
JANET_BUILD?="\"$(shell git log --pretty=format:'%h' -n 1)\"" JANET_BUILD?="\"$(shell git log --pretty=format:'%h' -n 1)\""
CLIBS=-lm CLIBS=-lm
@ -51,7 +51,7 @@ endif
$(shell mkdir -p build/core build/mainclient build/webclient build/boot) $(shell mkdir -p build/core build/mainclient build/webclient build/boot)
# Source headers # Source headers
JANET_HEADERS=$(sort $(wildcard src/include/janet/*.h)) JANET_HEADERS=$(sort $(wildcard src/include/*.h))
JANET_LOCAL_HEADERS=$(sort $(wildcard src/*/*.h)) JANET_LOCAL_HEADERS=$(sort $(wildcard src/*/*.h))
# Source files # Source files
@ -77,7 +77,7 @@ build/janet_boot: $(JANET_BOOT_OBJECTS)
# Now the reason we bootstrap in the first place # Now the reason we bootstrap in the first place
build/core_image.c: build/janet_boot build/core_image.c: build/janet_boot
JANET_PATH=$(JANET_PATH) build/janet_boot JANET_PATH=$(JANET_PATH) JANET_INCLUDEDIR=$(INCLUDEDIR) build/janet_boot
########################################################## ##########################################################
##### The main interpreter program and shared object ##### ##### The main interpreter program and shared object #####
@ -156,7 +156,7 @@ amalg: build/janet.c build/janet.h build/core_image.c
build/janet.c: $(JANET_LOCAL_HEADERS) $(JANET_CORE_SOURCES) tools/amalg.janet $(JANET_TARGET) build/janet.c: $(JANET_LOCAL_HEADERS) $(JANET_CORE_SOURCES) tools/amalg.janet $(JANET_TARGET)
$(JANET_TARGET) tools/amalg.janet > $@ $(JANET_TARGET) tools/amalg.janet > $@
build/janet.h: src/include/janet/janet.h build/janet.h: src/include/janet.h
cp $< $@ cp $< $@
################### ###################
@ -191,7 +191,7 @@ callgrind: $(JANET_TARGET)
dist: build/janet-dist.tar.gz dist: build/janet-dist.tar.gz
build/janet-%.tar.gz: $(JANET_TARGET) src/include/janet/janet.h \ build/janet-%.tar.gz: $(JANET_TARGET) src/include/janet.h \
janet.1 LICENSE CONTRIBUTING.md $(JANET_LIBRARY) \ janet.1 LICENSE CONTRIBUTING.md $(JANET_LIBRARY) \
build/doc.html README.md build/janet.c build/doc.html README.md build/janet.c
tar -czvf $@ $^ tar -czvf $@ $^
@ -221,6 +221,9 @@ install: $(JANET_TARGET)
cp $(JANET_TARGET) $(BINDIR)/janet cp $(JANET_TARGET) $(BINDIR)/janet
mkdir -p $(INCLUDEDIR) mkdir -p $(INCLUDEDIR)
cp $(JANET_HEADERS) $(INCLUDEDIR) cp $(JANET_HEADERS) $(INCLUDEDIR)
# For compatibility
mkdir -p $(INCLUDEDIR)/janet
ln -sf $(INCLUDEDIR)/janet.h $(INCLUDEDIR)/janet/janet.h
mkdir -p $(JANET_PATH) mkdir -p $(JANET_PATH)
cp tools/cook.janet $(JANET_PATH) cp tools/cook.janet $(JANET_PATH)
cp tools/highlight.janet $(JANET_PATH) cp tools/highlight.janet $(JANET_PATH)

View File

@ -123,7 +123,7 @@ copy LICENSE dist\LICENSE
copy README.md dist\README.md copy README.md dist\README.md
copy janet.lib dist\janet.lib copy janet.lib dist\janet.lib
copy janet.exp dist\janet.exp copy janet.exp dist\janet.exp
copy src\include\janet\janet.h dist\janet.h copy src\include\janet.h dist\janet.h
copy tools\cook.janet dist\cook.janet copy tools\cook.janet dist\cook.janet
copy tools\highlight.janet dist\highlight.janet copy tools\highlight.janet dist\highlight.janet
exit /b 0 exit /b 0

View File

@ -20,7 +20,7 @@
* IN THE SOFTWARE. * IN THE SOFTWARE.
*/ */
#include <janet/janet.h> #include <janet.h>
#include <assert.h> #include <assert.h>
int main() { int main() {

View File

@ -20,7 +20,7 @@
* IN THE SOFTWARE. * IN THE SOFTWARE.
*/ */
#include <janet/janet.h> #include <janet.h>
#include <assert.h> #include <assert.h>
int main() { int main() {

View File

@ -20,7 +20,7 @@
* IN THE SOFTWARE. * IN THE SOFTWARE.
*/ */
#include <janet/janet.h> #include <janet.h>
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#include <assert.h> #include <assert.h>

View File

@ -20,7 +20,7 @@
* IN THE SOFTWARE. * IN THE SOFTWARE.
*/ */
#include <janet/janet.h> #include <janet.h>
#include <assert.h> #include <assert.h>
#include <stdio.h> #include <stdio.h>

View File

@ -20,7 +20,7 @@
* IN THE SOFTWARE. * IN THE SOFTWARE.
*/ */
#include <janet/janet.h> #include <janet.h>
#include <assert.h> #include <assert.h>
int main() { int main() {

View File

@ -1,5 +1,5 @@
#include <stdlib.h> #include <stdlib.h>
#include <janet/janet.h> #include <janet.h>
typedef struct { typedef struct {
double * data; double * data;

View File

@ -20,7 +20,7 @@
* IN THE SOFTWARE. * IN THE SOFTWARE.
*/ */
#include <janet/janet.h> #include <janet.h>
extern const unsigned char *janet_gen_boot; extern const unsigned char *janet_gen_boot;
extern int32_t janet_gen_boot_size; extern int32_t janet_gen_boot_size;

View File

@ -29,7 +29,7 @@
(def image-file (file/open "build/core_image.c" :w)) (def image-file (file/open "build/core_image.c" :w))
(file/write image-file (file/write image-file
"#ifndef JANET_AMALG\n" "#ifndef JANET_AMALG\n"
"#include <janet/janet.h>\n" "#include <janet.h>\n"
"#endif\n" "#endif\n"
"static const unsigned char janet_core_image_bytes[] = {\n") "static const unsigned char janet_core_image_bytes[] = {\n")
(loop [line :in (partition 10 chunks)] (loop [line :in (partition 10 chunks)]

View File

@ -21,7 +21,7 @@
*/ */
#ifndef JANET_AMALG #ifndef JANET_AMALG
#include <janet/janet.h> #include <janet.h>
#include "gc.h" #include "gc.h"
#endif #endif

View File

@ -21,7 +21,7 @@
*/ */
#ifndef JANET_AMALG #ifndef JANET_AMALG
#include <janet/janet.h> #include <janet.h>
#include "gc.h" #include "gc.h"
#include "util.h" #include "util.h"
#endif #endif

View File

@ -21,7 +21,7 @@
*/ */
#ifndef JANET_AMALG #ifndef JANET_AMALG
#include <janet/janet.h> #include <janet.h>
#include "util.h" #include "util.h"
#endif #endif

View File

@ -21,7 +21,7 @@
*/ */
#ifndef JANET_AMALG #ifndef JANET_AMALG
#include <janet/janet.h> #include <janet.h>
#include "gc.h" #include "gc.h"
#include "util.h" #include "util.h"
#endif #endif

View File

@ -21,7 +21,7 @@
*/ */
#ifndef JANET_AMALG #ifndef JANET_AMALG
#include <janet/janet.h> #include <janet.h>
#include "gc.h" #include "gc.h"
#endif #endif

View File

@ -21,7 +21,7 @@
*/ */
#ifndef JANET_AMALG #ifndef JANET_AMALG
#include <janet/janet.h> #include <janet.h>
#include "state.h" #include "state.h"
#include "fiber.h" #include "fiber.h"
#endif #endif

View File

@ -21,7 +21,7 @@
*/ */
#ifndef JANET_AMALG #ifndef JANET_AMALG
#include <janet/janet.h> #include <janet.h>
#include "compile.h" #include "compile.h"
#include "emit.h" #include "emit.h"
#include "vector.h" #include "vector.h"

View File

@ -21,7 +21,7 @@
*/ */
#ifndef JANET_AMALG #ifndef JANET_AMALG
#include <janet/janet.h> #include <janet.h>
#include "compile.h" #include "compile.h"
#include "emit.h" #include "emit.h"
#include "vector.h" #include "vector.h"

View File

@ -24,7 +24,7 @@
#define JANET_COMPILE_H #define JANET_COMPILE_H
#ifndef JANET_AMALG #ifndef JANET_AMALG
#include <janet/janet.h> #include <janet.h>
#include "regalloc.h" #include "regalloc.h"
#endif #endif

View File

@ -1605,6 +1605,10 @@ value, one key will be ignored."
on Windows is C:/Janet/Library." on Windows is C:/Janet/Library."
(or (os/getenv "JANET_PATH") "")) (or (os/getenv "JANET_PATH") ""))
(var module/*headerpath*
"The path where janet/janet.h is located."
(or (os/getenv "JANET_INCLUDEDIR") ""))
(defn- fexists [path] (defn- fexists [path]
(def f (file/open path)) (def f (file/open path))
(if f (do (file/close f) path))) (if f (do (file/close f) path)))

View File

@ -21,7 +21,7 @@
*/ */
#ifndef JANET_AMALG #ifndef JANET_AMALG
#include <janet/janet.h> #include <janet.h>
#include "compile.h" #include "compile.h"
#include "state.h" #include "state.h"
#include "util.h" #include "util.h"

View File

@ -21,7 +21,7 @@
*/ */
#ifndef JANET_AMALG #ifndef JANET_AMALG
#include <janet/janet.h> #include <janet.h>
#include "gc.h" #include "gc.h"
#include "state.h" #include "state.h"
#include "util.h" #include "util.h"

View File

@ -21,7 +21,7 @@
*/ */
#ifndef JANET_AMALG #ifndef JANET_AMALG
#include <janet/janet.h> #include <janet.h>
#include "emit.h" #include "emit.h"
#include "vector.h" #include "vector.h"
#include "regalloc.h" #include "regalloc.h"

View File

@ -21,7 +21,7 @@
*/ */
#ifndef JANET_AMALG #ifndef JANET_AMALG
#include <janet/janet.h> #include <janet.h>
#include "fiber.h" #include "fiber.h"
#include "state.h" #include "state.h"
#include "gc.h" #include "gc.h"

View File

@ -24,7 +24,7 @@
#define JANET_FIBER_H_defined #define JANET_FIBER_H_defined
#ifndef JANET_AMALG #ifndef JANET_AMALG
#include <janet/janet.h> #include <janet.h>
#endif #endif
extern JANET_THREAD_LOCAL JanetFiber *janet_vm_fiber; extern JANET_THREAD_LOCAL JanetFiber *janet_vm_fiber;

View File

@ -21,7 +21,7 @@
*/ */
#ifndef JANET_AMALG #ifndef JANET_AMALG
#include <janet/janet.h> #include <janet.h>
#include "state.h" #include "state.h"
#include "symcache.h" #include "symcache.h"
#include "gc.h" #include "gc.h"

View File

@ -24,7 +24,7 @@
#define JANET_GC_H #define JANET_GC_H
#ifndef JANET_AMALG #ifndef JANET_AMALG
#include <janet/janet.h> #include <janet.h>
#endif #endif
/* The metadata header associated with an allocated block of memory */ /* The metadata header associated with an allocated block of memory */

View File

@ -28,7 +28,7 @@
#include <errno.h> #include <errno.h>
#ifndef JANET_AMALG #ifndef JANET_AMALG
#include <janet/janet.h> #include <janet.h>
#include "util.h" #include "util.h"
#endif #endif

View File

@ -21,7 +21,7 @@
*/ */
#ifndef JANET_AMALG #ifndef JANET_AMALG
#include <janet/janet.h> #include <janet.h>
#include "state.h" #include "state.h"
#include "vector.h" #include "vector.h"
#include "gc.h" #include "gc.h"

View File

@ -23,7 +23,7 @@
#include <math.h> #include <math.h>
#ifndef JANET_AMALG #ifndef JANET_AMALG
#include <janet/janet.h> #include <janet.h>
#include "util.h" #include "util.h"
#endif #endif

View File

@ -21,7 +21,7 @@
*/ */
#ifndef JANET_AMALG #ifndef JANET_AMALG
#include <janet/janet.h> #include <janet.h>
#include "util.h" #include "util.h"
#endif #endif

View File

@ -21,7 +21,7 @@
*/ */
#ifndef JANET_AMALG #ifndef JANET_AMALG
#include <janet/janet.h> #include <janet.h>
#include "util.h" #include "util.h"
#endif #endif

View File

@ -21,7 +21,7 @@
*/ */
#ifndef JANET_AMALG #ifndef JANET_AMALG
#include <janet/janet.h> #include <janet.h>
#include <string.h> #include <string.h>
#include "util.h" #include "util.h"
#include "vector.h" #include "vector.h"

View File

@ -24,7 +24,7 @@
#include <ctype.h> #include <ctype.h>
#ifndef JANET_AMALG #ifndef JANET_AMALG
#include <janet/janet.h> #include <janet.h>
#include "util.h" #include "util.h"
#include "state.h" #include "state.h"
#endif #endif

View File

@ -21,7 +21,7 @@
*/ */
#ifndef JANET_AMALG #ifndef JANET_AMALG
#include <janet/janet.h> #include <janet.h>
#include "regalloc.h" #include "regalloc.h"
#endif #endif

View File

@ -21,7 +21,7 @@
*/ */
#ifndef JANET_AMALG #ifndef JANET_AMALG
#include <janet/janet.h> #include <janet.h>
#include "state.h" #include "state.h"
#endif #endif

View File

@ -21,7 +21,7 @@
*/ */
#ifndef JANET_AMALG #ifndef JANET_AMALG
#include <janet/janet.h> #include <janet.h>
#include "compile.h" #include "compile.h"
#include "util.h" #include "util.h"
#include "vector.h" #include "vector.h"

View File

@ -23,7 +23,7 @@
#include <string.h> #include <string.h>
#ifndef JANET_AMALG #ifndef JANET_AMALG
#include <janet/janet.h> #include <janet.h>
#include "gc.h" #include "gc.h"
#include "util.h" #include "util.h"
#include "state.h" #include "state.h"

View File

@ -44,7 +44,7 @@
#include <string.h> #include <string.h>
#ifndef JANET_AMALG #ifndef JANET_AMALG
#include <janet/janet.h> #include <janet.h>
#endif #endif
/* Lookup table for getting values of characters when parsing numbers. Handles /* Lookup table for getting values of characters when parsing numbers. Handles

View File

@ -21,7 +21,7 @@
*/ */
#ifndef JANET_AMALG #ifndef JANET_AMALG
#include <janet/janet.h> #include <janet.h>
#include "gc.h" #include "gc.h"
#include "util.h" #include "util.h"
#include <math.h> #include <math.h>

View File

@ -26,10 +26,11 @@
* whole program. Equality is then just a pointer check. */ * whole program. Equality is then just a pointer check. */
#ifndef JANET_AMALG #ifndef JANET_AMALG
#include <janet/janet.h> #include <janet.h>
#include "state.h" #include "state.h"
#include "gc.h" #include "gc.h"
#include "util.h" #include "util.h"
#include "symcache.h"
#endif #endif
/* Cache state */ /* Cache state */

View File

@ -24,7 +24,7 @@
#define JANET_SYMCACHE_H_defined #define JANET_SYMCACHE_H_defined
#ifndef JANET_AMALG #ifndef JANET_AMALG
#include <janet/janet.h> #include <janet.h>
#endif #endif
/* Initialize the cache (allocate cache memory) */ /* Initialize the cache (allocate cache memory) */

View File

@ -21,7 +21,7 @@
*/ */
#ifndef JANET_AMALG #ifndef JANET_AMALG
#include <janet/janet.h> #include <janet.h>
#include "gc.h" #include "gc.h"
#include "util.h" #include "util.h"
#include <math.h> #include <math.h>

View File

@ -21,7 +21,7 @@
*/ */
#ifndef JANET_AMALG #ifndef JANET_AMALG
#include <janet/janet.h> #include <janet.h>
#include "symcache.h" #include "symcache.h"
#include "gc.h" #include "gc.h"
#include "util.h" #include "util.h"

View File

@ -23,7 +23,7 @@
#include <inttypes.h> #include <inttypes.h>
#ifndef JANET_AMALG #ifndef JANET_AMALG
#include <janet/janet.h> #include <janet.h>
#include "util.h" #include "util.h"
#include "state.h" #include "state.h"
#include "gc.h" #include "gc.h"

View File

@ -24,7 +24,7 @@
#define JANET_UTIL_H_defined #define JANET_UTIL_H_defined
#ifndef JANET_AMALG #ifndef JANET_AMALG
#include <janet/janet.h> #include <janet.h>
#endif #endif
/* Omit docstrings in some builds */ /* Omit docstrings in some builds */

View File

@ -21,7 +21,7 @@
*/ */
#ifndef JANET_AMALG #ifndef JANET_AMALG
#include <janet/janet.h> #include <janet.h>
#endif #endif
/* /*

View File

@ -24,7 +24,7 @@
#define JANET_VECTOR_H_defined #define JANET_VECTOR_H_defined
#ifndef JANET_AMALG #ifndef JANET_AMALG
#include <janet/janet.h> #include <janet.h>
#endif #endif
/* /*

View File

@ -21,7 +21,7 @@
*/ */
#ifndef JANET_AMALG #ifndef JANET_AMALG
#include <janet/janet.h> #include <janet.h>
#include "state.h" #include "state.h"
#include "fiber.h" #include "fiber.h"
#include "gc.h" #include "gc.h"

View File

@ -21,7 +21,7 @@
*/ */
#ifndef JANET_AMALG #ifndef JANET_AMALG
#include <janet/janet.h> #include <janet.h>
#endif #endif
void *janet_memalloc_empty(int32_t count) { void *janet_memalloc_empty(int32_t count) {

View File

@ -23,7 +23,7 @@
#ifndef JANET_LINE_H_defined #ifndef JANET_LINE_H_defined
#define JANET_LINE_H_defined #define JANET_LINE_H_defined
#include <janet/janet.h> #include <janet.h>
void janet_line_init(); void janet_line_init();
void janet_line_deinit(); void janet_line_deinit();

View File

@ -20,7 +20,7 @@
* IN THE SOFTWARE. * IN THE SOFTWARE.
*/ */
#include <janet/janet.h> #include <janet.h>
#include "line.h" #include "line.h"
extern const unsigned char *janet_gen_init; extern const unsigned char *janet_gen_init;

View File

@ -20,7 +20,7 @@
* IN THE SOFTWARE. * IN THE SOFTWARE.
*/ */
#include <janet/janet.h> #include <janet.h>
#include <emscripten.h> #include <emscripten.h>
extern const unsigned char *janet_gen_webinit; extern const unsigned char *janet_gen_webinit;