From phma@ixazon.dynip.com Wed Jan 22 19:26:53 2003 Received: with ECARTIS (v1.0.0; list lojban-list); Wed, 22 Jan 2003 19:26:54 -0800 (PST) Received: from 208-150-110-21-adsl.precisionet.net ([208.150.110.21] helo=blackcat.ixazon.lan) by digitalkingdom.org with esmtp (Exim 4.05) id 18bY0u-0004kC-00 for lojban-list@lojban.org; Wed, 22 Jan 2003 19:26:49 -0800 Received: by blackcat.ixazon.lan (Postfix, from userid 1001) id 8757F4FC4; Thu, 23 Jan 2003 03:26:17 +0000 (UTC) From: Pierre Abbat Organization: dis To: lojban-list@lojban.org Subject: [lojban] C question: How to or strings and get a string? Date: Wed, 22 Jan 2003 22:26:16 -0500 User-Agent: KMail/1.5 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline Message-Id: <200301222226.16684.phma@webjockey.net> X-archive-position: 3855 X-ecartis-version: Ecartis v1.0.0 Sender: lojban-list-bounce@lojban.org Errors-to: lojban-list-bounce@lojban.org X-original-sender: phma@webjockey.net Precedence: bulk Reply-to: lojban-list@lojban.org X-list: lojban-list I am very close to having a tolpo'u a'o ke valfendi mutmi'i. There are a few lines in the program that I'm not sure how to fix: #define is3rafsi(str) (monmapti("ICV",str) || monmapti("CVC",str) || monmapti("CUV",str)) #define is4rafsi(str) (monmapti("CVCC",str) || monmapti("ICVC",str)) #define isgismu(str) (monmapti("CVCCV",str) || monmapti("ICVCV",str)) monmapti returns NULL if it didn't match or a pointer to the first character after the matching string if it does. is3rafsi is supposed to do the same, but instead it returns 1, which confuses isslinkuhi, which then calls is3rafsi(1) and crashes. I can't just add 3 because the string contains commas ju apostrophes. Is there a way to write a macro to do this, or do I need to write a function? phma