OS4 DepotLogo by Nickman 
(anonymous IP: 216.73.216.57,2504) 
 HomeRecentStatsSearchSubmitUploadsMirrorsContactInfoDisclaimerConfigAdmin
 Menu

 Features
   Crashlogs
   Bug tracker
   Locale browser
 

 Categories

   o Audio (351)
   o Datatype (51)
   o Demo (207)
   o Development (628)
   o Document (24)
   o Driver (102)
   o Emulation (155)
   o Game (1050)
   o Graphics (516)
   o Library (123)
   o Network (241)
   o Office (69)
   o Utility (960)
   o Video (74)

Total files: 4551

Full index file
Recent index file

 Links

  Amigans.net
  Aminet
  IntuitionBase
  Hyperion Entertainment
  A-Eon
  Amiga Future


Support the site


 Readme for:  Development » Library » Misc » json-c.lha

JSON-C

Description: Parse/generate JSON, static libs+headers
Download: json-c.lha       (TIPS: Use the right click menu if your browser takes you back here all the time)
Size: 867kb
Version: 0.19
Date: 30 Aug 2026
Author: Cameron Armstrong (Nightfox)
Submitter: Samir Hawamdeh
Homepage: https://github.com/sacredbanana/AmigaSDK-gcc
Category: development/library/misc
Replaces: development/library/misc/json-c.lha
License: Other
Distribute: yes
Min OS Version: 4.0
FileID: 14037
 
Comments: 0
Snapshots: 0
Videos: 0
Downloads:  (Current version)
175  (Accumulated)
Votes: 0 (0/0)  (30 days/7 days)

Show comments Show snapshots Show videos Show content Show crashlogs Replace file 
json-c implements a reference-counted object model for JSON, a parser that
builds it from text, and a serialiser that writes it back out. This archive
contains static libraries and public headers for Amiga development.

    https://github.com/json-c/json-c


Contents

    json-c/json-c.readme             this file
    json-c/AmigaOS3/...              m68k AmigaOS libraries and headers
    json-c/AmigaOS4/...              ppc-amigaos libraries and headers
    json-c/MorphOS/...               ppc-morphos libraries and headers

    Under each OS directory the trees follow the compiler's own layout, so
    they can be copied straight over an existing SDK, e.g.

        cp -a json-c/AmigaOS3/* /opt/amiga/m68k-amigaos/

    AmigaOS3 ships one set per C runtime -- newlib at the top level, plus
    libnix/ and clib2/ -- and within each, one library per multilib:

        lib/                   68000, absolute addressing
        lib/libm020/           68020, absolute addressing
        lib/libb/              68000, -fbaserel
        lib/libb/libm020/      68020, -fbaserel
        lib/libb32/libm020/    68020, -fbaserel32

    On PPC a C runtime is not a separate tree but a multilib slot beneath one
    shared lib/, with headers in the single shared include/:

        AmigaOS4    lib/               newlib
                    lib/clib2/         clib2
                    lib/clib4/         clib4

        MorphOS     lib/               ixemul
                    lib/libb32/        ixemul, -mbaserel32
                    lib/libnix/        native C library (-noixemul)
                    lib/libb32/libnix/ native C library, -mbaserel32

    -mclib=libnix and -noixemul select the same MorphOS multilib. That ABI is
    the self-contained one -- an ixemul build needs ixemul.library on the
    target -- so prefer lib/libnix/ for new code.


Usage

    #include <json-c/json.h>

    struct json_object *o = json_tokener_parse("{"a":1}");
    printf("%sn", json_object_to_json_string(o));
    json_object_put(o);

    Link with -ljson-c -lm, after your own objects on the command line. For
    clib2 add -lunix as well, since clib2 keeps its POSIX layer there.


Which variants link

    Verified by compiling the snippet above against each shipped library.

    AmigaOS3  libnix    all 5 slots link.

              clib2     lib/libm020/ and lib/libb32/libm020/ link. The other
                        three fail inside clib2 itself: its 68000 multilib has
                        no strtoll()/strtoull(), and 16-bit -fbaserel overflows
                        with "truncated to fit: DREL16" once json-c's data is
                        added. -fbaserel32 has no such limit.

              newlib    builds, but does not link: the m68k newlib tree has no
                        gettimeofday(). The libraries are shipped anyway, since
                        that is a gap in the SDK rather than in json-c and a
                        newlib with gettimeofday() implemented would link.

    AmigaOS4  all three (newlib, clib2, clib4) link.

    MorphOS   all four slots link.


A note on base-relative addressing (AmigaOS3)

    A base-relative library addresses its globals through a4, which the
    program's startup code sets up once. Only link the libb/ or libb32/
    variants into a program that is itself base-relative AND that marks every
    function the OS calls back into (BOOPSI/MUI dispatchers, struct Hook
    entries, interrupt servers) with __saveds. The m68k SDI_hook.h macros set
    up register arguments but do not add __saveds, so this is easy to get
    wrong, and the failure mode is intermittent memory corruption rather than
    a clean error -- libnix keeps malloc's heap state in a4-relative storage.

    Conversely a non-base-relative library built at -O1 or above may use a4 as
    a scratch register, which is harmless in a non-base-relative program but
    corrupts the base pointer of one that is.

    Match the variant to the program. If in doubt, use the plain lib/ or
    lib/libm020/ builds.


Licence

    MIT; see COPYING in the source distribution.

Copyright © 2004-2026 by Björn Hagström All Rights Reserved