NIH Utility Library

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
Issues
  • 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
Apple Silicon to Apple Silicon VDM utility

Apple Silicon to Apple Silicon VDM tool This tool lets you get a serial console on an Apple Silicon device and reboot it remotely, using only another

Asahi Linux 125 Jul 14, 2022
EASTL stands for Electronic Arts Standard Template Library. It is an extensive and robust implementation that has an emphasis on high performance.

EA Standard Template Library EASTL stands for Electronic Arts Standard Template Library. It is a C++ template library of containers, algorithms, and i

Electronic Arts 6.6k Aug 10, 2022
Embedded Template Library

Embedded Template Library (ETL) Motivation C++ is a great language to use for embedded applications and templates are a powerful aspect. The standard

Embedded Template Library 1.3k Aug 8, 2022
An open-source C++ library developed and used at Facebook.

Folly: Facebook Open-source Library What is folly? Folly (acronymed loosely after Facebook Open Source Library) is a library of C++14 components desig

Facebook 22.8k Aug 5, 2022
Functional Programming Library for C++. Write concise and readable C++ code.

FunctionalPlus helps you write concise and readable C++ code. Table of contents Introduction Usage examples Type deduction and useful error messages T

Tobias Hermann 1.7k Aug 9, 2022
? A glib-like multi-platform c library

A glib-like cross-platform C library Supporting the project Support this project by becoming a sponsor. Your logo will show up here with a link to you

TBOOX 4.1k Aug 12, 2022
An open source library for C

Homo Deus - C Library Introduction The Homo Deus C Library (hdelibc) is an open source collection of tools for the C programming language. The project

Homo Deus 99 Aug 4, 2022
NIH Utility Library

libnih is a light-weight "standard library" of C functions to ease the development of other libraries and applications. Its goals are: * despite it

Scott James Remnant 81 Aug 7, 2022
KoanLogic 385 Aug 9, 2022
C language utility library

versatile and easy to use C language utility library with functions and macros commonly used in various applications

Tilen Majerle 36 May 30, 2022
websocket and http client and server library, coming with ws, a command line swiss army knife utility

Hello world IXWebSocket is a C++ library for WebSocket client and server development. It has minimal dependencies (no boost), is very simple to use an

Machine Zone, Inc. 329 Aug 8, 2022
libmorse - C library (and utility) for generating Morse code.

libmorse - C library (and utility) for generating Morse code. Library to generate and play morse code. Needs ALSA for audio playout. The intent here i

Kalopa Robotics 5 Nov 2, 2021
A Native Binary Emulator Library and Utility

binmulator A Native Binary Emulator Library and Utility Most emulators for malware detection are written in Python and fail when certain emulated API

c3rb3ru5 3 Jun 27, 2022
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 31 Jul 23, 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 64 Jul 9, 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
Utility and common library for all polysquare cmake tools.

Polysquare CMake Tooling Utility Functions Utility and common library for all polysquare cmake tools. Status Travis CI (Ubuntu) AppVeyor (Windows) Cov

ポリ平方 POLYSQUARE 3 May 7, 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 Jul 6, 2022
Apple Silicon to Apple Silicon VDM utility

Apple Silicon to Apple Silicon VDM tool This tool lets you get a serial console on an Apple Silicon device and reboot it remotely, using only another

Asahi Linux 125 Jul 14, 2022
Utility to convert any binary file into C source that can be compiled and linked to the executable.

bin2c Utility to convert any binary file into C source that can be compiled and linked to the executable. bin2o Utility to convert any binary file int

Vadim A. Anisimov 16 Jul 14, 2021
hashcat is the world's fastest and most advanced password recovery utility

hashcat is the world's fastest and most advanced password recovery utility, supporting five unique modes of attack for over 300 highly-optimized hashing algorithms. hashcat currently supports CPUs, GPUs, and other hardware accelerators on Linux, Windows, and macOS, and has facilities to help enable distributed password cracking.

null 15.1k Aug 4, 2022
A WFH utility to visually indicate user engagement of audio and video

DIY: In meeting indicator - WFH Utility The need for in meeting indicator at home So many of you have gotten accustomed to work from home by now. This

krishna kumar T 10 Jun 28, 2021
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 55 Jul 20, 2022
Rufus is a utility that helps format and create bootable USB flash drives.

Rufus is a utility that helps format and create bootable USB flash drives.

Pete Batard 19.4k Aug 6, 2022
AlleyWind is an advanced Win32-based and open-sourced utility that helps you to manage system's windows

AlleyWind AlleyWind is an advanced Win32-based and open-sourced utility that helps you to manage system's windows. AlleyWind could: Displays a graphic

KNSoft 19 Jul 28, 2022
Utility on top of the Flutter Driver API that facilitates measuring the performance of your app in an automated way created by Very Good Ventures 🦄

Very Good Performance Developed with ?? by Very Good Ventures ?? Utility on top of the Flutter Driver API that facilitates measuring the performance o

Very Good Open Source 75 Jul 24, 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 72 Aug 5, 2022