From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/234 Path: news.gmane.org!not-for-mail From: =?UTF-8?B?THVrYSBNYXLEjWV0acSH?= Newsgroups: gmane.linux.lib.musl.general Subject: Re: cluts weekly reports Date: Wed, 03 Aug 2011 23:59:52 +0200 Message-ID: <4E39C4D8.7040403@gmail.com> References: <20110803005619.GA2378@openwall.com> <20110803012112.GT132@brightrain.aerifal.cx> <4E3949E3.4090008@gmail.com> <20110803133155.GV132@brightrain.aerifal.cx> <4E398092.8070907@gmail.com> <20110803172227.GX132@brightrain.aerifal.cx> <4E398D5A.6080207@gmail.com> <20110803181908.GZ132@brightrain.aerifal.cx> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------080008050803000500000302" X-Trace: dough.gmane.org 1312408921 27448 80.91.229.12 (3 Aug 2011 22:02:01 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 3 Aug 2011 22:02:01 +0000 (UTC) Cc: Solar Designer To: musl@lists.openwall.com Original-X-From: musl-return-318-gllmg-musl=m.gmane.org@lists.openwall.com Thu Aug 04 00:01:56 2011 Return-path: Envelope-to: gllmg-musl@lo.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by lo.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1QojVk-0000cA-IN for gllmg-musl@lo.gmane.org; Thu, 04 Aug 2011 00:01:56 +0200 Original-Received: (qmail 28324 invoked by uid 550); 3 Aug 2011 22:01:56 -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 28315 invoked from network); 3 Aug 2011 22:01:55 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type; bh=FgpyPxwhBNEmofFfqZIwfJgBOMKEDjMeAVOIJRufyEk=; b=JI5qWWXGXBlWb1qWijFuiM+2RLsFQb9E2hKBqICwLl+8qBzvwfc/Y+nZP9fNxzG5im aAQHYNcsPlriNYSsl7ZaO28CcgOTwQ1qWvNCsXnmcUbsjrXwt9qugQcUKt3NWvG/l1ac HvzRTAJYMrQUWVJofVpzLuNacUU5QUE6+Tc7E= User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.18) Gecko/20110626 Icedove/3.1.11 In-Reply-To: <20110803181908.GZ132@brightrain.aerifal.cx> Xref: news.gmane.org gmane.linux.lib.musl.general:234 Archived-At: This is a multi-part message in MIME format. --------------080008050803000500000302 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 08/03/2011 08:19 PM, Rich Felker wrote: > Could you include some here? > Rich Attached are example files for the generator: input.json - the input of the generator output.c - (to be) the output of the generator testgen.c - an additional header that output.c uses Luka --------------080008050803000500000302 Content-Type: application/json; name="input.json" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="input.json" WwogICAgewogICAgICAgICJpbmNsdWRlIiA6ICJzdGRsaWIuaCIsCiAgICAgICAgImZ1bmN0 aW9uIjogImNoYXIgKnJlYWxwYXRoKGNvbnN0IGNoYXIgKnJlc3RyaWN0IGZpbGVfbmFtZSwg Y2hhciAqcmVzdHJpY3QgcmVzb2x2ZWRfbmFtZSk7IiwKICAgICAgICAiZGF0YSIgOiBbCiAg ICAgICAgICAgIHsKICAgICAgICAgICAgICAgICJmaWxlX25hbWUiOiAgICAgWyJcIi5cIiIs ICJcIi4vMTIzNDU2Nzg5XCIiXSwKICAgICAgICAgICAgICAgICJyZXNvbHZlZF9uYW1lIjog Ik5VTEwiLAogICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAicmV0dXJuIjogIk5V TEwiLAogICAgICAgICAgICAgICAgImVycm5vIiA6ICJFTkFNRVRPT0xPTkciCiAgICAgICAg ICAgIH0KICAgICAgICBdCiAgICB9Cl0K --------------080008050803000500000302 Content-Type: text/x-csrc; name="output.c" Content-Transfer-Encoding: 8bit Content-Disposition: attachment; filename="output.c" #include #include #include #include #include #include #include "common/common.h" #include /* * Copyright (c) 2011 Luka Marčetić * * Redistribution and use in source and binary forms, with or without * modification, are permitted. * * There's ABSOLUTELY NO WARRANTY, express or implied. */ jmp_buf env; static void bridge_sig_jmp(int sig) { longjmp(env, sig); } int main() { union ret ret; int sig, err; unsigned int d, f, failed; char *call, *more; size_t i = 0; struct arguments *arg; struct sigaction oldact, act; struct { unsigned int ret:1, err:1, sig:1; } error, no_error; memset(&no_error, 0, sizeof(no_error)); act.sa_handler = bridge_sig_jmp; act.sa_flags = SA_NODEFER; struct test t[] = { { "realpath", 2, 1, (struct data[]) { {//data (struct arguments[]) {//arg {2, (char *[]) {".", "./123456789"}}, {1, (char *[]) {NULL}}, }, (char *[]){NULL}, ENAMETOOLONG, }, } }, }; failed = 0; for (f=0; f * * Redistribution and use in source and binary forms, with or without * modification, are permitted. * * There's ABSOLUTELY NO WARRANTY, express or implied. */ //A union for return values of functions union ret { char c; char* s; int i; void* vp; }; ///Atrucutre designed to hold test data struct test { char *fn_name; //function name for the output unsigned int narg; //number of arguments that the function takes unsigned int ndata; //number of test datasets struct data { struct arguments {unsigned int nr; void *vp;} *arg; void *ret; int err; } *data; }; ///Handy macro to get a certain value from an element via the arg void pointer ///Note: it requires arg and i to be a pointer to struct arguments & an iterator // hint: see iter and arg arguments for index() #define ARGV(TYPE, INDEX) ((TYPE *) arg[INDEX].vp)[index(i, arg, INDEX)] /** ** \returns the cardinality of a cartesian product of sets of arguments ** ie the number of iterations required to cover all argument values ** \param t a test to which the arguments belong ** \param d an index of the dataset from t to be taken into consideration **/ size_t iters(struct test t, unsigned int d) { size_t i, product=1; for (i=0; i