From fed4ea2a11ce561e6ca4a0d631f24c65ed1a2d39 Mon Sep 17 00:00:00 2001 From: Justin Ethier Date: Sun, 26 Jun 2022 10:17:04 -0400 Subject: [PATCH] Add API documentation --- docs/api/cyclone/foreign.md | 22 +++++++++++++++++++++- libs/cyclone/foreign.sld | 1 - 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/docs/api/cyclone/foreign.md b/docs/api/cyclone/foreign.md index 3f1e6618..8c81cd34 100644 --- a/docs/api/cyclone/foreign.md +++ b/docs/api/cyclone/foreign.md @@ -2,12 +2,15 @@ The `(cyclone foreign)` provides a convenient interface for integrating with C code. It is based in concept on the `(chicken foreign)` module from CHICKEN Scheme. Similarly to that module, this library manipulates the C code directly before it is compiled to a native binary. It is not possible to call these forms at runtime. -# Overview +# API - [`c-code`](#c-code) - [`c-value`](#c-value) - [`c-define`](#c-define) - [`c-define-type`](#c-define-type) +- [`opaque?`](#opaque?) +- [`opaque-null?`](#opaque-null?) +- [`make-opaque`](#make-opaque) ## c-code @@ -51,6 +54,23 @@ EG, to define a type that consists of integers in Scheme and strings in C: (c-define-type string-as-integer string number->string string->number) +## opaque? + + (opaque? obj) + +Predicate to determine if `obj` is a C Opaque object. + +## opaque-null? + + (opaque-null? obj) + +Predicate to determine if `obj` is a C Opaque object that contains `NULL`. + +## make-opaque + + (make-opaque) + +Create a C Opaque object containing `NULL`. # Type Specifiers diff --git a/libs/cyclone/foreign.sld b/libs/cyclone/foreign.sld index 391f1eea..8acf71dd 100644 --- a/libs/cyclone/foreign.sld +++ b/libs/cyclone/foreign.sld @@ -89,7 +89,6 @@ ;; - type - Data type of the Scheme object ;; Returns: ;; - C code used to unbox the data - ;(define (scm->c code type) (define-syntax scm->c (er-macro-transformer (lambda (expr rename compare)