Skip to content

Commit

Permalink
feat(json): json package
Browse files Browse the repository at this point in the history
  • Loading branch information
neverbot committed May 2, 2024
1 parent 6eb462f commit 023df31
Show file tree
Hide file tree
Showing 4 changed files with 742 additions and 0 deletions.
1 change: 1 addition & 0 deletions mudlib/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
/packages/*
!/packages/crypt
!/packages/issues
!/packages/json
!/packages/test
!/packages/time

Expand Down
2 changes: 2 additions & 0 deletions mudlib/packages/json/master.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@

inherit "/packages/json/src/json.c";
53 changes: 53 additions & 0 deletions mudlib/packages/json/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@

# json.c

LPC support functions for JSON serialization and deserialization.
Attempts to be compatible with reasonably current FluffOS and LDMud
drivers, with at least a gesture or two toward compatibility with
older drivers.

Web site for updates: [http://lostsouls.org/grimoire_json](http://lostsouls.org/grimoire_json)

`mixed json_decode(string text)`
Deserializes JSON into an LPC value.

`string json_encode(mixed value)`
Serializes an LPC value into JSON text.

v1.0: initial release
v1.0.1: fix for handling of \uXXXX on MudOS
v1.0.2: define array keyword for LDMud & use it consistently

## LICENSE

```
The MIT License (MIT)
Copyright (c) 2014 Lost Souls MUD
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
```

## Updates

Modifications for Hexagon, neverbot 05/2024

- Removed 'array' reserved words, multiple drivers definitions.
- Fixes for DGD (varargs in the right place, variable definition and initialization
in different lines).
Loading

0 comments on commit 023df31

Please sign in to comment.