--- wap-wml-tools-0.0.4.orig/wmlv/wmlv.c +++ wap-wml-tools-0.0.4/wmlv/wmlv.c @@ -10,8 +10,8 @@ #include #include #include -#include -#include +#include +#include #define TA_NONE 0 #define TA_BOLD 1 @@ -32,9 +32,9 @@ { while(node) { fprintf(stderr, "%*s == %s\n", dumpNodeIndent, "", node->name); - if(node->childs) { + if(node->children) { dumpNodeIndent += 2; - dumpNode(node->childs); + dumpNode(node->children); dumpNodeIndent -= 2; } node = node->next; @@ -97,8 +97,8 @@ } else printf("\n#! : %s\n", node->name); - if(node->childs) - showNode(node->childs, nTextAttr); + if(node->children) + showNode(node->children, nTextAttr); nTextAttr = oTextAttr; node = node->next; @@ -114,7 +114,7 @@ printf("Card: %s (id: %s)\n", xmlGetProp(cardNode, "title"), xmlGetProp(cardNode, "id")); printf("------------------------------------------\n\n"); - showNode(cardNode->childs, TA_NONE); + showNode(cardNode->children, TA_NONE); printf("\n------------------------------------------\n"); } } @@ -132,8 +132,8 @@ return node; } - if(node->childs) { - if((card = findCard(node->childs, id))) + if(node->children) { + if((card = findCard(node->children, id))) return card; } @@ -166,9 +166,9 @@ } if(debug) - dumpNode(doc->root); + dumpNode(doc->children); - showCard(findCard(doc->root, card)); + showCard(findCard(doc->children, card)); return 0; } --- wap-wml-tools-0.0.4.orig/rdfwml/rdfwml.c +++ wap-wml-tools-0.0.4/rdfwml/rdfwml.c @@ -10,8 +10,8 @@ #include #include #include -#include -#include +#include +#include #ifdef CGI_BIN void wmlError(char *error) @@ -58,7 +58,7 @@ for(node = channel; node != NULL; node = node->next) { if(strcasecmp("title", node->name) == 0) { - on = node->childs; + on = node->children; if(strcasecmp("text", on->name) == 0) printf("

%s

\n", on->content); } @@ -71,7 +71,7 @@ for(node = item; node != NULL; node = node->next) { if(strcasecmp("title", node->name) == 0) { - on = node->childs; + on = node->children; if(strcasecmp("text", on->name) == 0) printf("

----

\n"); printf("

"); @@ -85,6 +85,8 @@ void parseRdf(xmlNodePtr rdf) { xmlNodePtr node; + xmlNodePtr basenode; + xmlNodePtr subnode; puts(""); puts(""); @@ -96,11 +98,26 @@ puts(" "); puts(" "); - for(node = rdf->childs; node != NULL; node = node->next) { - if(strcasecmp("channel", node->name) == 0) - parseChannel(node->childs); - else if(strcasecmp("item", node->name) == 0) - parseHeadline(node->childs); + basenode = rdf; + /* Skip everything which is not an element node */ + while (basenode->type != XML_ELEMENT_NODE) { + basenode = basenode->next; + } + + for (node = basenode->children; node != NULL; node = node->next) { + if(strcasecmp("channel", node->name) == 0) { + parseChannel(node->children); + for (subnode = node->children; subnode != NULL; subnode = subnode->next) { + /* RSS has a different tree structure */ + if (strcasecmp("item", subnode->name) == 0) { + parseHeadline(subnode->children); + } + } + } else { + if (strcasecmp("item", node->name) == 0) { + parseHeadline(node->children); + } + } } puts(" "); @@ -144,7 +161,7 @@ #endif /* CGI_BIN */ } - parseRdf(rdf->root); + parseRdf(rdf->children); exit(0); } --- wap-wml-tools-0.0.4.orig/configure +++ wap-wml-tools-0.0.4/configure @@ -6,8 +6,11 @@ CC_OPS="-I../" CC="" OPTIMISE_IF_GCC="y" -XML_CONFIG="xml-config" +XML_CONFIG="xml2-config" SHARED_LINK="" +if [ "$TMPDIR" = "" ] ; then + TMPDIR=/tmp +fi echo "wml-tools v$VERSION configuration script" @@ -53,16 +56,16 @@ if [ "$CC_WORKS" = "n" -a "$CC_TEST" != "" ]; then CC="$CC_TEST" echo -n "Testing compiler $CC ... " - cat >/tmp/.pwt.c << EOF + cat >$TMPDIR/.pwt.c << EOF #include void main(void) { puts("CC Test"); } EOF - $CC -o /tmp/.pwt /tmp/.pwt.c >/dev/null 2>&1 - if [ -e "/tmp/.pwt" ]; then + $CC -o $TMPDIR/.pwt $TMPDIR/.pwt.c >/dev/null 2>&1 + if [ -e "$TMPDIR/.pwt" ]; then echo "Found" echo -n "Checking if compiler $CC works ... " - if [ "`/tmp/.pwt`" = "CC Test" ]; then + if [ "`$TMPDIR/.pwt`" = "CC Test" ]; then echo "Yes" CC_WORKS="y" else @@ -75,7 +78,7 @@ fi fi done -rm -f /tmp/.pwt /tmp/.pwt.c +rm -f $TMPDIR/.pwt $TMPDIR/.pwt.c if [ "$CC_WORKS" = "n" ]; then echo "Couldn't find a working compiler" --- wap-wml-tools-0.0.4.orig/wmlc/wmlc.c +++ wap-wml-tools-0.0.4/wmlc/wmlc.c @@ -10,8 +10,8 @@ #include #include #include -#include -#include +#include +#include #define WML_NO_CLOSURES #include #include @@ -98,7 +98,7 @@ char buffer[256]; while(attributes) { - val = attributes->val; + val = attributes->children; if(strcmp(val->name, "text") != 0) { fprintf(stderr, "Parse error: can't handle non plaintext attribute values\n"); crashBurn(); @@ -171,7 +171,7 @@ if(node->properties) tagVal |= WMLTC_ATTRIBUTES; - if(node->childs) + if(node->children) tagVal |= WMLTC_CONTENT; fputc(tagVal, out); @@ -179,8 +179,8 @@ if(node->properties) compileAttributes(node->properties); - if(node->childs) - compileTags(node->childs); + if(node->children) + compileTags(node->children); if(tagHasClosure(tagNum)) fputc(WMLTC_END, out); @@ -239,7 +239,7 @@ fputc(0x6A, out); fputc(0x00, out); - compileTags(doc->root); + compileTags(doc->children); fclose(out); --- wap-wml-tools-0.0.4.orig/wmlhtml/wmlhtml.c +++ wap-wml-tools-0.0.4/wmlhtml/wmlhtml.c @@ -10,8 +10,8 @@ #include #include #include -#include -#include +#include +#include FILE *out; @@ -24,9 +24,9 @@ { while(node) { fprintf(stderr, "%*s == %s\n", dumpNodeIndent, "", node->name); - if(node->childs) { + if(node->children) { dumpNodeIndent += 2; - dumpNode(node->childs); + dumpNode(node->children); dumpNodeIndent -= 2; } node = node->next; @@ -56,7 +56,7 @@ fprintf(out, "%*s<%s", htmlIndent, "", node->name); attr = node->properties; while(attr) { - val = attr->val; + val = attr->children; if(strcmp(val->name, "text") != 0) continue; else @@ -66,9 +66,9 @@ fprintf(out, ">\n"); } - if(node->childs) { + if(node->children) { htmlIndent += 2; - showHtml(node->childs); + showHtml(node->children); htmlIndent -= 2; } @@ -104,9 +104,9 @@ } if(debug) - dumpNode(doc->root); + dumpNode(doc->children); - showHtml(doc->root); + showHtml(doc->children); return 0; } --- wap-wml-tools-0.0.4.orig/manpages/wmlhtml.1 +++ wap-wml-tools-0.0.4/manpages/wmlhtml.1 @@ -0,0 +1,11 @@ +.TH wmlhtml 1 "July 2005" "Debian/GNU Linux" +.SH NAME +wmlhtml \- WML to HTML converter +.SH DESCRIPTION + +This is a very simple WML to HTML converter. All it does is swap some tags +around so that browsers can render it. It leaves in a lot of WML-specific +tags but the HTML spec kindly tells browsers to ignore anything they don't +understand, so the pages can still be viewed. + +Usage: ./wmlhtml file.wml [output.html] --- wap-wml-tools-0.0.4.orig/manpages/wbmp2xpm.1 +++ wap-wml-tools-0.0.4/manpages/wbmp2xpm.1 @@ -0,0 +1,21 @@ +.TH wbmp2xpm 1 "July 2005" "Debian/GNU Linux" +.SH NAME +wbmp2xpm \- Converts WBMP files to 1- bit XPM files +.SH DESCRIPTION + +These are tools for dealing with WBMP files - WAP bitmaps. + +These files are really simple - the first two bytes contain version +information (I think) which at the minute is set to 0. The 3rd byte +contains the width and the 4th byte the height (I guess this makes WBMP +images max 255x255 pixels then). + +From the 5th byte onwards they are simply byte-padded binary encoded 1-bit +images - 1 for white, 0 for black. + +wbmp2xpm generates 1-bit XPM files from WBMP files. An example WBMP file +is included (logo.wbmp). + +Coming soon : something useful (i.e. a WBMP creator) + +Usage: ./wbmp2xpm --- wap-wml-tools-0.0.4.orig/manpages/wmlc.1 +++ wap-wml-tools-0.0.4/manpages/wmlc.1 @@ -0,0 +1,23 @@ +.TH wmlc 1 "July 2005" "Debian/GNU Linux" +.SH NAME +wmlc \- A basic WML compiler +.SH DESCRIPTION + +This is a basic WML compiler. It takes the WML source and compiles into +WML bytecode ready for transmission to a WAP device. + +It is quite basic and has a lot of limitations, but things it can compile +can be decompiled by wmld and vice versa. + +So long as scripts and variables aren't involved, the pages compiled seem +to work reasonably well in Nokia's WAP Toolkit and Ericsson's WAP SDK. It +isn't most efficient, however, and the bytecode will be larger than other +compilers. Optimisation is Coming Soon(tm). + +In order to compile bytecode in which simple scripts can work there needs +to be a mechanism for building up the string table and also finding out +what tag is appropriate (other compilers use WMLG_STR_T, WMLG_EXT_T_2 or +WMLG_EXT_I_2 to specify that a variable is coming and I don't know which +one to use - or even if it makes a difference) + +Usage: ./wmlc file.wml [output.wmlc] --- wap-wml-tools-0.0.4.orig/manpages/wmld.1 +++ wap-wml-tools-0.0.4/manpages/wmld.1 @@ -0,0 +1,19 @@ +.TH wmld 1 "July 2005" "Debian/GNU Linux" +.SH NAME +wmld \- A basic WML bytecode decompiler +.SH DESCRIPTION + +At the moment this is a simple WML bytecode decompiler, wmld. This has +been built out of the few WML bytecode references I have (they are +incredibly difficult to get a hold of without having to sign your life +away on licensing agreements or paying ridiculous amounts of cash for). + +The decompiler can now handle value attributes properly, inline strings, +the string table (with references by normal text or by variable name) and +can now decode bytecode to useable WML code with just about everything I +can throw at it. + +I'd probably say that this isn't alpha code anymore. It's now beta. It +stops being beta when I test it with a LOT more bytecode. + +Usage: ./wmld file.wmlc [output.wml] --- wap-wml-tools-0.0.4.orig/manpages/wmlv.1 +++ wap-wml-tools-0.0.4/manpages/wmlv.1 @@ -0,0 +1,20 @@ +.TH wmlv 1 "July 2005" "Debian/GNU Linux" +.SH NAME +wmlv \- Very simple text-based WML deck viewer +.SH DESCRIPTION + +This is a very simple text-based WML deck viewer. It doesn't have any +concept of WMLscript, definable widgets, images or tables. It just runs +through the source putting it out as it thinks is best. + +Use it as "wmlv file.wml [card]" where [card] is an optional card to show +from the deck (default is the first encountered). + +The end result should see the output from wmld being passed to here, +thereby creating a viewer which can handle bytecode too. + +An X version of this is being planned which should be able to handle the +definable widgets, images and tables. WMLscript is still beyond me at the +minute. + +Usage: ./wmlv file.wml [card ID] --- wap-wml-tools-0.0.4.orig/manpages/rdfwml.1 +++ wap-wml-tools-0.0.4/manpages/rdfwml.1 @@ -0,0 +1,17 @@ +.TH rdfwml 1 "July 2005" "Debian/GNU Linux" +.SH NAME +rdfwml \- Converter for Netscape RDF channel files to WML decks +.SH DESCRIPTION + +This is a simple converter for Netscape RDF channel files to small WML +decks which contain a small card with each item. The CGI variant just adds +the correct Content-Type header and works out the file to parse from the +QUERY_STRING variable. + +To use rdfwml just call it with an RDF file (one from Slashdot is +provided). + +To use rdfwml.cgi, link it like: + News! + +Usage: ./rdfwml file.rdf --- wap-wml-tools-0.0.4.orig/debian/changelog +++ wap-wml-tools-0.0.4/debian/changelog @@ -0,0 +1,50 @@ +wap-wml-tools (0.0.4-5) unstable; urgency=low + + * More robust RDF parser, also groks simple RSS now (Closes: #308113) + + -- Axel Beckert Mon, 6 Nov 2006 00:28:13 +0100 + +wap-wml-tools (0.0.4-4) unstable; urgency=low + + * New Maintainer (Closes: #354502) + * Bumps Standards version to 3.7.2 + * Mentioning that upstream seems to have dropped the software in the + copyright file + + -- Axel Beckert Sun, 5 Nov 2006 20:41:15 +0100 + +wap-wml-tools (0.0.4-3) unstable; urgency=low + + * QA upload. + * Package is orphaned (#354502); set maintainer to Debian QA Group. + * Switch to debhelper 5. + * Move /usr/share/doc/wap-wml-tools/samples to .../examples. + * debian/changelog: Remove obsolete Emacs local variables. + * debian/rules: Remove Makefile on clean. + + -- Matej Vela Tue, 14 Mar 2006 10:17:04 +0100 + +wap-wml-tools (0.0.4-2) unstable; urgency=low + + * Added Build-Depends: debhelper, libxml2-dev (Closes: Bug#263359) + * Added test for TMPDIR variable in configure script + * Created simple man pages from README files and binary usage instructions + * Updated Standards-version to 3.6.2 + * Created debian/compat (V4) + * Versioned Build-Depends on debhelper >= 4 + * Removed dh_suidregister from rules file + * Switched to dh_installman instead of dh_installmanpages + * Added ${misc:Depends} to Depends field in control file + * Revised package description + * Applied patch from Florian Steinel which converts + wap-wml-tools to libxml2 (Closes: Bug#276982) + * Small addition to Florian's patch: now we use xml2-config instead of + xml-config in configure script so that proper link options are generated + + -- Fernando Sanchez Sun, 3 Jul 2005 13:17:27 +0200 + +wap-wml-tools (0.0.4-1) unstable; urgency=low + + * Initial Release. + + -- Fernando Sanchez Sun, 27 Feb 2000 13:18:49 +0100 --- wap-wml-tools-0.0.4.orig/debian/compat +++ wap-wml-tools-0.0.4/debian/compat @@ -0,0 +1 @@ +5 --- wap-wml-tools-0.0.4.orig/debian/control +++ wap-wml-tools-0.0.4/debian/control @@ -0,0 +1,19 @@ +Source: wap-wml-tools +Section: non-free/web +Priority: optional +Maintainer: Axel Beckert +Build-Depends: debhelper (>= 5), libxml2-dev +Standards-Version: 3.7.2 + +Package: wap-wml-tools +Architecture: any +Depends: ${shlibs:Depends} ${misc:Depends} +Description: Wireless Markup Language development and test tools + wml-tools is a suite of small programs designed to help in the + construction of WAP WML decks. The suite currently comprises: + * wmlc - a WML bytecode compiler + * wmld - a WML bytecode decompiler + * wmlv - a very simple text-based WML deck viewer + * wbmp2xpm - a WBMP to XPM converter + * wmlhtml - a simple WML deck to HTML converter + * rdfwml - an RDF channel to WML deck converter --- wap-wml-tools-0.0.4.orig/debian/copyright +++ wap-wml-tools-0.0.4/debian/copyright @@ -0,0 +1,55 @@ +This package was debianized by Fernando Sanchez on +Sun, 27 Feb 2000 13:18:49 +0100. + +It was initially downloaded from http://pwot.co.uk/wml/. The original +site does not exist anymore and the upstream author seems to have +dropped the project. A copy of the original website can be found at +http://maintained.by.noone.org/wml-tools/. + +Upstream Author: Thomas Neill + +Copyright: + +Terms used in this document : + + * I, me : The author, the person who coded these tools + * you : The user, the person reading this, the person to whom the + license applies + * programs : The source code and executables in this package + +Disclaimer : + + These programs come with no warranty, implied or stated. I cannot be + held responsible for the actions of the programs. If they damage your + equipment or even you I accept no liability. If it breaks, well, sorry + but that's tough. + +What you are entitled to : + + You can download, compile and use these programs for any non-commercial + activities. You can distribute them freely so long as no charge (other + than REASONABLE media charges) are made. + + You may make changes to these programs and redistribute them so long as : + + * The new distribution makes clear that it is derived from these + programs + * The changes made can be freely incorporated in future releases of + these programs + * The changes are only used for non-commercial activities + * The copyright notices are unchanged + +You are NOT entitled to : + + You may not sell these programs or engage in any activity that generates + profit from the use of these programs. + + You may not redistribute these programs without maintaining the + copyright notices. You may not redistribute modified versions of these + programs without maintaining the copyright notices and clear notices + that these programs were the basis of the new distribution. + +Summary : + + Use, compile and be happy. Give credit where credit is due and don't try + to make money out of it. --- wap-wml-tools-0.0.4.orig/debian/docs +++ wap-wml-tools-0.0.4/debian/docs @@ -0,0 +1,3 @@ +GOTCHAS +README +WAP --- wap-wml-tools-0.0.4.orig/debian/examples +++ wap-wml-tools-0.0.4/debian/examples @@ -0,0 +1 @@ +samples/* --- wap-wml-tools-0.0.4.orig/debian/install +++ wap-wml-tools-0.0.4/debian/install @@ -0,0 +1,21 @@ +rdfwml/rdfwml usr/bin +rdfwml/README usr/share/doc/wap-wml-tools/rdfwml +rdfwml/rdfwml.cgi usr/share/doc/wap-wml-tools/rdfwml +rdfwml/slashdot.rdf usr/share/doc/wap-wml-tools/rdfwml + +wbmp/wbmp2xpm usr/bin +wbmp/README usr/share/doc/wap-wml-tools/wbmp +wbmp/logo.wbmp usr/share/doc/wap-wml-tools/wbmp +wbmp/logo.xpm usr/share/doc/wap-wml-tools/wbmp + +wmlc/wmlc usr/bin +wmlc/README usr/share/doc/wap-wml-tools/wmlc + +wmld/wmld usr/bin +wmld/README usr/share/doc/wap-wml-tools/wmld + +wmlhtml/wmlhtml usr/bin +wmlhtml/README usr/share/doc/wap-wml-tools/wmlhtml + +wmlv/wmlv usr/bin +wmlv/README usr/share/doc/wap-wml-tools/wmlv --- wap-wml-tools-0.0.4.orig/debian/manpages +++ wap-wml-tools-0.0.4/debian/manpages @@ -0,0 +1 @@ +manpages/* --- wap-wml-tools-0.0.4.orig/debian/rules +++ wap-wml-tools-0.0.4/debian/rules @@ -0,0 +1,51 @@ +#!/usr/bin/make -f + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + +build: build-stamp +build-stamp: + dh_testdir + + ./configure + $(MAKE) + + touch build-stamp + +clean: + dh_testdir + dh_testroot + rm -f build-stamp + + [ ! -f Makefile ] || { $(MAKE) clean && rm -f Makefile; } + + dh_clean + +install: build + dh_testdir + dh_testroot + dh_clean -k + dh_installdirs + dh_install + +binary-indep: build install + +binary-arch: build install + dh_testdir + dh_testroot + dh_installchangelogs Changelog + dh_installdocs + dh_installexamples + dh_installman + dh_link + dh_strip + dh_compress + dh_fixperms + dh_installdeb + dh_shlibdeps + dh_gencontrol + dh_md5sums + dh_builddeb + +binary: binary-indep binary-arch +.PHONY: build clean binary-indep binary-arch binary install