npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

objc-polycall

v1.0.0

Published

Objective-C / Foundation source binding for the Polycall C library (binding ABI v1)

Readme

objc-polycall

Objective-C / Foundation binding for Polycall: the binding ABI v1 of the Polycall C library (polycall.h, libpolycall), with Cocoa conventions (NSString, NSData, NSError).

Configuration parsing, validation, networking and runtime policy remain in the core. The Objective-C layer converts NSString to UTF-8, NSData to (pointer, length), and maps every non-zero status into an NSError that carries the status code, its polycall_strerror name and the polycall_last_error detail.

Requirements

  • The Polycall core 1.1.0 or newer (binding ABI 1) with its headers and pkg-config file (libpolycall-dev, or a CMake install of the core), found with pkg-config polycall (set PKG_CONFIG_PATH for a non-default prefix).
  • A Foundation implementation:
    • macOS Foundation with clang (ARC), or
    • GNUstep Base: GCC/gobjc with manual reference counting (the Debian/Ubuntu packages gobjc gnustep-devel), or clang + libobjc2 (add -fobjc-arc). The sources compile under both ARC and MRC.
  • GNU Make.

Tested: Linux x86_64 with GNUstep Base 1.28 and GCC 12 (Debian 12). macOS is supported by the sources and the Makefile defaults but has not been tested (no macOS host was available). On Windows only the portable C shim has been built and tested (MinGW-w64 UCRT64 and MSVC, against libpolycall.dll / polycall.dll); the Objective-C layer needs an Objective-C + Foundation toolchain for Windows (e.g. GNUstep for MSYS2), which was not available.

Build

export PKG_CONFIG_PATH=/opt/polycall/lib/pkgconfig   # if the core is not in a default prefix
make            # C forwarding shim: lib/libobjc_polycall.a
make objc       # Foundation library: lib/libObjCPolycall.a
make example    # build/objc-polycall-example

On macOS the defaults are clang -fobjc-arc -framework Foundation; elsewhere OBJCFLAGS / FOUNDATION_LIBS come from gnustep-config. Override OBJC, OBJCFLAGS, FOUNDATION_LIBS, POLYCALL_CFLAGS or POLYCALL_LIBS as needed.

API

#import <OBNPolycall.h>

// library / ABI
NSError *error = nil;
if (![OBNPolycall checkABIVersion:&error]) { /* not binding ABI 1: error names the library */ }
NSString *version = [OBNPolycall libraryVersion];          // @"1.1.0"

// configuration -- the documented entry points are strict (run = 1)
int32_t status = [OBNPolycall rawStatusForConfigAtPath:@"objc-polycallrc"];
BOOL ok = [OBNPolycall runConfigAtPath:@"objc-polycallrc" error:&error];
ok = [OBNPolycall runConfigAtPath:@"objc-polycallrc" strict:NO error:&error];  // unknown keys warn
NSString *json = [OBNPolycall describeConfigAtPath:@"Polycallfile" error:&error];

// RPC to `polycall daemon start` / `polycall start` (one round trip, never retried)
NSString *out = [OBNPolycall callEndpoint:@"127.0.0.1:8084" service:@"inventory"
                                operation:@"get" inputJSON:@"{\"item_id\":\"widget-a\"}"
                                timeoutMs:2000 error:&error];

// peer nodes (polycall-peer/1, no broker)
OBNPolycallPeer *alpha = [OBNPolycallPeer peerWithNodeID:@"alpha" bindEndpoint:@"127.0.0.1:0"
                                               authToken:token error:&error];
[alpha registerPeer:@"beta" endpoint:betaEndpoint error:&error];
[alpha ping:@"beta" timeoutMs:2000 error:&error];
[alpha sendData:payload toPeer:@"beta" messageID:@"m-1" timeoutMs:2000 error:&error];
OBNPolycallMessage *m = [beta receiveWithTimeoutMs:2000 error:&error];  // m.sender, m.messageID, m.payload
[beta cancel:&error];   // wakes receives blocked on beta (POLYCALL_E_CANCELLED)
[beta close:&error];    // wakes them with POLYCALL_E_CLOSED; a second close fails with INVALID_HANDLE

OBNPolycallPeer also has endpoint:, nodeID:, unregisterPeer:error:, registry: / registryJSON:, healthJSON:, sendString:... and receiveWithTimeoutMs:capacity:error:. All methods are thread-safe; a receive blocks only its own thread, and cancel: / close: from another thread wake it.

Errors

NSError.domain is OBNPolycallErrorDomain, NSError.code the Polycall status (OBNPolycallStatus..., e.g. OBNPolycallStatusTimeout = -4). The userInfo holds:

| key | value | | --- | --- | | OBNPolycallStatusNameKey | polycall_strerror(status), e.g. POLYCALL_E_TIMEOUT: deadline exceeded | | OBNPolycallDetailKey | polycall_last_error() read on the failing thread | | OBNPolycallRemoteErrorKey | for calls: the remote error object JSON, when present | | OBNPolycallRequiredSizeKey | for POLYCALL_E_TOO_LARGE: bytes the core asked for | | NSLocalizedDescriptionKey | "<name> [<status>]: <detail>" |

A string containing U+0000 cannot cross the C ABI unchanged and is refused with POLYCALL_E_INVALID_ARGUMENT instead of being truncated.

Loading

The library is linked through pkg-config, so the OS loader resolves libpolycall: a missing library or a 1.0 library without the ABI v1 symbols stops the program with the loader's message (exit 127, no crash), and a library reporting another binding ABI makes every API fail with POLYCALL_E_UNSUPPORTED ("binding ABI mismatch", naming the library file). Nothing the library returns is freed by the binding; a peer handle is released exactly once (close:, or dealloc when it was never closed).

Install the source package

npm install objc-polycall

The npm package ships the project sources (src, include, examples, tests, scripts, Makefile). Its CommonJS entry point only indexes them:

const objcPolycall = require('objc-polycall');
console.log(objcPolycall.directories.src.relativeFiles);
console.log(objcPolycall.resolve('examples', 'main.m'));

Build the native code from the installed package directory with make.

Verification

npm test            # adapter unit test (mock core), thin-adapter audit, npm index test
make test-real      # REAL core: C shim, Objective-C suite, loader errors
make build/objc_polycall_test && sh tests/valgrind.sh   # memory check (valgrind)
sh tests/run-real-core.sh   # everything above, plus npm pack/install into a clean project

The real-core suite needs libpolycall and, for the daemon and C-peer interop checks, the polycall CLI on PATH; without the CLI those checks print SKIP, never PASS. See tests/TESTS.md.

Package layout

  • src/ — Objective-C implementation and the C forwarding shim
  • include/ — public headers and Clang module map
  • examples/ — command-line example and configuration
  • tests/ — real-core suites, loader fixtures, adapter unit test
  • scripts/ — thin-adapter audits

Author and license

Copyright © 2026 Nnamdi Michael Okpala [email protected].

Released under the MIT License.