NIH Utility Library

Related tags

Miscellaneous libnih
Overview
libnih is a light-weight "standard library" of C functions to ease the
development of other libraries and applications.

Its goals are:

 * despite its name, to _not_ reimplement anything found in the
   standard C library or any library normally found in /lib;

 * use standard C types and conventions where appropriate;

 * have a simple and consistent programming interface;

 * be useful to library developers without needing to be exposed in
   the library's API;

 * not hide implementation details or structure contents, we're all
   adults after all.


Dependencies
------------

The D-Bus messaging system is required to build the libnih-dbus library
and nih-dbus-tool utility.  In order to query the availability of the
external library, the pkg-config tool is used; and in order to parse
D-Bus introspection data, the expat XML parsing library will be used.

The recommended versions are:

	* pkg-config 0.22
	* D-Bus 1.2.16
	* expat 2.0.0

These should all be available from the current release of any modern
Linux distribution.

For detailed compilation and installation instructions see the INSTALL
file.  If you've checked libnih out from revision control, or want to
hack on libnih, see the HACKING file.


Cross-compiling
---------------

libnih uses the nih-dbus-tool utility it builds during its own build
process to generate further sources to be built.  When cross-compiling
this will fail because the built nih-dbus-tool will most likely not be
able to run on the build architecture.

This can be solved by building and installing nih-dbus-tool for the
build architecture first, then when performing the cross-compile, the
installed copy will be used instead.

If installed into a common system directory, this is automatic; if not,
you can pass the path of the nih-dbus-tool binary to the configure
script, e.g.:

	./configure --build=i486-linux-gnu --host=gnueabi-linux-arm \
		NIH_DBUS_TOOL=/cross/bin/nih-dbus-tool
Comments
  • Update dbus code generator to allow for empty lists for type 'as'

    Update dbus code generator to allow for empty lists for type 'as'

    Upstart when in user-session mode, needs to pass lists over dbus connection which may be empty.

    This drops the != NULL check for NULL terminated arrays and moves the iteration loop inside an 'if' statement.

    opened by xnox 3
  • Fallback to lstat, if the non-portable dirent.d_type is not available.

    Fallback to lstat, if the non-portable dirent.d_type is not available.

    Fixes running libnih & upstart on XFS filesystem (and others that don't implement dirent.d_type)

    Bug-Debian: http://bugs.debian.org/695604 Bug-Ubuntu: https://bugs.launchpad.net/bugs/672643

    opened by xnox 1
  • Enable automake's subdif-objects option.

    Enable automake's subdif-objects option.

    automake 2.0 will enable subdir-objects by default. 1.14 now issues warnings when sources are used from subdirectories, yet subdir-objects option is not used. libnih compiles with and without this option. with this option enabled, no warnings are displayed for each test_foo_SOURCES = tests/test_foo.c and the test_foo.o is placed in tests/test_foo.o instead of ./test_foo.o

    opened by xnox 0
  • Drop including (unused) malloc.h

    Drop including (unused) malloc.h

    malloc.h used to define malloc hooks API, which have been deprecated and marked volatile in (e)glibc 2.14. Malloc hooks, nor other special facilities defined in malloc.h, appear to not be used, thus this include is redundant.

    http://sourceware.org/ml/libc-alpha/2011-05/msg00103.html

    opened by xnox 0
  • Fixups

    Fixups

    Libnih fixups:

    • fix FTBFS with external LIBINTL
    • fix FTBFS when certain signals are not defined
    • update to use standard includes
    • update to use PT_* constants
    opened by xnox 0
  • nih-dbus-tool cannot handle DBUS_TYPE_VARIANT

    nih-dbus-tool cannot handle DBUS_TYPE_VARIANT

    $ make org.freedesktop.systemd1.h
      GEN      org.freedesktop.systemd1.h
    nih-dbus-tool:marshal.c:172: Not reached assertion failed in marshal
    /bin/bash: line 4: 12193 Aborted                 (core dumped) /usr/bin/nih-dbus-tool --package=upstart --  mode=proxy --prefix=systemd --default-interface=org.freedesktop.systemd1.Manager --output=org.freedesktop.systemd1.h org.freedesktop.systemd1.xml
    

    that seems to explode upon seeing DBUS_TYPE_VARIANT, looking at the code, indeed there is no support to generate that. Not a blocker for me, for now.

    opened by xnox 1
  • Possibility of adding a new D-Bus annotation to nih-dbus-tool.

    Possibility of adding a new D-Bus annotation to nih-dbus-tool.

    Hi Scott,

    We're using NIH for https://github.com/cgmanager/cgmanager. However, we need to use SCM_CRED/SCM_CREDENTIALS which is not supported by dbus on Linux.

    We were therefore wondering about the possibility of adding a new D-Bus annotation to nih-dbus-tool say "client must send SCM creds with this method". FWICS, annotations only affect the tools that generate bindings code but are also some sort of loose contract between the D-Bus client and the server.

    The D-Bus spec only seems to touch on the precise meaning of annotations very lightly unless I'm missing something. The D-Bus tutorial does cover them in a little more detail, but it seems unreasonable to consider the tutorial part of the official spec to me.

    What the spec does refer to is "well-known" annotations which implies that other annotations may be possible? Indeed, I notice that although NIH supports async methods it does so using "com.netsplit.Nih.Method.Async" rather than the semi-well-known "org.freedesktop.DBus.GLib.Async" (semi since it's not in the spec, but is in the tutorial!)

    Can you offer any advice or insight into this?

    Cheers,

    James.

    opened by jamesodhunt 1
  • Add travis support

    Add travis support

    Add integration with free CI service http://travis-ci.org to execute unit-tests on each push/branch/merge-proposal. At the moment nih_watch_reader tests hang indefinitely on travis-ci infrastructure which have been disabled for now.

    I will investigate further why it fails in their environment. To further gather environment details I've executed procenv in that environment (expand context to see line 450 onwards at https://travis-ci.org/xnox/libnih/builds/14676025 ) which indicates an Ubuntu 12.04 OpenVZ container.

    opened by xnox 1
  • Make test.h use TAP formatted output

    Make test.h use TAP formatted output

    This branch changes output:

        Testing nih_main_write_pidfile()
        ...with successful write
        ...with overwrite of existing pid
        ...with failure to write to temporary file
    

    To:

    ok 21 - nih_main_write_pidfile() 
    ok 22 - nih_main_write_pidfile() with successful write
    ok 23 - nih_main_write_pidfile() with overwrite of existing pid
    ok 24 - nih_main_write_pidfile() with failure to write to temporary file
    

    Which is in TAP format (Test Anything Protocol).

    This results in automake build logs change from:

    ...
    PASS: test_command
    PASS: test_config
    PASS: test_logging
    PASS: test_error
    ...
    ============================================================================
    Testsuite summary for libnih 1.0.4
    ============================================================================
    # TOTAL: 17
    # PASS:  17
    # SKIP:  0
    # XFAIL: 0
    # FAIL:  0
    # XPASS: 0
    # ERROR: 0
    ============================================================================
    

    To:

    PASS: test_error 1 - nih_error_raise()
    PASS: test_error 2 - nih_error_raise_printf()
    PASS: test_error 3 - nih_error_raise_system()
    PASS: test_error 4 - nih_error_raise_no_memory()
    PASS: test_error 5 - nih_error_raise_error()
    PASS: test_error 6 - nih_error_raise_error() with no current error
    PASS: test_error 7 - nih_error_raise_error() with unhandled error
    PASS: test_error 8 - nih_return_error()
    PASS: test_error 9 - nih_return_system_error()
    PASS: test_error 10 - nih_return_no_memory_error()
    PASS: test_error 11 - nih_error_steal()
    PASS: test_error 12 - nih_error_steal() with same context
    PASS: test_error 13 - nih_error_steal() with different contexts
    PASS: test_error 14 - nih_error_push_context()
    PASS: test_error 15 - nih_error_pop_context()
    PASS: test_error 16 - nih_error_pop_context() with unhandled error in context
    PASS: test_error 17 - nih_error_pop_context() with unhandled error beneath context
    make[3]: Entering directory `/home/xnox/canonical/libnih/libnih/nih'
    make[3]: Nothing to be done for `all'.
    make[3]: Leaving directory `/home/xnox/canonical/libnih/libnih/nih'
    ============================================================================
    Testsuite summary for libnih 1.0.4
    ============================================================================
    # TOTAL: 839
    # PASS:  839
    # SKIP:  0
    # XFAIL: 0
    # FAIL:  0
    # XPASS: 0
    # ERROR: 0
    ============================================================================
    

    Which is a more accurate and useful build-log output. Furthermore it will enable: skipping tests, marking them expected fail, marking them TODO (unimplemented features), whilst accurately reporting each one of them.

    There is no break in testing API and this implementation works across all libnih tests. There is no dependency on executing the test-suite under the TAP runner.

    There is one change of behaviour: instead of aborting (bailing) on test failure, a FAIL is reported and the individual test binary will "keep going". I believe this is acceptable as the overall build will fail and is accurately reported. I added a define "TEST_TAP_BAIL_ON_FAIL" which will report a TAP "bail" command and abort as it was done previously. In case one wants previous behaviour.

    opened by xnox 4
Owner
Scott James Remnant
Scott James Remnant
Utility Library for Imaging Systems

Overview ULIS is a rendering library written in C++. It is aimed at software rasterization and digital image processing. Official Github Repository Pr

Praxinos 34 Nov 13, 2022
ZSV/lib: a fast CSV parsing library and standalone utility

Please note: this code is still alpha / pre-production. Everything here should be considered preliminary. If you like ZSVlib, please give it a star! Z

null 96 Dec 30, 2022
A utility library to use/bootstrap Soracom Arc easily on ESP32 Arduino boards

soracom-arc-esp32-arduino A utility library to use/bootstrap Soracom Arc easily on ESP32 Arduino boards. Synopsis #include <SoracomArcESP32.h> #includ

Soracom Labs 2 Dec 20, 2021
Simple and Fast Network Utility Library

SFNUL Simple and Fast Network Utility library © binary1248 SFNUL is provided under the Mozilla Public License Version 2.0 (see LICENSE for details)

null 49 Feb 17, 2022
JoyfulNoise Tiny Utility Board

JoyfulNoise Tiny Utility Board A versatile ATtiny85-powered Eurorack module in 4HP. License JoyfulNoise hardware and software is Open Source. The JNTU

Ben Reeves 22 Jul 25, 2022
Linux x86_64 Process Injection Utility | Manipulate Processes With Customized Payloads (beta)

K55 - Linux x86_64 Process Injection Utility (C++11) About K55 (pronounced: "kay fifty-five") The K55 payload injection tool is used for injecting x86

Josh Schiavone 57 Sep 5, 2022
Basic definitions and utility functions for GNSS raw measurement processing

gnss_comm Authors/Maintainers: CAO Shaozu (shaozu.cao AT gmail.com) The gnss_comm package contains basic definitions and utility functions for GNSS ra

HKUST Aerial Robotics Group 70 Dec 21, 2022
The AudioUnitSDK contains a set of base classes as well as utility sources required for Audio Unit development.

The AudioUnitSDK contains a set of base classes as well as utility sources required for Audio Unit development.

Apple 87 Jan 3, 2023
On-device signing utility for iOS

ReProvision Reborn Re-sign applications on your device. This project aims at making it easier to (re-)sign iOS and Apple Watch applications on a jailb

Soh Satoh 72 Nov 29, 2022
sc-ble-bridge is a utility that for every connected Steam Controller creates a virtual one acting as a bridge between SC and Steam

sc-ble-bridge The main goal of this utility is to provide workaround for steam-for-linux issue which makes Valve's Steam Controller unusable in BLE mo

null 5 Apr 19, 2022
A simple utility that cold patches dwm (uDWM.dll) in order to disable window rounded corners in Windows 11

Win11DisableRoundedCorners A simple utility that cold patches the Desktop Window Manager (uDWM.dll) in order to disable window rounded corners in Wind

Valentin-Gabriel Radu 516 Dec 27, 2022
A simple utility for loading custom firmware onto the PS5 camera, using libusb.

A simple utility for loading custom firmware onto the PS5 camera, using libusb.

Raleigh Littles 21 Nov 10, 2022
Utility to install kexts, Frameworks and PrivateFrameworks in the System of macOS. For macOS Monterey 12 and Big Sur 11

Command-Line-SnapShot-Mounter Credit: chris1111 Apple This utility uses the macOS terminal Command Line SnapShot Mounter is an utility that allows you

chris1111 23 Jan 8, 2023
A utility to run ELF files in memory.

execelf - A utility to execute ELF files in memory. execelf is small utility for running ELF files in memory, without touching the disk! Installation

null 11 Nov 21, 2022
Broadcom PatchRAM DFU (Device Firmware Upgrade) utility for macOS.

patchram Broadcom PatchRAM DFU (Device Firmware Upgrade) utility for macOS. Based on original dfu-tool & dfu-programmer for Linux and BrcmPatchRAM for

null 13 Dec 11, 2022
This is some utility functions/classes for having a nice way to communicate with a pico board RP2040

PicoScreenTerminal This is some utility functions/classes for having a nice way to communicate with a pico board RP2040 How to build First follow the

GuillaumeG. 4 Nov 15, 2021
A utility to automate the installation, maintenance, and debugging of Asterisk/DAHDI, while integrating additional patches to provide the richest telephony experience

PhreakScript A utility to automate the installation, maintenance, and debugging of Asterisk/DAHDI, while integrating additional patches to provide the

null 14 Dec 22, 2022
A simply GUI to change settings in coreboot's CBFS, via the nvramtool utility.

coreboot-configurator A simple GUI to change settings in coreboot's CBFS, via the nvramtool utility. How to install Ubuntu, Linux Mint, elementary OS,

Star Labs 43 Jan 2, 2023
Karabiner-Elements is a powerful utility for keyboard customization on macOS Sierra (10.12) or later.

Karabiner-Elements Karabiner-Elements is a powerful utility for keyboard customization on macOS Sierra or later. Download You can download Karabiner-E

null 15.7k Dec 29, 2022