From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/3214 Path: news.gmane.org!not-for-mail From: Isaac Dunham Newsgroups: gmane.linux.lib.musl.general Subject: Re: High-priority library replacements? Date: Thu, 25 Apr 2013 21:19:14 -0700 Message-ID: <20130425211914.2d98535d.idunham@lavabit.com> References: <20130425041553.GA13951@brightrain.aerifal.cx> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1366949965 32722 80.91.229.3 (26 Apr 2013 04:19:25 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 26 Apr 2013 04:19:25 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-3218-gllmg-musl=m.gmane.org@lists.openwall.com Fri Apr 26 06:19:29 2013 Return-path: Envelope-to: gllmg-musl@plane.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1UVa89-0004dy-5L for gllmg-musl@plane.gmane.org; Fri, 26 Apr 2013 06:19:29 +0200 Original-Received: (qmail 13318 invoked by uid 550); 26 Apr 2013 04:19:28 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 12284 invoked from network); 26 Apr 2013 04:19:27 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=lavabit; d=lavabit.com; b=0b1JzSnQACIXd9FZXmlTJGqH9IB+NWVS3qO4sUR9vx635MhvUofM0wJwz528TNsM867ZLc767FRZRJLkkTeITEcHf+k/hX8lTTwPzQIVhsjkaHueQCp3fw/2auhocDU+MNhiYAeBux2l+x8rKwQunwNJ36vQeZLASs8Y/8S1vQc=; h=Date:From:To:Subject:Message-Id:In-Reply-To:References:X-Mailer:Mime-Version:Content-Type:Content-Transfer-Encoding; In-Reply-To: <20130425041553.GA13951@brightrain.aerifal.cx> X-Mailer: Sylpheed 3.0.2 (GTK+ 2.20.1; i486-pc-linux-gnu) Xref: news.gmane.org gmane.linux.lib.musl.general:3214 Archived-At: On Thu, 25 Apr 2013 00:15:53 -0400 Rich Felker wrote: > 3. Image format and compression (libpng, zlib, etc.). The existing > libraries are full of atrociously bad error-handling practices, and > quite bloated. These libraries should be well-factored so that > programs that just want to read (the majority of use cases) don't have > to pull in code for writing. Unfortunately the interfaces might not be > so simple, since an important usage case is progressive rendering of > partially-loaded images, both for the purpose of loading over slow > network connections and for rendering thumbnails quickly. Have you perchance seen libpnglite? http://sourceforge.net/projects/pnglite/files/ Yes, I know it's NOT well-factored; the author wanted something where a single file and header could be added to a project and there's PNG support. Uses the png_ namespace. AFAICT, it accepts either a buffer to use for the png or a null pointer, in which case it malloc's what is necessary. License is BSD-ish. It includes a reference to "zlite.h", which seems to be a zip library with a z_ namespace. Also, I ran across stb_image_write.h, but...I hesitate to _recommend_ something where the header contains all the function source. stb_image.c is another "small, but I don't think that's good enough" thing... > All of these libraries should: > > - Avoid namespace pollution. Only external symbols should be the > public API and internal-use stuff prefixed with an ugly prefix > that's extremely unlikely to clash with anything. > - Avoid unnecessary allocation. Use caller-provided objects where > possible or provide both options. > - Have absolutely zero global state. > > That's all I can think of at the moment but I'm sure there are other > needs I've come across and forgotten. Please feel free to supplement > this list. A links that may be helpful, perhaps... http://bashismal.blogspot.com/2011/10/unbloated-resources-in-c.html -- Isaac Dunham