Git Product home page Git Product logo

libuseful's Introduction

Build Status

libUseful - a 'C' library of useful functions.

libUseful provides a range of functions that simplify common programming tasks in 'C', particularly networking and communications. It hides the complexities of sockets, openssl, zlib, pseudoterminals, http, etc and provides commonly needed functionality like resizeable strings, linked lists and maps.

libUseful has been compiled and used on various linux and freebsd systems.

Install

should be as simple as:

./configure --prefix=/usr/local --enable-ssl --enable-ip6 make make install

.h files will be copied to /include/libUseful-4

On linux a few linux-specific functions can be activated via configure:

--enable-sendfile enable kernel-level 'fastcopy' within the STREAMSendFile function

On intel systems some MMX/SSE/SSE2 features can be turned on by

--enable-simd= where level is one of 'mmx', 'sse' or 'sse2'

the major use of --enable-simd is SSE2 cache hinting in the list/map system, which can prevent large lists from poisoning the cache and so improve program performance.

Compiler Flags

If libUseful is compiled with openssl support then you need to pass the following library flags to gcc when you compile your programs

gcc -o myProg myProg.c -lUseful -lssl -lcrypto -lz

If openssl is not used (libUseful compiled with --disable-ssl), but zlib is used then the flags are

gcc -o myProg myProg.c -lUseful -lssl -lcrypto -lz

If neither zlib or openssl functionality is used in libUseful, then the flags are just

gcc -o myProg myProg.c -lUseful

IPv6 support

Please note that, due to the author's lack of access to IPv6 networks the IPv6 functionality has not been extensively tested, though it has been seen to work.

Documentation

Please read Quickstart.md for an overview of core paradigms of using libUseful. Individual functions are documented in the .h header files.

Author

libUseful is (C) 2009 Colum Paget. It is released under the GPLv3 so you may do anything with them that the GPL allows.

Email: [email protected]

DISCLAIMER

This is free software. It comes with no guarentees and I take no responsiblity if it makes your computer explode or opens a portal to the demon dimensions, or does anything.

libuseful's People

Contributors

columpaget avatar mistydemeo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

libuseful's Issues

failed build under musl libc missing LOCK_EX definition

the following patch solved the issue

--- includes.h.orig     2022-12-14 13:07:39.000000000 +0100
+++ includes.h  2023-02-17 03:53:46.766396350 +0100
@@ -18,6 +18,7 @@
 #include <stdio.h>
 #include <stdarg.h>
 #include <sys/stat.h>
+#include <sys/file.h>
 #include <signal.h>
 #include <netinet/in.h>
 #include <netdb.h>

libUseful mistakes Mac getxattr for Linux getxattr

Both macOS and Linux provide non-POSIX functions named getxattr/setxattr, but they're not compatible with each other. At a glance, they seem to be mostly similar, but the Mac one takes extra position and options parameters: https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man2/getxattr.2.html

libUseful's configure script just checks for whether the function exists and assumes it's usable. That causes compilation to fail on Macs unless --disable-xattr is explicitly passed. Since it looks like it's specifically looking for the Linux function by this name, it's probably a good idea to make using it dependent on the OS too.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.