changeset 0:d450dddcd926

misc: initial import
author David Demelier <markand@malikania.fr>
date Mon, 07 Jun 2021 21:32:05 +0200
parents
children 30a1f29b3316
files .hgignore Makefile css/no-class.css index.md
diffstat 4 files changed, 685 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/.hgignore	Mon Jun 07 21:32:05 2021 +0200
@@ -0,0 +1,3 @@
+^libbase64-(\d+)\.(\d+)\.(\d+)
+^www$
+\.html$
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Makefile	Mon Jun 07 21:32:05 2021 +0200
@@ -0,0 +1,74 @@
+#
+# Makefile -- basic Makefile for libbase64
+#
+# Copyright (c) 2013-2021 David Demelier <markand@malikania.fr>
+#
+# Permission to use, copy, modify, and/or distribute this software for any
+# purpose with or without fee is hereby granted, provided that the above
+# copyright notice and this permission notice appear in all copies.
+#
+# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+#
+
+.POSIX:
+
+SRCS=           index.md
+PROJECT=        libbase64
+VERSION=        2.0.0
+MAN3=           libbase64-${VERSION}/libbase64.3
+
+OBJS=           ${SRCS:.md=.html}
+PANDOC=         pandoc
+PANDOC_FLAGS=   -f markdown -t html5 --no-highlight --template templates/template.html
+MANDOC=         mandoc
+MANDOC_HTML=    -T html -O man=%N.html
+MANDOC_PDF=     -T pdf
+DIST=           ${PROJECT}-${VERSION}.tar.xz
+WRKDIR=         ${PROJECT}-${VERSION}
+
+MAN3_HTML=      ${MAN3:.3=.html}
+MAN3_PDF=       ${MAN3:.3=.pdf}
+
+MAN_OBJS=       ${MAN3_HTML} ${MAN3_PDF}
+
+.SUFFIXES:
+.SUFFIXES: .3 .html .md .pdf
+
+all: www
+
+.md.html:
+	${PANDOC} ${PANDOC_FLAGS} -o $@ $<
+
+.3.html:
+	${MANDOC} < $< ${MANDOC_HTML} > $@
+
+.3.pdf:
+	${MANDOC} < $< ${MANDOC_PDF} > $@
+
+${DIST}:
+	wget -q http://releases.malikania.fr/${PROJECT}/${VERSION}/$@ -O $@
+
+${WRKDIR}: ${DIST}
+	tar -xJf $<
+
+${MAN3}: ${WRKDIR}
+
+${OBJS}: css/no-class.css templates/template.html
+
+www: ${OBJS} ${MAN_OBJS}
+	mkdir -p www
+	cp -R css www
+	cp ${OBJS} ${MAN_OBJS} www
+
+clean:
+	rm -rf www ${WRKDIR}
+	rm -f ${SOURCE}
+	rm -f ${OBJS} ${MAN_OBJS}
+
+.PHONY: all clean
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/css/no-class.css	Mon Jun 07 21:32:05 2021 +0200
@@ -0,0 +1,546 @@
+/*! sanitize.css v5.0.0 | CC0 License | github.com/jonathantneal/sanitize.css */
+*,
+::after,
+::before {
+  background-repeat: no-repeat;
+  box-sizing: inherit
+}
+::after,
+::before {
+  text-decoration: inherit;
+  vertical-align: inherit
+}
+html {
+  box-sizing: border-box;
+  cursor: default;
+  -ms-text-size-adjust: 100%;
+  -webkit-text-size-adjust: 100%
+}
+article,
+aside,
+footer,
+header,
+nav,
+section {
+  display: block
+}
+body {
+  max-width: 960px;
+  margin: 0 auto;
+}
+h1 {
+  font-size: 2em;
+  margin: .67em 0
+}
+figcaption,
+figure,
+main {
+  display: block
+}
+figure {
+  margin: 1em 40px
+}
+hr {
+  box-sizing: content-box;
+  height: 0;
+  overflow: visible
+}
+nav ol,
+nav ul {
+  list-style: none
+}
+pre {
+  font-family: monospace,monospace;
+  font-size: 1em
+}
+a {
+  background-color: transparent;
+  -webkit-text-decoration-skip: objects
+}
+abbr[title] {
+  border-bottom: none;
+  text-decoration: underline;
+  text-decoration: underline dotted
+}
+b,
+strong {
+  font-weight: inherit
+}
+b,
+strong {
+  font-weight: bold
+}
+code,
+kbd,
+samp {
+  font-family: monospace,monospace;
+  font-size: 1em
+}
+dfn {
+  font-style: italic
+}
+mark {
+  background-color: #ff0;
+  color: #000
+}
+small {
+  font-size: 80%
+}
+sub,
+sup {
+  font-size: 75%;
+  line-height: 0;
+  position: relative;
+  vertical-align: baseline
+}
+sub {
+  bottom: -.25em
+}
+sup {
+  top: -.5em
+}
+::-moz-selection {
+  background-color: #b3d4fc;
+  color: #000;
+  text-shadow: none
+}
+::selection {
+  background-color: #b3d4fc;
+  color: #000;
+  text-shadow: none
+}
+audio,
+canvas,
+iframe,
+img,
+svg,
+video {
+  vertical-align: middle
+}
+audio,
+video {
+  display: inline-block
+}
+audio:not([controls]) {
+  display: none;
+  height: 0
+}
+img {
+  border-style: none
+}
+svg {
+  fill: currentColor
+}
+svg:not(:root) {
+  overflow: hidden
+}
+table {
+  border-collapse: collapse
+}
+button,
+input,
+optgroup,
+select,
+textarea {
+  margin: 0
+}
+button,
+input,
+select,
+textarea {
+  background-color: transparent;
+  color: inherit;
+  font-size: inherit;
+  line-height: inherit
+}
+button,
+input {
+  overflow: visible
+}
+button,
+select {
+  text-transform: none
+}
+[type=reset],
+[type=submit],
+button,
+html [type=button] {
+  -webkit-appearance: button
+}
+[type=button]::-moz-focus-inner,
+[type=reset]::-moz-focus-inner,
+[type=submit]::-moz-focus-inner,
+button::-moz-focus-inner {
+  border-style: none;
+  padding: 0
+}
+[type=button]:-moz-focusring,
+[type=reset]:-moz-focusring,
+[type=submit]:-moz-focusring,
+button:-moz-focusring {
+  outline: 1px dotted ButtonText
+}
+legend {
+  box-sizing: border-box;
+  color: inherit;
+  display: table;
+  max-width: 100%;
+  padding: 0;
+  white-space: normal
+}
+progress {
+  display: inline-block;
+  vertical-align: baseline
+}
+textarea {
+  overflow: auto;
+  resize: vertical
+}
+[type=checkbox],
+[type=radio] {
+  box-sizing: border-box;
+  padding: 0
+}
+[type=number]::-webkit-inner-spin-button,
+[type=number]::-webkit-outer-spin-button {
+  height: auto
+}
+[type=search] {
+  -webkit-appearance: textfield;
+  outline-offset: -2px
+}
+[type=search]::-webkit-search-cancel-button,
+[type=search]::-webkit-search-decoration {
+  -webkit-appearance: none
+}
+::-webkit-file-upload-button {
+  -webkit-appearance: button;
+  font: inherit
+}
+details,
+menu {
+  display: block
+}
+summary {
+  display: list-item
+}
+canvas {
+  display: inline-block
+}
+template {
+  display: none
+}
+[tabindex],
+a,
+area,
+button,
+input,
+label,
+select,
+summary,
+textarea {
+  -ms-touch-action: manipulation;
+  touch-action: manipulation
+}
+[hidden] {
+  display: none
+}
+[aria-busy=true] {
+  cursor: progress
+}
+[aria-controls] {
+  cursor: pointer
+}
+[aria-hidden=false][hidden]:not(:focus) {
+  clip: rect(0,0,0,0);
+  display: inherit;
+  position: absolute
+}
+[aria-disabled] {
+  cursor: default
+}
+/*! no-class.css v1.0.0 | MIT License | https://github.com/davidpaulsson/no-class */
+html {
+  font-size: 62.5%;
+  -webkit-font-kerning: normal;
+  font-kerning: normal;
+  font-synthesis: none;
+  text-rendering: optimizeLegibility
+}
+body {
+  font-family: HelveticaNeue-Light,"Helvetica Neue Light","Helvetica Neue",Helvetica,Arial,"Lucida Grande",sans-serif;
+  font-weight: 300;
+  line-height: 1.6;
+  font-size: 16px;
+  font-size: 1.6rem
+}
+h1 {
+  font-weight: 300;
+  line-height: 1;
+  margin-top: 1em;
+  margin-bottom: 1em;
+  font-size: 36px;
+  font-size: 3.6rem
+}
+h2 {
+  font-weight: 300;
+  line-height: 1;
+  margin-top: 1em;
+  margin-bottom: 1em;
+  font-size: 30px;
+  font-size: 3rem
+}
+h3 {
+  font-weight: 300;
+  line-height: 1;
+  margin-top: 1em;
+  margin-bottom: 1em;
+  font-size: 24px;
+  font-size: 2.4rem
+}
+h4 {
+  font-weight: 300;
+  line-height: 1;
+  margin-top: 1em;
+  margin-bottom: 1em;
+  font-size: 20px;
+  font-size: 2rem
+}
+h5 {
+  font-weight: 300;
+  line-height: 1;
+  margin-top: 1em;
+  margin-bottom: 1em;
+  font-size: 16px;
+  font-size: 1.6rem
+}
+h6 {
+  font-weight: 300;
+  line-height: 1;
+  margin-top: 1em;
+  margin-bottom: 1em;
+  font-size: 14px;
+  font-size: 1.4rem
+}
+p {
+  margin-bottom: 1em
+}
+code {
+  font-family: Consolas,Monaco,'Andale Mono',monospace;
+  font-size: 80%;
+  vertical-align: baseline
+}
+pre {
+  overflow: auto;
+  margin: .5em 0;
+  padding: 0 1em!important;
+  background: #f5f2f0
+}
+sub,
+sup {
+  font-size: 75%;
+  line-height: 0;
+  position: relative;
+  vertical-align: baseline
+}
+sup {
+  top: -.5em
+}
+sub {
+  bottom: -.25em
+}
+cite {
+  font-style: italic
+}
+abbr,
+acronym {
+  cursor: help;
+  border-bottom: .1em dotted
+}
+blockquote,
+q {
+  margin-bottom: 1em;
+  padding-left: 1em;
+  quotes: none;
+  border-left: 3px solid rgba(0,0,0,.1)
+}
+ol,
+ul {
+  margin-bottom: 1em;
+  padding-left: 1.5em
+}
+ol ol,
+ol ul,
+ul ol,
+ul ul {
+  margin-bottom: 0
+}
+a {
+  text-decoration: none;
+  color: #3498db;
+  border-bottom: 1px solid #3498db
+}
+a:hover {
+  cursor: pointer;
+  color: #217dbb;
+  border-bottom: 0
+}
+::-moz-selection {
+  color: #000;
+  background: rgba(0,0,0,.1);
+  text-shadow: none
+}
+::selection {
+  color: #000;
+  background: rgba(0,0,0,.1);
+  text-shadow: none
+}
+table {
+  width: 100%
+}
+td,
+th {
+  padding: .25em;
+  text-align: left
+}
+tbody tr:nth-of-type(odd) {
+  background-color: #f7f7f7
+}
+[colspan] {
+  text-align: center
+}
+[colspan='1'] {
+  text-align: left
+}
+[rowspan] {
+  vertical-align: middle
+}
+[rowspan='1'] {
+  vertical-align: top
+}
+hr {
+  height: 1px;
+  margin: 1em 0;
+  border: none;
+  background-color: #ddd
+}
+fieldset {
+  min-width: 0;
+  margin: 0;
+  padding: 1em;
+  border: 1px solid #ddd;
+  border-radius: 4px
+}
+fieldset legend {
+  font-weight: 700;
+  line-height: inherit;
+  display: block;
+  padding: 0 .5em;
+  border: 0;
+  background-color: #fff;
+  font-size: 16px;
+  font-size: 1.6rem
+}
+label {
+  font-weight: 700;
+  display: inline-block;
+  display: block;
+  max-width: 100%;
+  margin-bottom: 5px
+}
+input,
+textarea {
+  width: 100%;
+  margin-bottom: 1em;
+  padding: .25em .5em;
+  border: 1px solid #ddd;
+  border-radius: 4px
+}
+input:hover,
+textarea:hover {
+  border: 1px solid #c4c4c4
+}
+input:focus,
+textarea:focus {
+  border: 1px solid #3498db;
+  outline: 0
+}
+button {
+  font-weight: 700;
+  line-height: 1.4;
+  display: inline-block;
+  padding: .25em .55em;
+  cursor: pointer;
+  white-space: nowrap;
+  text-decoration: none;
+  color: inherit;
+  border: 1px solid #d5d5d5;
+  border-radius: 4px;
+  background-color: #eee;
+  background-image: linear-gradient(#fcfcfc,#eee);
+  background-repeat: no-repeat;
+  text-shadow: 0 1px 0 #fff
+}
+button:hover {
+  text-decoration: none;
+  color: inherit;
+  border: 1px solid #ccc;
+  background-color: #ddd;
+  background-image: linear-gradient(#eee,#ddd)
+}
+button:focus {
+  text-decoration: none;
+  border-color: #3498db;
+  outline: 0
+}
+button:active {
+  border-color: #b5b5b5;
+  background-color: #dcdcdc;
+  background-image: none;
+  box-shadow: inset 0 2px 4px rgba(0,0,0,.15)
+}
+button:disabled {
+  color: #999;
+  background-color: #efefef;
+  background-image: none
+}
+button:disabled:hover {
+  cursor: not-allowed
+}
+aside {
+  background-color: #eee;
+  padding: 0 .5em;
+  border-radius: 4px
+}
+main {
+  max-width: 960px;
+  margin: 0 auto;
+  padding: 20px
+}
+header ul {
+  padding-left: 0;
+  list-style-type: none
+}
+header li {
+  text-align: center;
+  border-bottom: 1px solid #ddd
+}
+@media (min-width:40em) {
+  header li {
+    display: inline-block;
+    text-align: left;
+    border-bottom: none
+  }
+  header li:first-child a {
+    padding-left: 0
+  }
+  header li:last-child a {
+    padding-right: 0
+  }
+}
+header li a {
+  display: block;
+  width: 100%;
+  padding: .25em .5em;
+  border-bottom: none
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/index.md	Mon Jun 07 21:32:05 2021 +0200
@@ -0,0 +1,62 @@
+% libbase64 - base64 encoding and decoding
+% David Demelier <markand@malikania.fr>
+% 2021-06-07
+
+libbase64 - base64 encoding and decoding
+========================================
+
+The `libbase64` is a minimal C library to decode and encore base64 in pure C89.
+It does not depend on anything no portable except C standard library.
+
+It consists of:
+
+- base64 encoding,
+- base64 decoding (with base64url support),
+- no dynamic allocation required,
+- only C89 required.
+- less than 200 lines of code.
+- 2 public functions.
+
+News
+----
+
+- (2021-06-07) New release: libbase64 2.0.0.
+
+Download
+--------
+
+### Official releases
+
+- [libbase64-2.0.0.tar.xz][] ([signature][libbase64-2.0.0.tar.xz.asc])
+
+### Development version
+
+You can install a development version using [Mercurial][hg]
+
+	hg clone http://hg.malikania.fr/libbase64
+
+Installation
+------------
+
+The library is too small to be worth being installed system wide and as such
+there are no `install` target nor library generation. Instead, you should simply
+copy the files `base64.c` and `base64.h` to your project and start using the
+functions.
+
+You can still run the test suite using `make tests` command.
+
+Documentation
+-------------
+
+Manual pages:
+
+- [libbase64.3](libbase64.html) ([pdf](libbase64.pdf))
+
+Also have a look into the official [README.md][] file in the repository
+which may contain additional information and a FAQ.
+
+[hg]: http://mercurial-scm.org
+[INSTALL.md]: http://hg.malikania.fr/libbase64/file/tip/INSTALL.md
+[README.md]: http://hg.malikania.fr/libbase64/file/tip/README.md
+[libbase64-2.0.0.tar.xz]: http://releases.malikania.fr/libbase64/2.0.0/libbase64-2.0.0.tar.xz
+[libbase64-2.0.0.tar.xz.asc]: http://releases.malikania.fr/libbase64/2.0.0/libbase64-2.0.0.tar.xz.asc