From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Samuel Barreto Newsgroups: gmane.lisp.guile.user Subject: snarfing docstrings in c extensions Date: Sat, 07 Apr 2018 20:59:32 +0200 Message-ID: Reply-To: samuel.barreto8@gmail.com NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1523127478 13310 195.159.176.226 (7 Apr 2018 18:57:58 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 7 Apr 2018 18:57:58 +0000 (UTC) User-Agent: mu4e 0.9.19; emacs 26.0.91 To: "guile-user\@gnu.org" Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Sat Apr 07 20:57:54 2018 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f4t28-0003LH-J0 for guile-user@m.gmane.org; Sat, 07 Apr 2018 20:57:52 +0200 Original-Received: from localhost ([::1]:46371 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f4t4E-0003sD-9P for guile-user@m.gmane.org; Sat, 07 Apr 2018 15:00:02 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51588) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f4t3p-0003rl-Ed for guile-user@gnu.org; Sat, 07 Apr 2018 14:59:38 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f4t3o-0005LD-Mw for guile-user@gnu.org; Sat, 07 Apr 2018 14:59:37 -0400 Original-Received: from mail-wr0-x235.google.com ([2a00:1450:400c:c0c::235]:39111) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1f4t3o-0005Kw-FG for guile-user@gnu.org; Sat, 07 Apr 2018 14:59:36 -0400 Original-Received: by mail-wr0-x235.google.com with SMTP id c24so4418477wrc.6 for ; Sat, 07 Apr 2018 11:59:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=user-agent:from:to:subject:reply-to:date:message-id:mime-version; bh=+UP9oyOHn0r/HA2e8dlNl2AUD0eVjb/mBfGYZzFpPSQ=; b=B6CYUHshRnkShWddwFGCoDbBHbuylmKpFRk86EtXASzHFB0kkgqLqLLO1P2G8XXi8w ouQeD0gzDuKUMHhYhfQOhzT91cecc2SIMDnPYCQuVJqyYEWaBSW1s1NBL1MEOQw3bmRp zBpSTg4p6KiFSNtJ4kyTOr3b0CMViv90XVsaC7KhFrEgNWFLUhsTc/qwSxvbjuI+4pDJ bpX8fv8xHrKPQI8w0lrYz054jB31eOwcmv+M92zDRaMpv0z8bVoupVDwPFTRe5hiyZkv 76Th/cqAAsBDEYEYRooXbOEKUFvd0XM8Iq8AzKmzsGcTcCEQiDXPhTwYzFB4LBMRSrI4 Qehw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:user-agent:from:to:subject:reply-to:date :message-id:mime-version; bh=+UP9oyOHn0r/HA2e8dlNl2AUD0eVjb/mBfGYZzFpPSQ=; b=eQUj5SFGSfHwUjFAnNKvFb5f1vmKLib6HPI3sHrU0upiF/4dG1hA0vUy4kTKpYoLiZ mx9T/gKxnj+Dcxj8f80/cvIkk3x27gG+bETAJyqcOAaniSD6WMjX6TpVOmOiolp5Xjw/ sVjQVIHwje4mMXmFO6GtSIEW4bnnmWIEiDBFnQE0URsZk3UqzOCPXa4RQPjlu4ZpWDJI PYDpM6THTrahAIh2fGfTOpXVU1SGkJuQiuRiuNRufjoHfS2ImkEXIAIibv9RaPJiZtrM zbEA7jauV0+vMONlV/FvtwTJCoQCEGIeAAmkAizKEadKU3ER/kZvZEP2+BdxNcjiPN+Z LPDQ== X-Gm-Message-State: AElRT7HblYdqa211AW64D7ZmZZn/GrXzFVHXMKcYokPv7+tWXidmWixA KpKLpccwCtWOmZdFu7470u1x+A== X-Google-Smtp-Source: AIpwx49bZ3xHgmHAZb3HHHVEvbkIcahlqnJC3l8Fd+tmx4Y087g3Hp4jztFrxh/OcbPMquYvM36L+w== X-Received: by 10.223.129.199 with SMTP id 65mr21728241wra.159.1523127574860; Sat, 07 Apr 2018 11:59:34 -0700 (PDT) Original-Received: from localhost ([2a01:cb14:843:a700:9a2:badb:bf7e:9475]) by smtp.gmail.com with ESMTPSA id m35sm16810146wrm.59.2018.04.07.11.59.33 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 07 Apr 2018 11:59:33 -0700 (PDT) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c0c::235 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Original-Sender: "guile-user" Xref: news.gmane.org gmane.lisp.guile.user:14537 Archived-At: Hi everyone, I'm trying to write a GSL wrapper in guile. I have written a lot of simple functions using SCM_DEFINE and documented them using the last SCM_DEFINE macro argument. Now I'd like to make those docstrings accessible from Scheme code. The way I do it for now is with this makefile instructions: %.doc: %.c /wherevere/guile/source/code/is/libguile/guile-snarf-docs -o $@ $< \ -- $(CFLAGS) %.texi: %.doc cat $< | guild snarf-check-and-output-texi > $@ And then call makeinfo on it. (I had to change some hardcoded path in the guile-snarf-docs scripts so that it worked from another directory btw.) So I do am able to generate the info files that I want. My two problems are: 1. how to use guile-snarf-docs portably ? (I have hardcoded them in my Makefile for now.) 2. how to "link" them with functions defined in the extensions ? (I have tried to (set! documentation-files "PATH/TO/doc.txt") but I think I miss a step so that (procedure-documentation my-gsl-function) returns the docstring I want) And from a broader perspective, is it the way it is supposed to work ? I mean, am I doing it the right way or are other "guile-extension-writers" doing it otherwise ? Thank you for your help, samuel