gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gnunet-scheme] 10/324: Define a few libextractor metaformats


From: gnunet
Subject: [gnunet-scheme] 10/324: Define a few libextractor metaformats
Date: Tue, 21 Sep 2021 13:20:50 +0200

This is an automated email from the git hooks/post-receive script.

maxime-devos pushed a commit to branch master
in repository gnunet-scheme.

commit 4b19c9de292027775caa3d3485c2f7fdc486f889
Author: Maxime Devos <maximedevos@telenet.be>
AuthorDate: Thu Nov 5 20:08:25 2020 +0000

    Define a few libextractor metaformats
---
 gnu/extractor/metaformats.scm | 48 +++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 48 insertions(+)

diff --git a/gnu/extractor/metaformats.scm b/gnu/extractor/metaformats.scm
new file mode 100644
index 0000000..3b99c45
--- /dev/null
+++ b/gnu/extractor/metaformats.scm
@@ -0,0 +1,48 @@
+;;   This file is part of scheme-extractor.
+;;   scheme-extractor is a partial Scheme port of libextractor.
+;;   A previous iteration of this file is part of libextractor.
+;;   Copyright (C) 2002-2017 Vidyut Samanta and Christian Grothoff
+;;   Copyright (C) 2020 Maxime Devos
+;;
+;;   libextractor is free software; you can redistribute it and/or modify
+;;   it under the terms of the GNU General Public License as published
+;;   by the Free Software Foundation; either version 3, or (at your
+;;   option) any later version.
+;;
+;;   libextractor 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 GNU
+;;   General Public License for more details.
+;;
+;;   You should have received a copy of the GNU General Public License
+;;   along with libextractor; see the file COPYING.  If not, write to the
+;;   Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+;;   Boston, MA 02110-1301, USA.
+
+;; SPDX-License-Identifier: GPL-3.0-or-later
+;; Upstream source: src/include/extractor.h
+
+(library (gnu extractor metaformat)
+  (export meta-format?
+         meta-format->integer
+         integer->meta-format
+         METAFORMAT_UNKNOWN
+         METAFORMAT_UTF8
+         METAFORMAT_BINARY
+         METAFORMAT_C_STRING)
+  (import (gnu extractor enum))
+
+  (define-wrapped-enum (<meta-format> meta-format? integer->meta-format
+                                     meta-format->integer)
+    (#:max 255) ;; TODO: figure out actual maximum
+    (#:known
+     ;; Format is unknown.
+     (METAFORMAT_UNKNOWN 0)
+     ;; 0-terminated, UTF-8 encoded string.  "data_len"
+     ;; is strlen(data)+1.
+     (METAFORMAT_UTF8 1)
+     ;; Some kind of binary format, see given Mime type.
+     (METAFORMAT_BINARY 2)
+     ;; 0-terminated string.  The specific encoding is unknown.
+     ;; "data_len" is strlen (data)+1.
+     (METAFORMAT_C_STRING 3))))

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]