1
0
mirror of https://github.com/janet-lang/janet synced 2024-11-28 02:59: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
INCLUDEDIR=$(PREFIX)/include/janet
INCLUDEDIR=$(PREFIX)/include
BINDIR=$(PREFIX)/bin
JANET_BUILD?="\"$(shell git log --pretty=format:'%h' -n 1)\""
CLIBS=-lm
@ -51,7 +51,7 @@ endif
$(shell mkdir -p build/core build/mainclient build/webclient build/boot)
# Source headers
JANET_HEADERS=$(sort $(wildcard src/include/janet/*.h))
JANET_HEADERS=$(sort $(wildcard src/include/*.h))
JANET_LOCAL_HEADERS=$(sort $(wildcard src/*/*.h))
# Source files
@ -77,7 +77,7 @@ build/janet_boot: $(JANET_BOOT_OBJECTS)
# Now the reason we bootstrap in the first place
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 #####
@ -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)
$(JANET_TARGET) tools/amalg.janet > $@
build/janet.h: src/include/janet/janet.h
build/janet.h: src/include/janet.h
cp $< $@
###################
@ -191,7 +191,7 @@ callgrind: $(JANET_TARGET)
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) \
build/doc.html README.md build/janet.c
tar -czvf $@ $^
@ -221,6 +221,9 @@ install: $(JANET_TARGET)
cp $(JANET_TARGET) $(BINDIR)/janet
mkdir -p $(INCLUDEDIR)
cp $(JANET_HEADERS) $(INCLUDEDIR)
# For compatibility
mkdir -p $(INCLUDEDIR)/janet
ln -sf $(INCLUDEDIR)/janet.h $(INCLUDEDIR)/janet/janet.h
mkdir -p $(JANET_PATH)
cp tools/cook.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 janet.lib dist\janet.lib
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\highlight.janet dist\highlight.janet
exit /b 0

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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