Mercurial > core / lisp/ffi/tree-sitter/alien.c
changeset 696: |
38e9c3be2392 |
parent: |
dda17d7dba4f
|
child: |
08621be7e780 |
author: |
Richard Westhaver <ellis@rwest.io> |
date: |
Fri, 04 Oct 2024 21:11:52 -0400 |
permissions: |
-rw-r--r-- |
description: |
prep for adding zdict wrapper, change default control stack size of inferior-lisp to 8M |
1 //! tree-sitter/alien.c --- Tree-sitter C wrapper 3 // based on https://github.com/death/cl-tree-sitter 5 // it's annoying that we need this, I thought we could get away 6 // without it. Alas, SB-ALIEN is also unable to fully interoperate 7 // with the types defined in api.h, so we need to manually create 8 // pointer type definitions for them. 12 cc -g -O2 -Wall -Wno-unused-value -ltree-sitter -shared alien.c -o /usr/local/lib/libtree-sitter-alien.so 20 TSNode *ts_tree_root_node_pointer(const TSTree *self) { 21 TSNode *node = malloc(sizeof(TSNode)); 24 *node = ts_tree_root_node(self); 30 TSTreeCursor *ts_tree_cursor_new_pointer(TSNode *node) { 31 TSTreeCursor *cursor = malloc(sizeof(TSTreeCursor)); 34 *cursor = ts_tree_cursor_new(*node); 40 TSNode *ts_tree_cursor_current_node_pointer(const TSTreeCursor *cursor) { 41 TSNode *return_node = malloc(sizeof(TSNode)); 44 *return_node = ts_tree_cursor_current_node(cursor); 50 int ts_node_is_named_pointer(TSNode *node) { 51 return ts_node_is_named(*node); 54 TSPoint ts_node_start_point_pointer(TSNode *node) { 55 return ts_node_start_point(*node); 59 TSPoint ts_node_end_point_pointer(TSNode *node) { 60 return ts_node_end_point(*node); 63 const char *ts_node_type_pointer(TSNode *node) { 64 return ts_node_type(*node);