OS4 DepotLogo by Alkaron 
(anonymous IP: 216.73.216.157,2527) 
 HomeRecentStatsSearchSubmitUploadsMirrorsContactInfoDisclaimerConfigAdmin
 Menu

 Features
   Crashlogs
   Bug tracker
   Locale browser
   Markdown composer
 

 Categories

   o Audio (353)
   o Datatype (51)
   o Demo (214)
   o Development (630)
   o Document (24)
   o Driver (103)
   o Emulation (157)
   o Game (1067)
   o Graphics (519)
   o Library (124)
   o Network (245)
   o Office (74)
   o Utility (962)
   o Video (75)

Total files: 4598

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: 1Mb
Version: 0.19
Date: 08 Nov 2026
Author: Cameron Armstrong (Nightfox)
Submitter: Samir Hawamdeh
Homepage: https://github.com/sacredbanana/AmigaSDK-gcc
Requirements: An AmigaOS GCC compiler
Category: development/library/misc
Replaces: development/library/misc/json-c.lha
License: Other
Distribute: yes
Min OS Version: 4.0
FileID: 14243
 
Comments: 0
Snapshots: 0
Videos: 0
Downloads: 1  (Current version)
226  (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
        lib/libm020/libm881/          68020 + FPU (-m68881, -mhard-float,
        lib/libb/libm020/libm881/     also -m68040/-m68060), absolute,
        lib/libb32/libm020/libm881/   -fbaserel and -fbaserel32

    The libm881/ builds use FPU instructions. Without them an FPU program
    would fall back to the soft-float libm020/ build, which clib2 cannot link
    (its FPU libm has no soft-float helpers such as __adddf3).

    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  all 8 slots link for newlib, libnix and clib2, provided the
              compiler image carries the AmigaSDK-gcc cleanup of 2026-11 that
              stopped stale 2023/2024 toolchain files overwriting the newer
              newlib and clib2. Older images lack strtoll()/strtoull() in
              clib2's 68000 multilib and gettimeofday() in newlib, and fail
              -fbaserel clib2 links with a "dangerous relocation".

              Known toolchain issue: with clib2, -m68040/-m68060 on their
              own compile soft-float code but link the FPU libraries. Add
              -m68881.

    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.


History

    0.19-6c5f644
        Rebuilt from the official json-c 0.19 release. The earlier upload
        labelled 0.19 was built from pre-release master sources; please use
        this one instead.

Licence

    MIT; see COPYING in the source distribution.

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