{"id":16842611,"url":"https://github.com/rofl0r/gnulib","last_synced_at":"2025-04-11T05:52:30.703Z","repository":{"id":1690034,"uuid":"2418098","full_name":"rofl0r/gnulib","owner":"rofl0r","description":"an attempt to beat the shit out of gnulib","archived":false,"fork":false,"pushed_at":"2011-09-19T22:03:11.000Z","size":28344,"stargazers_count":11,"open_issues_count":0,"forks_count":6,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-04-11T05:52:03.150Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rofl0r.png","metadata":{"files":{"readme":"README","changelog":"ChangeLog","contributing":null,"funding":null,"license":"COPYING","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2011-09-19T20:28:31.000Z","updated_at":"2025-02-02T06:28:07.000Z","dependencies_parsed_at":"2022-09-03T10:30:40.677Z","dependency_job_id":null,"html_url":"https://github.com/rofl0r/gnulib","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rofl0r%2Fgnulib","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rofl0r%2Fgnulib/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rofl0r%2Fgnulib/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rofl0r%2Fgnulib/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rofl0r","download_url":"https://codeload.github.com/rofl0r/gnulib/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248351409,"owners_count":21089271,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-13T12:47:14.589Z","updated_at":"2025-04-11T05:52:30.674Z","avatar_url":"https://github.com/rofl0r.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"Gnulib\n======\n\nWhile portability across operating systems is not one of GNU's primary\ngoals, it has helped introduce many people to the GNU system, and is\nworthwhile when it can be achieved at a low cost.  This collection helps\nlower that cost.\n\nGnulib is intended to be the canonical source for most of the important\n\"portability\" and/or common files for GNU projects.  These are files\nintended to be shared at the source level; Gnulib is not a typical\nlibrary meant to be installed and linked against.  Thus, unlike most\nprojects, Gnulib does not normally generate a source tarball\ndistribution; instead, developers grab modules directly from the\nsource repository.\n\nThe easiest, and recommended, way to do this is to use the gnulib-tool\nscript.  Since there is no installation procedure for Gnulib,\ngnulib-tool needs to be run directly in the directory that contains the\nGnulib source code.  You can do this either by specifying the absolute\nfilename of gnulib-tool, or by using a symbolic link from a\nplace inside your PATH to the gnulib-tool file of your preferred\nGnulib checkout.  For example:\n  $ ln -s $HOME/gnu/src/gnulib.git/gnulib-tool $HOME/bin/gnulib-tool\n\nThe home page for Gnulib is http://www.gnu.org/software/gnulib.\n\n\ngit and CVS\n===========\n\nGnulib is available for anonymous checkout.  In any Bourne-shell the\nfollowing should work:\n  $ git clone git://git.sv.gnu.org/gnulib.git\n\nFor a read-write checkout you need to have a login on savannah.gnu.org and be\na member of the gnulib project at http://savannah.gnu.org/projects/gnulib .\nThen, instead of the URL\n  git://git.sv.gnu.org/gnulib\nuse the URL\n  ssh://\u003cuser\u003e@git.sv.gnu.org/srv/git/gnulib\nwhere \u003cuser\u003e is your login name on savannah.gnu.org.\n\ngit resources:\n  Overview: http://en.wikipedia.org/wiki/Git_(software)\n  Homepage: http://git.or.cz/\n  Download: http://www.kernel.org/pub/software/scm/git/\n  Tutorial: http://git.or.cz/course/\n            http://www.kernel.org/pub/software/scm/git/docs/tutorial.html\n  FAQ:      http://git.or.cz/gitwiki/GitFaq\n\nWhen you use \"git annotate\" or \"git blame\" with gnulib, it's recommended that\nyou use the \"-w\" option, in order to ignore massive whitespace changes that\nhappened in 2009.\n\nCVS checkouts are also supported:\n  $ cvs -d :pserver:anonymous@pserver.git.sv.gnu.org:/gnulib.git co -d gnulib HEAD\n\nGnulib is hosted on savannah.gnu.org.  The project page is\nhttp://savannah.gnu.org/projects/gnulib.\n\n\nKeeping Up-to-date\n==================\n\nThe best way to work with Gnulib is to check it out of git.\nSubscribing to the bug-gnulib@gnu.org mailing list will help you to\nplan when to update your local copy of Gnulib (which you use to\nmaintain your software) from git.  To synchronize, you can use \"git pull\",\nor \"cvs update -dP\" if you are still using CVS.\n\nSometimes, using an updated version of Gnulib will require you to use\nnewer versions of GNU Automake or Autoconf.  You may find it helpful\nto join the autotools-announce mailing list to be advised of such\nchanges.\n\n\nContributing to Gnulib\n======================\n\nAll software here is copyrighted by the Free Software Foundation - you need\nto have filled out an assignment form for a project that uses the\nmodule for that contribution to be accepted here.\n\nIf you have a piece of code that you would like to contribute, please\nemail bug-gnulib@gnu.org.  You can review the archives, subscribe, etc.,\nvia http://lists.gnu.org/mailman/listinfo/bug-gnulib.\n\nGenerally we are looking for files that fulfill at least one of the\nfollowing requirements:\n\n    * If your .c and .h files define functions that are broken or\nmissing on some other system, we should be able to include it.\n\n    * If your functions remove arbitrary limits from existing\nfunctions (either under the same name, or as a slightly different\nname), we should be able to include it.\n\nIf your functions define completely new but rarely used functionality,\nyou should probably consider packaging it as a separate library.\n\n\nLicense\n-------\nGnulib contains code both under GPL and LGPL.  Because several packages\nthat use Gnulib are GPL, the files state they are licensed under GPL.\nHowever, to support LGPL projects as well, you may use some of the\nfiles under LGPL.  The \"License:\" information in the files under\nmodules/ clarifies the real license that applies to the module source.\n\nKeep in mind that if you submit patches to files in Gnulib, you should\nlicense them under a compatible license, which means that sometimes\nthe contribution will have to be LGPL, if the original file is\navailable under LGPL via a \"License: LGPL\" information in the\nprojects' modules/ file.\n\n\nIndent with spaces, not TABs\n----------------------------\nWe use space-only indentation in nearly all files. This includes all\n*.h, *.c, *.y files, except for the regex module. Makefile and ChangeLog\nfiles are excluded, since TAB characters are part of their format.\n\nIn order to tell your editor to produce space-only indentation, you\ncan use these instructions.\n\n  * For Emacs: Add these lines to your Emacs initialization file\n    ($HOME/.emacs or similar):\n\n      ;; In gnulib, indent with spaces everywhere (not TABs).\n      ;; Exceptions: Makefile and ChangeLog modes.\n      (add-hook 'find-file-hook '(lambda ()\n        (if (and buffer-file-name\n                 (string-match \"/gnulib\\\\\u003e\" (buffer-file-name))\n                 (not (string-equal mode-name \"Change Log\"))\n                 (not (string-equal mode-name \"Makefile\")))\n            (setq indent-tabs-mode nil))))\n\n  * For vi (vim): Add these lines to your $HOME/.vimrc file:\n\n      \" Don't use tabs for indentation. Spaces are nicer to work with.\n      set expandtab\n\n    For Makefile and ChangeLog files, compensate this by adding this to\n    your $HOME/.vim/after/indent/make.vim and\n    $HOME/.vim/after/indent/changelog.vim files:\n\n      \" Use tabs for indentation, regardless of the global setting.\n      set noexpandtab\n\n  * For Eclipse: In the \"Window|Preferences\" dialog (or \"Eclipse|Preferences\"\n    dialog on MacOS),\n    1. Under \"General|Editors|Text Editors\", select the \"Insert spaces for tabs\"\n       checkbox.\n    2. Under \"C/C++|Code Style\", select a code style profile that has the\n       \"Indentation|Tab policy\" combobox set to \"Spaces only\", such as the\n       \"GNU [built-in]\" policy.\n\nIf you use the GNU indent program, pass it the option '--no-tabs'.\n\n\nHow to add a new module\n-----------------------\n* Add the header files and source files to lib/.\n* If the module needs configure-time checks, write an autoconf\n  macro for it in m4/\u003cmodule\u003e.m4. See m4/README for details.\n* Write a module description modules/\u003cmodule\u003e, based on modules/TEMPLATE.\n* If the module contributes a section to the end-user documentation,\n  put this documentation in doc/\u003cmodule\u003e.texi and add it to the \"Files\"\n  section of modules/\u003cmodule\u003e.  Most modules don't do this; they have only\n  documentation for the programmer (= gnulib user).  Such documentation\n  usually goes into the lib/ source files.  It may also go into doc/;\n  but don't add it to the module description in this case.\n* Add the module to the list in MODULES.html.sh.\n\nYou can test that a module builds correctly with:\n  $ ./gnulib-tool --create-testdir --dir=/tmp/testdir module1 ... moduleN\n  $ cd /tmp/testdir\n  $ ./configure \u0026\u0026 make\n\nOther things:\n* Check the license and copyright year of headers.\n* Check that the source code follows the GNU coding standards;\n  see \u003chttp://www.gnu.org/prep/standards\u003e.\n* Add source files to config/srclist* if they are identical to upstream\n  and should be upgraded in gnulib whenever the upstream source changes.\n* Include header files in source files to verify the function prototypes.\n* Make sure a replacement function doesn't cause warnings or clashes on\n  systems that have the function.\n* Autoconf functions can use gl_* prefix. The AC_* prefix is for\n  autoconf internal functions.\n* Build files only if they are needed on a platform.  Look at the\n  alloca and fnmatch modules for how to achieve this.  If for some\n  reason you cannot do this, and you have a .c file that leads to an\n  empty .o file on some platforms (through some big #if around all the\n  code), then ensure that the compilation unit is not empty after\n  preprocessing.  One way to do this is to #include \u003cstddef.h\u003e or\n  \u003cstdio.h\u003e before the big #if.\n\n\nPortability guidelines\n----------------------\n\nGnulib code is intended to be portable to a wide variety of platforms,\nnot just GNU platforms.  See the documentation section \"Target Platforms\"\nfor details.\n\nMany Gnulib modules exist so that applications need not worry about\nundesirable variability in implementations.  For example, an\napplication that uses the 'malloc' module need not worry about (malloc\n(0)) returning NULL on some Standard C platforms; and 'time_r' users\nneed not worry about localtime_r returning int (not char *) on some\nplatforms that predate POSIX 1003.1-2001.\n\nCurrently we assume at least a freestanding C89 compiler, possibly\noperating with a C library that predates C89.  The oldest environments\ncurrently ported to are probably HP-UX 10.20 and IRIX 5.3, though we\nare not testing these platforms very often.\n\nBecause we assume a freestanding C89 compiler, Gnulib code can include\n\u003cfloat.h\u003e, \u003climits.h\u003e, \u003cstdarg.h\u003e, and \u003cstddef.h\u003e unconditionally.  It\ncan also assume the existence of \u003cctime.h\u003e, \u003cerrno.h\u003e, \u003cfcntl.h\u003e,\n\u003clocale.h\u003e, \u003csignal.h\u003e, \u003cstdio.h\u003e, \u003cstdlib.h\u003e, \u003cstring.h\u003e, and \u003ctime.h\u003e.\nSimilarly, many modules include \u003csys/types.h\u003e even though it's not even\nin C99; that's OK since \u003csys/types.h\u003e has been around nearly forever.\n\nEven if the include files exist, they may not conform to C89.\nHowever, GCC has a \"fixincludes\" script that attempts to fix most\nC89-conformance problems.  So Gnulib currently assumes include files\nlargely conform to C89 or better.  People still using ancient hosts\nshould use fixincludes or fix their include files manually.\n\nEven if the include files conform to C89, the library itself may not.\nFor example, strtod and mktime have some bugs on some platforms.\nYou can work around some of these problems by requiring the relevant\nmodules, e.g., the Gnulib 'mktime' module supplies a working and\nconforming 'mktime'.\n\nThe GNU coding standards allow one departure from strict C99: Gnulib\ncode can assume that standard internal types like size_t are no wider\nthan 'long'.  POSIX 1003.1-2001 and the GNU coding standards both\nrequire 'int' to be at least 32 bits wide, so Gnulib code assumes this\nas well.  Gnulib code makes the following additional assumptions:\n\n * Signed integer arithmetic is two's complement.\n\n   Previously, gnulib code sometimes assumed that signed integer\n   arithmetic wraps around, but modern compiler optimizations\n   sometimes do not guarantee this, and gnulib code with this\n   assumption is now considered to be questionable.  For more, please\n   see the file doc/intprops.texi.\n\n   Some gnulib modules contain explicit support for the other signed\n   integer representations allowed by C99 (ones' complement and signed\n   magnitude), but these modules are the exception rather than the rule.\n   All practical gnulib targets use two's complement.\n\n * There are no \"holes\" in integer values: all the bits of an integer\n   contribute to its value in the usual way.\n\n * If two nonoverlapping objects have sizes S and T represented as\n   size_t values, then S + T cannot overflow.  This assumption is true\n   for all practical hosts with flat address spaces, but it is not\n   always true for hosts with segmented address spaces.\n\n * If an existing object has size S, and if T is sufficiently small\n   (e.g., 8 KiB), then S + T cannot overflow.  Overflow in this case\n   would mean that the rest of your program fits into T bytes, which\n   can't happen in realistic flat-address-space hosts.\n\n * Objects with all bits zero are treated as 0 or NULL.  For example,\n   memset (A, 0, sizeof A) initializes an array A of pointers to NULL.\n\n * Adding zero to a null pointer does not change the pointer.\n   For example, 0 + (char *) NULL == (char *) NULL.\n\nThe above assumptions are not required by the C or POSIX standards but\nhold on all practical porting targets that we're familiar with.  If\nyou have a porting target where these assumptions are not true, we'd\nappreciate hearing of any fixes.  We need fixes that do not increase\nruntime overhead on standard hosts and that are relatively easy to\nmaintain.\n\nWith the above caveats, Gnulib code should port without problem to new\nhosts, e.g., hosts conforming to C99 or to recent POSIX standards.\nHence Gnulib code should avoid using constructs (e.g., undeclared\nfunctions return 'int') that do not conform to C99.\n\n\nHigh Quality\n============\n\nWe develop and maintain a testsuite for Gnulib.  The goal is to have a\n100% firm interface so that maintainers can feel free to update to the\ncode in git at *any* time and know that their application will not\nbreak.  This means that before any change can be committed to the\nrepository, a test suite program must be produced that exposes the bug\nfor regression testing.  All experimental work should be done on\nbranches to help promote this.\n\n\n-----\nCopyright 2001, 2003-2011 Free Software Foundation, Inc.\n\nThis program is free software: you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation; either version 3 of the License, or\n(at your option) any later version.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\nGNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License\nalong with this program.  If not, see \u003chttp://www.gnu.org/licenses/\u003e.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frofl0r%2Fgnulib","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frofl0r%2Fgnulib","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frofl0r%2Fgnulib/lists"}