Compare commits
6 Commits
6e9217e5d0
...
bb30c7d86e
| Author | SHA1 | Date | |
|---|---|---|---|
|
bb30c7d86e
|
|||
|
47ef2ae5bd
|
|||
|
69800a6afb
|
|||
|
fe1035633a
|
|||
|
da75b6f735
|
|||
|
199c56e141
|
24
.travis.yml
24
.travis.yml
@@ -1,24 +0,0 @@
|
|||||||
language: c
|
|
||||||
notifications:
|
|
||||||
irc:
|
|
||||||
channels: "irc.janouch.name#dev"
|
|
||||||
use_notice: true
|
|
||||||
skip_join: true
|
|
||||||
template:
|
|
||||||
- "%{repository_name}#%{build_number} on %{branch}: %{message}"
|
|
||||||
- " %{compare_url}"
|
|
||||||
- " %{build_url}"
|
|
||||||
on_success: change
|
|
||||||
on_failure: always
|
|
||||||
compiler:
|
|
||||||
- clang
|
|
||||||
- gcc
|
|
||||||
before_install:
|
|
||||||
- sudo apt-get update -qq
|
|
||||||
before_script:
|
|
||||||
- mkdir build
|
|
||||||
- cd build
|
|
||||||
script:
|
|
||||||
- cmake .. -DCMAKE_INSTALL_PREFIX=/usr
|
|
||||||
- make
|
|
||||||
- ctest -V
|
|
||||||
@@ -2,11 +2,11 @@ project (liberty C)
|
|||||||
cmake_minimum_required (VERSION 2.8.5)
|
cmake_minimum_required (VERSION 2.8.5)
|
||||||
|
|
||||||
# Moar warnings
|
# Moar warnings
|
||||||
if ("${CMAKE_C_COMPILER_ID}" MATCHES "GNU" OR CMAKE_COMPILER_IS_GNUC)
|
if ("${CMAKE_C_COMPILER_ID}" MATCHES "GNU" OR CMAKE_COMPILER_IS_GNUCC)
|
||||||
# -Wunused-function is pretty annoying here, as everything is static
|
# -Wunused-function is pretty annoying here, as everything is static
|
||||||
set (wdisabled "-Wno-unused-function -Wno-implicit-fallthrough")
|
set (wdisabled "-Wno-unused-function -Wno-implicit-fallthrough")
|
||||||
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99 -Wall -Wextra ${wdisabled}")
|
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99 -Wall -Wextra ${wdisabled}")
|
||||||
endif ("${CMAKE_C_COMPILER_ID}" MATCHES "GNU" OR CMAKE_COMPILER_IS_GNUC)
|
endif ("${CMAKE_C_COMPILER_ID}" MATCHES "GNU" OR CMAKE_COMPILER_IS_GNUCC)
|
||||||
|
|
||||||
# Dependencies
|
# Dependencies
|
||||||
set (CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
|
set (CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
|
||||||
|
|||||||
5
LICENSE
5
LICENSE
@@ -1,8 +1,7 @@
|
|||||||
Copyright (c) 2014 - 2017, Přemysl Janouch <p.janouch@gmail.com>
|
Copyright (c) 2014 - 2018, Přemysl Janouch <p@janouch.name>
|
||||||
|
|
||||||
Permission to use, copy, modify, and/or distribute this software for any
|
Permission to use, copy, modify, and/or distribute this software for any
|
||||||
purpose with or without fee is hereby granted, provided that the above
|
purpose with or without fee is hereby granted.
|
||||||
copyright notice and this permission notice appear in all copies.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||||
|
|||||||
17
README.adoc
17
README.adoc
@@ -19,18 +19,13 @@ I'm not testing them at all, with the exception of OpenBSD.
|
|||||||
|
|
||||||
Contributing and Support
|
Contributing and Support
|
||||||
------------------------
|
------------------------
|
||||||
Use this project's GitHub to report any bugs, request features, or submit pull
|
Use https://git.janouch.name/p/liberty to report any bugs, request features,
|
||||||
requests. If you want to discuss this project, or maybe just hang out with
|
or submit pull requests. `git send-email` is tolerated. If you want to discuss
|
||||||
the developer, feel free to join me at irc://irc.janouch.name, channel #dev.
|
the project, feel free to join me at ircs://irc.janouch.name, channel #dev.
|
||||||
|
|
||||||
Bitcoin donations: 12r5uEWEgcHC46xd64tt3hHt9EUvYYDHe9
|
Bitcoin donations are accepted at: 12r5uEWEgcHC46xd64tt3hHt9EUvYYDHe9
|
||||||
|
|
||||||
License
|
License
|
||||||
-------
|
-------
|
||||||
'liberty' is written by Přemysl Janouch <p.janouch@gmail.com>.
|
This software is released under the terms of the 0BSD license, the text of which
|
||||||
|
is included within the package along with the list of authors.
|
||||||
You may use the software under the terms of the ISC license, the text of which
|
|
||||||
is included within the package, or, at your option, you may relicense the work
|
|
||||||
under the MIT or the Modified BSD License, as listed at the following site:
|
|
||||||
|
|
||||||
http://www.gnu.org/licenses/license-list.html
|
|
||||||
|
|||||||
@@ -1,11 +1,10 @@
|
|||||||
/*
|
/*
|
||||||
* liberty-proto.c: the ultimate C unlibrary: protocols
|
* liberty-proto.c: the ultimate C unlibrary: protocols
|
||||||
*
|
*
|
||||||
* Copyright (c) 2014 - 2016, Přemysl Janouch <p.janouch@gmail.com>
|
* Copyright (c) 2014 - 2016, Přemysl Janouch <p@janouch.name>
|
||||||
*
|
*
|
||||||
* Permission to use, copy, modify, and/or distribute this software for any
|
* Permission to use, copy, modify, and/or distribute this software for any
|
||||||
* purpose with or without fee is hereby granted, provided that the above
|
* purpose with or without fee is hereby granted.
|
||||||
* copyright notice and this permission notice appear in all copies.
|
|
||||||
*
|
*
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||||
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||||
|
|||||||
@@ -1,11 +1,10 @@
|
|||||||
/*
|
/*
|
||||||
* liberty-tui.c: the ultimate C unlibrary: TUI
|
* liberty-tui.c: the ultimate C unlibrary: TUI
|
||||||
*
|
*
|
||||||
* Copyright (c) 2016 - 2017, Přemysl Janouch <p.janouch@gmail.com>
|
* Copyright (c) 2016 - 2017, Přemysl Janouch <p@janouch.name>
|
||||||
*
|
*
|
||||||
* Permission to use, copy, modify, and/or distribute this software for any
|
* Permission to use, copy, modify, and/or distribute this software for any
|
||||||
* purpose with or without fee is hereby granted, provided that the above
|
* purpose with or without fee is hereby granted.
|
||||||
* copyright notice and this permission notice appear in all copies.
|
|
||||||
*
|
*
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||||
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||||
|
|||||||
31
liberty.c
31
liberty.c
@@ -1,11 +1,10 @@
|
|||||||
/*
|
/*
|
||||||
* liberty.c: the ultimate C unlibrary
|
* liberty.c: the ultimate C unlibrary
|
||||||
*
|
*
|
||||||
* Copyright (c) 2014 - 2016, Přemysl Janouch <p.janouch@gmail.com>
|
* Copyright (c) 2014 - 2018, Přemysl Janouch <p@janouch.name>
|
||||||
*
|
*
|
||||||
* Permission to use, copy, modify, and/or distribute this software for any
|
* Permission to use, copy, modify, and/or distribute this software for any
|
||||||
* purpose with or without fee is hereby granted, provided that the above
|
* purpose with or without fee is hereby granted.
|
||||||
* copyright notice and this permission notice appear in all copies.
|
|
||||||
*
|
*
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||||
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||||
@@ -4337,6 +4336,32 @@ socket_io_try_write (int socket_fd, struct str *wb)
|
|||||||
// This is a more powerful configuration format, adding key-value maps and
|
// This is a more powerful configuration format, adding key-value maps and
|
||||||
// simplifying item validation and dynamic handling of changes. All strings
|
// simplifying item validation and dynamic handling of changes. All strings
|
||||||
// must be encoded in UTF-8.
|
// must be encoded in UTF-8.
|
||||||
|
//
|
||||||
|
// The syntax is roughly described by the following parsing expression grammar:
|
||||||
|
//
|
||||||
|
// config = entries eof # as if there were implicit curly braces around
|
||||||
|
// entries = (newline* pair)* newline*
|
||||||
|
// pair = key newline* lws '=' newline* value (&endobj / newline / eof)
|
||||||
|
// key = string / !null !boolean lws [A-Za-z_][0-9A-Za-z_]*
|
||||||
|
// value = object / string / integer / null / boolean
|
||||||
|
//
|
||||||
|
// object = lws '{' entries endobj
|
||||||
|
// endobj = lws '}'
|
||||||
|
//
|
||||||
|
// string = lws '"' ('\\' escape / ![\\"] char)* '"'
|
||||||
|
// char = [\0-\177] # or any Unicode codepoint in the UTF-8 encoding
|
||||||
|
// escape = [\\"abfnrtv] / [xX][0-9A-Fa-f][0-9A-Fa-f]? / [0-7][0-7]?[0-7]?
|
||||||
|
//
|
||||||
|
// integer = lws '-'? [0-9]+ # whatever strtoll() accepts on your system
|
||||||
|
// null = lws 'null'
|
||||||
|
// boolean = lws 'yes' / lws 'YES' / lws 'no' / lws 'NO'
|
||||||
|
// / lws 'on' / lws 'ON' / lws 'off' / lws 'OFF'
|
||||||
|
// / lws 'true' / lws 'TRUE' / lws 'false' / lws 'FALSE'
|
||||||
|
//
|
||||||
|
// newline = lws comment? '\n'
|
||||||
|
// eof = lws comment? !.
|
||||||
|
// lws = [ \t\r]* # linear whitespace (plus CR as it is insignificant)
|
||||||
|
// comment = '#' (!'\n' .)*
|
||||||
|
|
||||||
enum config_item_type
|
enum config_item_type
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ fakeroot sh -e <<-EOF
|
|||||||
url = $url
|
url = $url
|
||||||
builddate = \`date -u +%s\`
|
builddate = \`date -u +%s\`
|
||||||
packager = $author
|
packager = $author
|
||||||
size = \`du -sb --apparent-size | cut -f1\`
|
size = \`du -sb | cut -f1\`
|
||||||
arch = $arch
|
arch = $arch
|
||||||
END
|
END
|
||||||
cd "$wd" && tar cJf "../$target" .PKGINFO *
|
cd "$wd" && tar cJf "../$target" .PKGINFO *
|
||||||
|
|||||||
14
siphash.c
14
siphash.c
@@ -61,13 +61,13 @@ siphash (const unsigned char key[16], const unsigned char *m, size_t len)
|
|||||||
|
|
||||||
switch (len - blocks)
|
switch (len - blocks)
|
||||||
{
|
{
|
||||||
case 7: last7 |= (uint64_t) m[i + 6] << 48;
|
case 7: last7 |= (uint64_t) m[i + 6] << 48; // Fall-through
|
||||||
case 6: last7 |= (uint64_t) m[i + 5] << 40;
|
case 6: last7 |= (uint64_t) m[i + 5] << 40; // Fall-through
|
||||||
case 5: last7 |= (uint64_t) m[i + 4] << 32;
|
case 5: last7 |= (uint64_t) m[i + 4] << 32; // Fall-through
|
||||||
case 4: last7 |= (uint64_t) m[i + 3] << 24;
|
case 4: last7 |= (uint64_t) m[i + 3] << 24; // Fall-through
|
||||||
case 3: last7 |= (uint64_t) m[i + 2] << 16;
|
case 3: last7 |= (uint64_t) m[i + 2] << 16; // Fall-through
|
||||||
case 2: last7 |= (uint64_t) m[i + 1] << 8;
|
case 2: last7 |= (uint64_t) m[i + 1] << 8; // Fall-through
|
||||||
case 1: last7 |= (uint64_t) m[i + 0] ;
|
case 1: last7 |= (uint64_t) m[i + 0] ; // Fall-through
|
||||||
default:;
|
default:;
|
||||||
};
|
};
|
||||||
v3 ^= last7;
|
v3 ^= last7;
|
||||||
|
|||||||
@@ -1,11 +1,10 @@
|
|||||||
/*
|
/*
|
||||||
* tests/liberty.c
|
* tests/liberty.c
|
||||||
*
|
*
|
||||||
* Copyright (c) 2015 - 2016, Přemysl Janouch <p.janouch@gmail.com>
|
* Copyright (c) 2015 - 2016, Přemysl Janouch <p@janouch.name>
|
||||||
*
|
*
|
||||||
* Permission to use, copy, modify, and/or distribute this software for any
|
* Permission to use, copy, modify, and/or distribute this software for any
|
||||||
* purpose with or without fee is hereby granted, provided that the above
|
* purpose with or without fee is hereby granted.
|
||||||
* copyright notice and this permission notice appear in all copies.
|
|
||||||
*
|
*
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||||
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||||
|
|||||||
@@ -1,11 +1,10 @@
|
|||||||
/*
|
/*
|
||||||
* tests/proto.c
|
* tests/proto.c
|
||||||
*
|
*
|
||||||
* Copyright (c) 2015, Přemysl Janouch <p.janouch@gmail.com>
|
* Copyright (c) 2015, Přemysl Janouch <p@janouch.name>
|
||||||
*
|
*
|
||||||
* Permission to use, copy, modify, and/or distribute this software for any
|
* Permission to use, copy, modify, and/or distribute this software for any
|
||||||
* purpose with or without fee is hereby granted, provided that the above
|
* purpose with or without fee is hereby granted.
|
||||||
* copyright notice and this permission notice appear in all copies.
|
|
||||||
*
|
*
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||||
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||||
|
|||||||
Reference in New Issue
Block a user