Update license formats for all source code

This commit is contained in:
2026-02-03 19:02:47 +00:00
parent 698b2b96b1
commit 27108aa811
10 changed files with 160 additions and 113 deletions

27
alisp.h
View File

@@ -1,15 +1,8 @@
/* Copyright (C) 2025 Aryadev Chavali /* alisp.h: Single header for all the definitions.
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the Unlicense for details.
* You may distribute and modify this code under the terms of the Unlicense,
* which you should have received a copy of along with this program. If not,
* please go to <https://unlicense.org/>.
* Created: 2025-08-19 * Created: 2025-08-19
* Description: All the definitions required for the lisp system * Author: Aryadev Chavali
* License: See end of file
* Commentary:
*/ */
#ifndef ALISP_H #ifndef ALISP_H
@@ -267,3 +260,15 @@ read_err_t read(sys_t *, stream_t *, lisp_t **);
read_err_t read_all(sys_t *, stream_t *, vec_t *); read_err_t read_all(sys_t *, stream_t *, vec_t *);
#endif #endif
/* Copyright (C) 2025, 2026 Aryadev Chavali
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the Unlicense for details.
* You may distribute and modify this code under the terms of the Unlicense,
* which you should have received a copy of along with this program. If not,
* please go to <https://unlicense.org/>.
*/

27
main.c
View File

@@ -1,15 +1,8 @@
/* Copyright (C) 2025 Aryadev Chavali /* main.c: Entrypoint
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the Unlicense for details.
* You may distribute and modify this code under the terms of the Unlicense,
* which you should have received a copy of along with this program. If not,
* please go to <https://unlicense.org/>.
* Created: 2025-08-19 * Created: 2025-08-19
* Description: Entrypoint * Author: Aryadev Chavali
* License: See end of file
* Commentary:
*/ */
#include <malloc.h> #include <malloc.h>
@@ -40,3 +33,15 @@ int main(void)
fclose(fp); fclose(fp);
return 0; return 0;
} }
/* Copyright (C) 2025, 2026 Aryadev Chavali
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the Unlicense for details.
* You may distribute and modify this code under the terms of the Unlicense,
* which you should have received a copy of along with this program. If not,
* please go to <https://unlicense.org/>.
*/

View File

@@ -1,15 +1,8 @@
/* Copyright (C) 2025 Aryadev Chavali /* constructor.c: Lisp constructors/destructors
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the Unlicense for details.
* You may distribute and modify this code under the terms of the Unlicense,
* which you should have received a copy of along with this program. If not,
* please go to <https://unlicense.org/>.
* Created: 2025-08-20 * Created: 2025-08-20
* Description: Lisp constructors/destructors * Author: Aryadev Chavali
* License: See end of file
* Commentary:
*/ */
#include <malloc.h> #include <malloc.h>
@@ -62,3 +55,15 @@ lisp_t *cdr(lisp_t *lsp)
else else
return CDR(lsp); return CDR(lsp);
} }
/* Copyright (C) 2025, 2026 Aryadev Chavali
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the Unlicense for details.
* You may distribute and modify this code under the terms of the Unlicense,
* which you should have received a copy of along with this program. If not,
* please go to <https://unlicense.org/>.
*/

View File

@@ -1,15 +1,8 @@
/* Copyright (C) 2025 Aryadev Chavali /* stream.c: Stream implementation
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the Unlicense for details.
* You may distribute and modify this code under the terms of the Unlicense,
* which you should have received a copy of along with this program. If not,
* please go to <https://unlicense.org/>.
* Created: 2025-08-26 * Created: 2025-08-26
* Description: Stream implementation * Author: Aryadev Chavali
* License: See end of file
* Commentary:
*/ */
#include <stdlib.h> #include <stdlib.h>
@@ -367,3 +360,15 @@ sv_t stream_while(stream_t *stream, const char *str)
return SV(NULL, 0); return SV(NULL, 0);
return stream_substr_abs(stream, current_position, size - 1); return stream_substr_abs(stream, current_position, size - 1);
} }
/* Copyright (C) 2025, 2026 Aryadev Chavali
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the Unlicense for details.
* You may distribute and modify this code under the terms of the Unlicense,
* which you should have received a copy of along with this program. If not,
* please go to <https://unlicense.org/>.
*/

View File

@@ -1,16 +1,8 @@
/* Copyright (C) 2025 Aryadev Chavali /* sv.c: String views
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Unlicense
* for details.
* You may distribute and modify this code under the terms of the
* Unlicense, which you should have received a copy of along with this
* program. If not, please go to <https://unlicense.org/>.
* Created: 2025-08-21 * Created: 2025-08-21
* Description: String views * Author: Aryadev Chavali
* License: See end of file
* Commentary:
*/ */
#include <malloc.h> #include <malloc.h>
@@ -25,3 +17,15 @@ sv_t sv_copy(sv_t old)
newstr[old.size] = '\0'; newstr[old.size] = '\0';
return SV(newstr, old.size); return SV(newstr, old.size);
} }
/* Copyright (C) 2025, 2026 Aryadev Chavali
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the Unlicense for details.
* You may distribute and modify this code under the terms of the Unlicense,
* which you should have received a copy of along with this program. If not,
* please go to <https://unlicense.org/>.
*/

View File

@@ -1,15 +1,8 @@
/* Copyright (C) 2025 Aryadev Chavali /* symtable.c: Symbol Table implementation
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the Unlicense for details.
* You may distribute and modify this code under the terms of the Unlicense,
* which you should have received a copy of along with this program. If not,
* please go to <https://unlicense.org/>.
* Created: 2025-08-19 * Created: 2025-08-19
* Description: Symbol Table implementation * Author: Aryadev Chavali
* License: See end of file
* Commentary:
*/ */
#include "../alisp.h" #include "../alisp.h"
@@ -73,3 +66,15 @@ void sym_table_cleanup(sym_table_t *table)
vec_free(&table->entries); vec_free(&table->entries);
memset(table, 0, sizeof(*table)); memset(table, 0, sizeof(*table));
} }
/* Copyright (C) 2025, 2026 Aryadev Chavali
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the Unlicense for details.
* You may distribute and modify this code under the terms of the Unlicense,
* which you should have received a copy of along with this program. If not,
* please go to <https://unlicense.org/>.
*/

View File

@@ -1,15 +1,8 @@
/* Copyright (C) 2025 Aryadev Chavali /* sys.c: System management
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the Unlicense for details.
* You may distribute and modify this code under the terms of the Unlicense,
* which you should have received a copy of along with this program. If not,
* please go to <https://unlicense.org/>.
* Created: 2025-08-20 * Created: 2025-08-20
* Description: System management * Author: Aryadev Chavali
* License: See end of file
* Commentary:
*/ */
#include "../alisp.h" #include "../alisp.h"
@@ -70,3 +63,15 @@ void sys_cleanup(sys_t *sys)
// Ensure no one treats this as active in any sense // Ensure no one treats this as active in any sense
memset(sys, 0, sizeof(*sys)); memset(sys, 0, sizeof(*sys));
} }
/* Copyright (C) 2025, 2026 Aryadev Chavali
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the Unlicense for details.
* You may distribute and modify this code under the terms of the Unlicense,
* which you should have received a copy of along with this program. If not,
* please go to <https://unlicense.org/>.
*/

View File

@@ -1,15 +1,8 @@
/* Copyright (C) 2025 Aryadev Chavali /* tag.c: Pointer tagging
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the Unlicense for details.
* You may distribute and modify this code under the terms of the Unlicense,
* which you should have received a copy of along with this program. If not,
* please go to <https://unlicense.org/>.
* Created: 2025-08-19 * Created: 2025-08-19
* Description: Pointer tagging * Author: Aryadev Chavali
* License: See end of file
* Commentary:
*/ */
#include <assert.h> #include <assert.h>
@@ -74,3 +67,15 @@ vec_t *as_vec(lisp_t *obj)
assert(IS_TAG(obj, VEC)); assert(IS_TAG(obj, VEC));
return (vec_t *)UNTAG(obj, VEC); return (vec_t *)UNTAG(obj, VEC);
} }
/* Copyright (C) 2025, 2026 Aryadev Chavali
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the Unlicense for details.
* You may distribute and modify this code under the terms of the Unlicense,
* which you should have received a copy of along with this program. If not,
* please go to <https://unlicense.org/>.
*/

View File

@@ -1,16 +1,8 @@
/* Copyright (C) 2025 Aryadev Chavali /* vec.c: Stable Vector implementation
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Unlicense
* for details.
* You may distribute and modify this code under the terms of the
* Unlicense, which you should have received a copy of along with this
* program. If not, please go to <https://unlicense.org/>.
* Created: 2025-08-20 * Created: 2025-08-20
* Description: Stable Vector implementation * Author: Aryadev Chavali
* License: See end of file
* Commentary:
*/ */
#include <malloc.h> #include <malloc.h>
@@ -92,3 +84,15 @@ void vec_clone(vec_t *dest, vec_t *src)
vec_init(dest, src->capacity); vec_init(dest, src->capacity);
memcpy(vec_data(dest), vec_data(src), src->size); memcpy(vec_data(dest), vec_data(src), src->size);
} }
/* Copyright (C) 2025, 2026 Aryadev Chavali
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the Unlicense for details.
* You may distribute and modify this code under the terms of the Unlicense,
* which you should have received a copy of along with this program. If not,
* please go to <https://unlicense.org/>.
*/

View File

@@ -1,16 +1,8 @@
/* Copyright (C) 2025 Aryadev Chavali /* test.c: Tests
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Unlicense
* for details.
* You may distribute and modify this code under the terms of the
* Unlicense, which you should have received a copy of along with this
* program. If not, please go to <https://unlicense.org/>.
* Created: 2025-08-21 * Created: 2025-08-21
* Description: Tests * Author: Aryadev Chavali
* License: See end of file
* Commentary:
*/ */
#include <stdio.h> #include <stdio.h>
@@ -236,3 +228,15 @@ int main(void)
} }
return 0; return 0;
} }
/* Copyright (C) 2025, 2026 Aryadev Chavali
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the Unlicense for details.
* You may distribute and modify this code under the terms of the Unlicense,
* which you should have received a copy of along with this program. If not,
* please go to <https://unlicense.org/>.
*/