metaformats.scm 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. ;; This file is part of scheme-extractor.
  2. ;; scheme-extractor is a partial Scheme port of libextractor.
  3. ;; A previous iteration of this file is part of libextractor.
  4. ;; Copyright (C) 2002-2017 Vidyut Samanta and Christian Grothoff
  5. ;; Copyright (C) 2020 GNUnet e.V.
  6. ;;
  7. ;; libextractor is free software; you can redistribute it and/or modify
  8. ;; it under the terms of the GNU General Public License as published
  9. ;; by the Free Software Foundation; either version 3, or (at your
  10. ;; option) any later version.
  11. ;;
  12. ;; libextractor is distributed in the hope that it will be useful, but
  13. ;; WITHOUT ANY WARRANTY; without even the implied warranty of
  14. ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  15. ;; General Public License for more details.
  16. ;;
  17. ;; You should have received a copy of the GNU General Public License
  18. ;; along with libextractor; see the file COPYING. If not, write to the
  19. ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  20. ;; Boston, MA 02110-1301, USA.
  21. ;; SPDX-License-Identifier: GPL-3.0-or-later
  22. ;; Upstream source: src/include/extractor.h
  23. (library (gnu extractor metaformats)
  24. (export meta-format?
  25. meta-format->integer
  26. integer->meta-format
  27. METAFORMAT_UNKNOWN
  28. METAFORMAT_UTF8
  29. METAFORMAT_BINARY
  30. METAFORMAT_C_STRING)
  31. (import (gnu extractor enum))
  32. (define-wrapped-enum (<meta-format> meta-format? integer->meta-format
  33. meta-format->integer)
  34. (#:max 4294967295)
  35. (#:known
  36. ;; Format is unknown.
  37. (METAFORMAT_UNKNOWN 0)
  38. ;; 0-terminated, UTF-8 encoded string. "data_len"
  39. ;; is strlen(data)+1.
  40. (METAFORMAT_UTF8 1)
  41. ;; Some kind of binary format, see given Mime type.
  42. (METAFORMAT_BINARY 2)
  43. ;; 0-terminated string. The specific encoding is unknown.
  44. ;; "data_len" is strlen (data)+1.
  45. (METAFORMAT_C_STRING 3))))