From 3802eec07ec36a55815468a442add5debbbe7fb6 Mon Sep 17 00:00:00 2001 From: Preston Pan Date: Tue, 9 Jan 2024 22:41:14 -0800 Subject: make shit build; add documentation homepage --- Doxyfile | 4 ++-- MAINPAGE.md | 3 +++ Makefile | 5 ++++- include/better_string.h | 19 +++++++++++-------- 4 files changed, 20 insertions(+), 11 deletions(-) create mode 100644 MAINPAGE.md diff --git a/Doxyfile b/Doxyfile index a78202f..ab9c0dc 100644 --- a/Doxyfile +++ b/Doxyfile @@ -54,7 +54,7 @@ PROJECT_NUMBER = # for a project that appears at the top of each page and should give viewer a # quick idea about the purpose of the project. Keep the description short. -PROJECT_BRIEF = +PROJECT_BRIEF = "A minimal stack based programming language" # With the PROJECT_LOGO tag one can specify a logo or an icon that is included # in the documentation. The maximum height of the logo should not exceed 55 @@ -1165,7 +1165,7 @@ FILTER_SOURCE_PATTERNS = # (index.html). This can be useful if you have a project on for instance GitHub # and want to reuse the introduction page also for the doxygen output. -USE_MDFILE_AS_MAINPAGE = +USE_MDFILE_AS_MAINPAGE = MAINPAGE.md # The Fortran standard specifies that for fixed formatted Fortran code all # characters from position 72 are to be considered as comment. A common diff --git a/MAINPAGE.md b/MAINPAGE.md new file mode 100644 index 0000000..de5bdce --- /dev/null +++ b/MAINPAGE.md @@ -0,0 +1,3 @@ +# Introduction +Stem aims to be a minimal interpreted stack based programming language +that allows for metaprogramming and a foreign language interface. diff --git a/Makefile b/Makefile index 3faaa20..d09ee2c 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ CC := gcc SRCDIR := src BUILDDIR := build -TARGET := bin/stem +TARGET := stem SRCEXT := c SOURCES := $(shell find $(SRCDIR) -type f -name *.$(SRCEXT)) OBJECTS := $(patsubst $(SRCDIR)/%,$(BUILDDIR)/%,$(SOURCES:.$(SRCEXT)=.o)) @@ -24,3 +24,6 @@ clean: install: cp $(TARGET) /usr/local/bin/ + +doc: + doxygen diff --git a/include/better_string.h b/include/better_string.h index 03bc6f6..a30b7e2 100644 --- a/include/better_string.h +++ b/include/better_string.h @@ -1,28 +1,31 @@ #ifndef BETTER_STRING_H #define BETTER_STRING_H #include -/* We want better strings to realloc less and keep track of the length of the +/*! We want better strings to realloc less and keep track of the length of the * string so we don't have to call strlen every time */ + +/*! @brief An array implementation of the string data structure */ typedef struct STRING_STRUCT { - /* length of string */ + /*! length of string */ size_t length; - /* Size of current value buffer */ + /*! Size of current value buffer */ size_t bufsize; + /*! String used for the */ char *value; } string_t; -/* Allocates memory for new string */ +/*! Allocates memory for new string */ string_t *init_string(char *value); -/* Copies string to another string */ +/*! Copies string to another string */ string_t *string_copy(string_t *s); -/* Concatenates a string_t type and a char * type */ +/*! Concatenates a string_t type and a char * type */ void string_concat(string_t *s1, string_t *s2); -/* Appends single characters */ +/*! Appends single characters */ void string_append(string_t *s, char c); -/* Frees space for string */ +/*! Frees space for string */ void string_free(string_t *s); #endif -- cgit