Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
9 changes: 3 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ jobs:
runs-on: ubuntu-latest
env:
MIX_ENV: test
LIBWBXML_FORCE_BUILD: true

steps:
- name: Checkout repository
Expand All @@ -21,14 +20,12 @@ jobs:
version-file: .tool-versions
version-type: strict

- name: Install native dependencies
run: |
sudo apt-get update
sudo apt-get install -y pkg-config libexpat1-dev

- name: Install dependencies
run: mix deps.get

- name: Compile
run: mix compile --warnings-as-errors

- name: Run tests
run: mix test --warnings-as-errors

Expand Down
81 changes: 0 additions & 81 deletions .github/workflows/release.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ erl_crash.dump
*.ez

# Ignore package tarball (built via "mix hex.build").
wbxml_nif-*.tar
libwbxml-*.tar

# Temporary files, for example, from tests.
/tmp/
47 changes: 47 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Changelog

## 0.2.0

Rewrite in pure Elixir. The C library and the NIF are gone: no C compiler,
no expat, no `elixir_make`, no precompiled artifacts. The codec is a port of
libwbxml 0.11.10 (commit `e58b1f19f11dbadff53e5b486b8c4b16639a656a`) with
the same token tables and byte-identical output, verified against the
upstream test suite and against goldens generated from the C tools.

### Breaking changes

* `Libwbxml.decode/1` returns `{:ok, String.t()}` (a binary) instead of a
charlist.
* Errors are `{:error, reason}` where `reason` is an atom
(`:unknown_public_id`, `:strtbl_length`, ...) instead of a charlist with
the C library's message. `Libwbxml.Error.message/1` returns that message
and `Libwbxml.Error.from_message/1` maps a message back to its atom.
* Invalid arguments and unknown or malformed options raise `ArgumentError`.
* The package licence is now LGPL-2.1-or-later (previously "MIT for the
wrapper, LGPL-2.1 for libwbxml"): the Elixir code is a derivative work of
the C library.

Defaults are unchanged (`encode/1`: anonymous, string table on, WBXML 1.3;
`decode/1`: language `:activesync`, indent format with delta 0), so the
bytes and XML text produced for the default calls are the same as in 0.1.x.

### Added

* `Libwbxml.encode/2` options: `:version`, `:string_table`, `:anonymous`,
`:preserve_whitespace`, `:language`.
* `Libwbxml.decode/2` options: `:language` (including `nil` to detect the
language from the document's public ID), `:format`
(`:indent | :compact | :canonical`), `:indent`, `:charset`,
`:preserve_whitespace`.
* `Libwbxml.encode!/2` and `Libwbxml.decode!/2`, raising `Libwbxml.Error`.
* `Libwbxml.languages/0`: all 29 languages of the C library (WML, WTA,
Channel, SI, SL, CO, PROV, EMN, DRMREL, OTA Settings, SyncML/DevInf/MetInf
1.0-1.2, DM DDF 1.2, WV-CSP 1.1/1.2, AirSync, ActiveSync, ConML).
* Charset conversion for UTF-8, US-ASCII, ISO-8859-1, UTF-16 and UCS-2;
other charsets return `{:error, :no_charset_conv}`.
* `Libwbxml.Error` with the full upstream error table.

## 0.1.0

Initial release: an Erlang NIF wrapping the vendored libwbxml 0.11.10 C
library, with `encode/1` and `decode/1` hard-wired to ActiveSync.
File renamed without changes.
57 changes: 0 additions & 57 deletions Makefile

This file was deleted.

33 changes: 33 additions & 0 deletions NOTICE
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
libwbxml for Elixir
Elixir port Copyright (C) 2026 Jump AI

This package is a derivative work of libwbxml, the WBXML Library
(https://github.com/libwbxml/libwbxml), version 0.11.10, tag
libwbxml-0.11.10, commit e58b1f19f11dbadff53e5b486b8c4b16639a656a:

libwbxml, the WBXML Library.
Copyright (C) 2002-2008 Aymerick Jehanne <aymerick@jehanne.org>
Copyright (C) 2008-2011 Michael Bell <michael.bell@opensync.org>
Copyright (C) 2011,2014 Michael Bell <michael.bell@web.de>
Copyright (c) 2022 Open Mobile Platform LLC.

The token tables (lib/libwbxml/tables/generated/) were generated from
upstream's wbxml_tables.c, the encoder, parser, XML reader/writer, charset,
base64 and error modules are ports of the corresponding upstream C sources,
and the test fixtures under test/fixtures/upstream/ and test/fixtures/fuzz/
are upstream's test documents.

This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.

This library 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
Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public
License along with this library (see the LICENSE file); if not, write
to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
Boston, MA 02110-1301 USA
Loading