summaryrefslogtreecommitdiff
path: root/rpmio
diff options
context:
space:
mode:
authorPaul Nasrat <pnasrat@redhat.com>2007-02-22 17:20:23 +0000
committerPaul Nasrat <pnasrat@redhat.com>2007-02-22 17:20:23 +0000
commit9621964a56f05b0368e2dc21d835fbbde232dca3 (patch)
treef1e44b234fd77d403c8d692b2a9c529fcbaeb146 /rpmio
parentde2d563c757c87836f3cac64bdbadcf1a45011c1 (diff)
downloadrpm-9621964a56f05b0368e2dc21d835fbbde232dca3.tar.gz
rpm-9621964a56f05b0368e2dc21d835fbbde232dca3.tar.bz2
rpm-9621964a56f05b0368e2dc21d835fbbde232dca3.zip
Remove unused library
Diffstat (limited to 'rpmio')
-rw-r--r--rpmio/sexp/.cvsignore32
-rw-r--r--rpmio/sexp/.splintrc55
-rw-r--r--rpmio/sexp/Makefile.am22
-rwxr-xr-xrpmio/sexp/autogen.sh25
-rwxr-xr-xrpmio/sexp/configure.ac27
-rw-r--r--rpmio/sexp/sexp-basic.c302
-rw-r--r--rpmio/sexp/sexp-input.c597
-rw-r--r--rpmio/sexp/sexp-main.c195
-rw-r--r--rpmio/sexp/sexp-output.c642
-rw-r--r--rpmio/sexp/sexp.h303
-rw-r--r--rpmio/sexp/tests/.cvsignore3
-rw-r--r--rpmio/sexp/tests/Makefile.am14
-rwxr-xr-xrpmio/sexp/tests/chk-samples19
-rw-r--r--rpmio/sexp/tests/sexp-sample-a20
-rw-r--r--rpmio/sexp/tests/sexp-sample-b1
-rw-r--r--rpmio/sexp/tests/sexp-sample-cbin430 -> 0 bytes
-rw-r--r--rpmio/sexp/tests/sexp-sample.expbin1592 -> 0 bytes
17 files changed, 0 insertions, 2257 deletions
diff --git a/rpmio/sexp/.cvsignore b/rpmio/sexp/.cvsignore
deleted file mode 100644
index 28bf570a1..000000000
--- a/rpmio/sexp/.cvsignore
+++ /dev/null
@@ -1,32 +0,0 @@
-.deps
-.depend
-.libs
-Doxyfile
-Makefile
-Makefile.in
-aclocal.m4
-autom4te*
-config.cache
-config.guess
-config.h
-config.h.in
-config.log
-config.status
-config.sub
-configure
-doxygen
-depcomp
-install-sh
-libtool
-ltconfig
-ltmain.sh
-missing
-stamp-h
-stamp-h1
-stamp-h.in
-*.la
-*.lcd
-*.lo
-*.swp
-sexp
-sexp-*.tar.gz
diff --git a/rpmio/sexp/.splintrc b/rpmio/sexp/.splintrc
deleted file mode 100644
index 59f3e7d18..000000000
--- a/rpmio/sexp/.splintrc
+++ /dev/null
@@ -1,55 +0,0 @@
--I. -DHAVE_CONFIG_H -D_GNU_SOURCE
-
-#+partial
-+forcehints
-
--warnposix
-
-+unixlib
-
--unrecogcomments # XXX ignore doxygen markings
-
-+strict # lclint level
-
-# --- in progress
--compdef # 3
--evalorder # 10
--infloopsuncon # 6
--noeffect # 4
--noeffectuncon # 51
--retalias # 7
--shiftimplementation
--shiftnegative
--temptrans # 6
--usereleased # 5
-
-# --- +partial artifacts
-
-# --- not-yet at strict level
--bitwisesigned # 16
--elseifcomplete #
--exportfcn # 76
--exporttype # 8
--forblock # tedious
--ifblock # tedious
--namechecks # tedious ANSI compliance checks
-
--compdestroy #
--mustdefine #
--sys-dir-errors
-
--strictops #
--whileblock # tedious
-
-# --- not-yet at checks level
-+enumint #
--mustfree #
--predboolptr #
--usedef #
-
-# --- not-yet at standard level
--boolops #
-+boolint #
-+charint #
-+ignorequals #
-#+matchanyintegral #
diff --git a/rpmio/sexp/Makefile.am b/rpmio/sexp/Makefile.am
deleted file mode 100644
index 4159c32c3..000000000
--- a/rpmio/sexp/Makefile.am
+++ /dev/null
@@ -1,22 +0,0 @@
-AUTOMAKE_OPTIONS = 1.4 foreign
-
-LINT = splint
-
-SUBDIRS=tests
-
-INCLUDES = -I.
-
-noinst_HEADERS = sexp.h
-noinst_PROGRAMS = sexp
-
-sexp_SOURCES = \
- sexp-basic.c sexp-input.c sexp-main.c sexp-output.c
-sexp_LDADD = -lpopt
-
-.PHONY: sources
-sources:
- @echo $(sexp_SOURCES:%=rpmio/sexp/%)
-
-.PHONY: lint
-lint:
- $(LINT) $(DEFS) $(INCLUDES) $(sexp_SOURCES)
diff --git a/rpmio/sexp/autogen.sh b/rpmio/sexp/autogen.sh
deleted file mode 100755
index 0ccf99700..000000000
--- a/rpmio/sexp/autogen.sh
+++ /dev/null
@@ -1,25 +0,0 @@
-#!/bin/sh
-
-srcdir="`dirname $0`"
-test -z "$srcdir" && srcdir=.
-
-THEDIR="`pwd`"
-
-cd "$srcdir"
-libtoolize --copy --force
-aclocal
-autoheader
-automake -a -c
-autoconf
-
-if [ "$1" = "--noconfigure" ]; then
- exit 0;
-fi
-
-cd "$THEDIR"
-
-if [ X"$@" = X -a "X`uname -s`" = "XLinux" ]; then
- $srcdir/configure --prefix=/usr "$@"
-else
- $srcdir/configure "$@"
-fi
diff --git a/rpmio/sexp/configure.ac b/rpmio/sexp/configure.ac
deleted file mode 100755
index 945a8c784..000000000
--- a/rpmio/sexp/configure.ac
+++ /dev/null
@@ -1,27 +0,0 @@
-AC_INIT(sexp.h)
-AC_CANONICAL_SYSTEM
-AC_PREREQ(2.12)
-AC_CONFIG_HEADERS
-AM_INIT_AUTOMAKE(sexp, 1.0)
-AM_CONFIG_HEADER(config.h)
-
-AC_ISC_POSIX
-
-AC_PROG_CC
-AC_GCC_TRADITIONAL
-AM_C_PROTOTYPES
-
-AM_PROG_LIBTOOL
-
-AC_PROG_INSTALL
-
-if test "X$CC" = Xgcc; then
- CFLAGS="-Wall $CFLAGS"
-fi
-
-dnl XXX lose rpm libs
-LIBS=
-
-AC_CONFIG_FILES([Makefile tests/Makefile])
-
-AC_OUTPUT
diff --git a/rpmio/sexp/sexp-basic.c b/rpmio/sexp/sexp-basic.c
deleted file mode 100644
index 8342d9565..000000000
--- a/rpmio/sexp/sexp-basic.c
+++ /dev/null
@@ -1,302 +0,0 @@
-/* SEXP implementation code sexp-basic.c
- * List-based implementation of S-expressions.
- * Ron Rivest
- * 5/5/1997
- */
-
-#include <stdio.h>
-#include <malloc.h>
-#include <stdarg.h>
-#include <stdlib.h>
-#include <string.h>
-#include "sexp.h"
-
-/*@access sexpSimpleString @*/
-/*@access sexpString @*/
-/*@access sexpList @*/
-
-/*@access sexpObject @*/ /* XXX for casts only */
-/*@access sexpIter @*/ /* XXX for casts only */
-
-/******************/
-/* ERROR MESSAGES */
-/******************/
-
-/* ErrorMessage(level,msg,c1,c2)
- * prints error message on standard output (msg is a c format string)
- * c1 and c2 are (optional) integer parameters for the message.
- * Terminates iff level==ERROR, otherwise returns.
- */
-void ErrorMessage(int level, const char *fmt, ...)
-{
- va_list ap;
-
- (void) fflush(stdout);
- printf("\n*** ");
- if (level==WARNING) printf("Warning: ");
- else if (level==ERROR) printf("Error: ");
- va_start(ap, fmt);
- (void) vprintf(fmt, ap);
- va_end(ap);
- printf(" ***\n");
- if (level==ERROR) exit(EXIT_FAILURE);
-}
-
-/**********************/
-/* STORAGE ALLOCATION */
-/**********************/
-
-/* initializeMemory()
- * take care of memory initialization
- */
-void initializeMemory(void)
-{ ; } /* nothing in this implementation -- use malloc */
-
-/* sexpAlloc(n)
- * Allocates n bytes of storage.
- * Terminates execution if no memory available.
- */
-void * sexpAlloc(size_t n)
-{
- void * c = calloc(1, n);
-
- if (c == NULL) ErrorMessage(ERROR,"Error in sexpAlloc: out of memory!");
-/*@-nullret@*/
- return c;
-/*@=nullret@*/
-}
-
-/***********************************/
-/* SEXP SIMPLE STRING MANIPULATION */
-/***********************************/
-
-/* newSimpleString()
- * Creates and initializes new sexpSimpleString object.
- * Allocates 16-character buffer to hold string.
- */
-sexpSimpleString newSimpleString(void)
-{
- sexpSimpleString ss = sexpAlloc(sizeof(*ss));
-
- ss->length = 0;
- ss->allocatedLength = 16;
- ss->string = sexpAlloc(16);
- return ss;
-}
-
-/* simpleStringLength(ss)
- * returns length of simple string
- */
-size_t simpleStringLength(sexpSimpleString ss)
-{
- return ss->length;
-}
-
-/* simpleStringString(ss)
- * returns pointer to character array of simple string
- */
-octet *simpleStringString(sexpSimpleString ss)
-{
- return ss->string;
-}
-
-/* reallocateSimpleString(ss)
- * Changes space allocated to ss.
- * Space allocated is set to roughly 3/2 the current string length, plus 16.
- */
-sexpSimpleString reallocateSimpleString(sexpSimpleString ss)
-{
- if (ss == NULL) {
- ss = newSimpleString();
- if (ss == NULL) return NULL;
- }
- if (ss->string == NULL)
- ss->string = sexpAlloc(16);
- else {
- size_t newsize = 16 + 3*(ss->length)/2;
- octet * newstring = sexpAlloc(newsize);
-
- memcpy(newstring, ss->string, ss->length);
- /* zeroize string before freeing; as it may be sensitive */
- memset(ss->string, 0, ss->allocatedLength);
- free(ss->string);
- ss->string = newstring;
- ss->allocatedLength = newsize;
- }
- return ss;
-}
-
-/* appendCharToSimpleString(c,ss)
- * Appends the character c to the end of simple string ss.
- * Reallocates storage assigned to s if necessary to make room for c.
- */
-void appendCharToSimpleString(int c, sexpSimpleString ss)
-{
- if (ss == NULL) {
- ss = newSimpleString();
- if (ss == NULL) return;
- }
-/*@-branchstate@*/
- if (ss->string == NULL || ss->length == ss->allocatedLength )
- ss = reallocateSimpleString(ss);
-/*@=branchstate@*/
- if (ss != NULL && ss->string != NULL)
- ss->string[ss->length++] = (octet) (c & 0xFF);
-}
-
-/****************************/
-/* SEXP STRING MANIPULATION */
-/****************************/
-
-/* newSexpString()
- * Creates and initializes a new sexpString object.
- * Both the presentation hint and the string are initialized to NULL.
- */
-sexpString newSexpString(void)
-{
- sexpString s = sexpAlloc(sizeof(*s));
-
- s->type = SEXP_STRING;
- s->presentationHint = NULL;
- s->string = NULL;
- return s;
-}
-
-/* sexpStringPresentationHint()
- * returns presentation hint field of the string
- */
-sexpSimpleString sexpStringPresentationHint(sexpString s)
-{
- return s->presentationHint;
-}
-
-/* setSexpStringPresentationHint()
- * assigns the presentation hint field of the string
- */
-void setSexpStringPresentationHint(sexpString s, sexpSimpleString ss)
-{
-/*@-assignexpose@*/
- s->presentationHint = ss;
-/*@=assignexpose@*/
-}
-
-/* setSexpStringString()
- * assigns the string field of the string
- */
-void setSexpStringString(sexpString s, sexpSimpleString ss)
-{
-/*@-assignexpose@*/
- s->string = ss;
-/*@=assignexpose@*/
-}
-
-/* sexpStringString()
- * returns the string field of the string
- */
-sexpSimpleString sexpStringString(sexpString s)
-{
- return s->string;
-}
-
-/* closeSexpString()
- * finish up string computations after created
- */
-void closeSexpString(/*@unused@*/ sexpString s)
-{ ; } /* do nothing in this implementation */
-
-/**************************/
-/* SEXP LIST MANIPULATION */
-/**************************/
-
-/* newSexpList()
- * Creates and initializes a new sexpList object.
- * Both the first and rest fields are initialized to NULL, which is
- * SEXP's representation of an empty list.
- */
-sexpList newSexpList(void)
-{
- sexpList list = sexpAlloc(sizeof(*list));
-
- list->type = SEXP_LIST;
- list->first = NULL;
- list->rest = NULL;
- return list;
-}
-
-/* sexpAddSexpListObject()
- * add object to end of list
- */
-void sexpAddSexpListObject(sexpList list, sexpObject object)
-{
- if (list->first == NULL) {
-/*@-assignexpose@*/
- list->first = object;
-/*@=assignexpose@*/
- } else {
- while (list->rest != NULL)
- list = list->rest;
- list->rest = newSexpList();
-/*@-branchstate@*/
- if ((list = list->rest) != NULL) {
-/*@-assignexpose@*/
- list->first = object;
-/*@=assignexpose@*/
- }
-/*@=branchstate@*/
- }
-}
-
-/* closeSexpList()
- * finish off a list that has just been input
- */
-void closeSexpList(/*@unused@*/ sexpList list)
-{ ; } /* nothing in this implementation */
-
-/* Iteration on lists.
- To accomodate different list representations, we introduce the
- notion of an "iterator".
-*/
-
-/* sexpListIter()
- * return the iterator for going over a list
- */
-sexpIter sexpListIter(sexpList list)
-{
-/*@-castexpose@*/
- return (sexpIter)list;
-/*@=castexpose@*/
-}
-
-/* sexpIterNext()
- * advance iterator to next element of list, or else return null
- */
-sexpIter sexpIterNext(sexpIter iter)
-{
- if (iter == NULL) return NULL;
- return (sexpIter)(((sexpList)iter)->rest);
-}
-
-/* sexpIterObject ()
- * return object corresponding to current state of iterator
- */
-sexpObject sexpIterObject(sexpIter iter)
-{
- if (iter == NULL) return NULL;
- return ((sexpList)iter)->first;
-}
-
-/****************************/
-/* SEXP OBJECT MANIPULATION */
-/****************************/
-
-int isObjectString(sexpObject object)
-{
- if (((sexpString)object)->type == SEXP_STRING) return TRUE;
- else return FALSE;
-}
-
-int isObjectList(sexpObject object)
-{
- if (((sexpList)object)->type == SEXP_LIST) return TRUE;
- else return FALSE;
-}
diff --git a/rpmio/sexp/sexp-input.c b/rpmio/sexp/sexp-input.c
deleted file mode 100644
index 14ee37e05..000000000
--- a/rpmio/sexp/sexp-input.c
+++ /dev/null
@@ -1,597 +0,0 @@
-/* SEXP implementation code sexp-input.c
- * Ron Rivest
- * 7/21/1997
- */
-
-#include <stdio.h>
-#include <malloc.h>
-#include "sexp.h"
-
-/*@access sexpInputStream @*/
-struct sexpInputStream_s {
- int nextChar; /* character currently being scanned */
- int byteSize; /* 4 or 6 or 8 == currently scanning mode */
- int bits; /* Bits waiting to be used */
- int nBits; /* number of such bits waiting to be used */
- void (*getChar)();
- int count; /* number of 8-bit characters output by getChar */
-/*@shared@*/ /*@relnull@*/
- FILE *inputFile; /* where to get input, if not stdin */
-};
-
-/*@access sexpList @*/
-/*@access sexpString @*/
-/*@access sexpObject @*/
-
-/**************************************/
-/* CHARACTER ROUTINES AND DEFINITIONS */
-/**************************************/
-
-/*@unchecked@*/
-static char upper[256]; /* upper[c] is upper case version of c */
-/*@unchecked@*/
-static char whitespace[256]; /* whitespace[c] is nonzero if c is whitespace */
-/*@unchecked@*/
-static char decdigit[256]; /* decdigit[c] is nonzero if c is a dec digit */
-/*@unchecked@*/
-static char decvalue[256]; /* decvalue[c] is value of c as dec digit */
-/*@unchecked@*/
-static char hexdigit[256]; /* hexdigit[c] is nonzero if c is a hex digit */
-/*@unchecked@*/
-static char hexvalue[256]; /* hexvalue[c] is value of c as a hex digit */
-/*@unchecked@*/
-static char base64digit[256];/* base64char[c] is nonzero if c is base64 digit */
-/*@unchecked@*/
-static char base64value[256];/* base64value[c] is value of c as base64 digit */
-/*@unchecked@*/
-static char tokenchar[256]; /* tokenchar[c] is true if c can be in a token */
-/*@unchecked@*/
-static char alpha[256]; /* alpha[c] is true if c is alphabetic A-Z a-z */
-
-/* initializeCharacterTables
- * initializes all of the above arrays
- */
-void initializeCharacterTables(void)
- /*@globals alpha, base64digit, base64value, decdigit, decvalue,
- hexdigit, hexvalue, tokenchar, upper, whitespace @*/
- /*@modifies alpha, base64digit, base64value, decdigit, decvalue,
- hexdigit, hexvalue, tokenchar, upper, whitespace @*/
-{
- int i;
-
- for (i=0; i<256; i++) upper[i] = i;
- for (i='a'; i<='z'; i++) upper[i] = i - 'a' + 'A';
- for (i=0; i<=255; i++)
- alpha[i] = decdigit[i] = whitespace[i] = base64digit[i] = FALSE;
- whitespace[' '] = whitespace['\n'] = whitespace['\t'] = TRUE;
- whitespace['\v'] = whitespace['\r'] = whitespace['\f'] = TRUE;
- for (i='0'; i<='9'; i++) {
- base64digit[i] = hexdigit[i] = decdigit[i] = TRUE;
- decvalue[i] = hexvalue[i] = i-'0';
- base64value[i] = (i-'0')+52;
- }
- for (i='a'; i<='f'; i++) {
- hexdigit[i] = hexdigit[(int)upper[i]] = TRUE;
- hexvalue[i] = hexvalue[(int)upper[i]] = i-'a'+10;
- }
- for (i='a'; i<='z'; i++) {
- base64digit[i] = base64digit[(int)upper[i]] = TRUE;
- alpha[i] = alpha[(int)upper[i]] = TRUE;
- base64value[i] = i-'a'+26;
- base64value[(int)upper[i]] = i-'a';
- }
- base64digit['+'] = base64digit['/'] = TRUE;
- base64value['+'] = 62;
- base64value['/'] = 63;
- base64value['='] = 0;
- for (i=0; i<255; i++) tokenchar[i] = FALSE;
- for (i='a'; i<='z'; i++) tokenchar[i] = tokenchar[(int)upper[i]] = TRUE;
- for (i='0'; i<='9'; i++) tokenchar[i] = TRUE;
- tokenchar['-'] = TRUE;
- tokenchar['.'] = TRUE;
- tokenchar['/'] = TRUE;
- tokenchar['_'] = TRUE;
- tokenchar[':'] = TRUE;
- tokenchar['*'] = TRUE;
- tokenchar['+'] = TRUE;
- tokenchar['='] = TRUE;
-}
-
-/* isWhiteSpace(c)
- * Returns TRUE if c is a whitespace character (space, tab, etc. ).
- */
-int isWhiteSpace(int c)
-{
- return ((c>=0 && c<=255) && whitespace[c]);
-}
-
-/* isDecDigit(c)
- * Returns TRUE if c is a decimal digit.
- */
-int isDecDigit(int c)
-{
- return ((c>=0 && c<=255) && decdigit[c]);
-}
-
-/* isHexDigit(c)
- * Returns TRUE if c is a hexadecimal digit.
- */
-int isHexDigit(int c)
-{
- return ((c>=0 && c<=255) && hexdigit[c]);
-}
-
-/* isBase64Digit(c)
- * returns TRUE if c is a base64 digit A-Z,a-Z,0-9,+,/
- */
-int isBase64Digit(int c)
-{
- return ((c>=0 && c<=255) && base64digit[c]);
-}
-
-/* isTokenChar(c)
- * Returns TRUE if c is allowed in a token
- */
-int isTokenChar(int c)
-{
- return ((c>=0 && c<=255) && tokenchar[c]);
-}
-
-/* isAlpha(c)
- * Returns TRUE if c is alphabetic
- */
-int isAlpha(int c)
-{
- return ((c>=0 && c<=255) && alpha[c]);
-}
-
-/**********************/
-/* SEXP INPUT STREAMS */
-/**********************/
-
-/* changeInputByteSize(is,newByteSize)
- */
-void changeInputByteSize(sexpInputStream is, int newByteSize)
-{
- is->byteSize = newByteSize;
- is->nBits = 0;
- is->bits = 0;
-}
-
-/* getChar(is)
- * This is one possible character input routine for an input stream.
- * (This version uses the standard input stream.)
- * getChar places next 8-bit character into is->nextChar.
- * It also updates the count of number of 8-bit characters read.
- * The value EOF is obtained when no more input is available.
- * This code handles 4-bit/6-bit/8-bit channels.
- */
-void getChar(sexpInputStream is)
-{
- int c;
-
- if (is->nextChar == EOF) {
- is->byteSize = 8;
- return;
- }
-
- while (TRUE) {
- c = is->nextChar = fgetc(is->inputFile);
- if (c == EOF) return;
- if ((is->byteSize == 6 && (c == '|' || c == '}'))
- || (is->byteSize == 4 && (c == '#')))
- {
- /* end of region reached; return terminating character, after
- checking for unused bits */
- if (is->nBits>0 && (((1<<is->nBits)-1) & is->bits) != 0)
- ErrorMessage(WARNING,
- "%d-bit region ended with %d unused bits left-over",
- is->byteSize, is->nBits);
- changeInputByteSize(is, 8);
- return;
- }
- else if (is->byteSize != 8 && isWhiteSpace(c))
- {} /* ignore white space in hex and base64 regions */
- else if (is->byteSize == 6 && c == '=')
- {} /* ignore equals signs in base64 regions */
- else if (is->byteSize==8) {
- is->count++;
- return;
- }
- else if (is->byteSize<8) {
- is->bits = is->bits << is->byteSize;
- is->nBits += is->byteSize;
- if (is->byteSize == 6 && isBase64Digit(c))
- is->bits = is->bits | base64value[c];
- else if (is->byteSize == 4 && isHexDigit(c))
- is->bits = is->bits | hexvalue[c];
- else
- ErrorMessage(ERROR, "character %c found in %d-bit coding region",
- (int) is->nextChar, is->byteSize);
- if (is->nBits >= 8) {
- is->nextChar = (is->bits >> (is->nBits-8)) & 0xFF;
- is->nBits -= 8;
- is->count++;
- return;
- }
- }
- }
-}
-
-void sexpIFgetc(sexpInputStream is)
-{
- is->getChar(is);
-}
-
-int sexpIFpeek(sexpInputStream is)
-{
- return is->nextChar;
-}
-
-int sexpIFeof(sexpInputStream is)
-{
- return (is->nextChar == EOF ? 1 : 0);
-}
-
-void sexpIFpoke(sexpInputStream is, int c)
-{
- is->nextChar = c;
-}
-
-/* newSexpInputStream()
- * Creates and initializes a new sexpInputStream object.
- * (Prefixes stream with one blank, and initializes stream
- * so that it reads from standard input.)
- */
-sexpInputStream sexpIFopen(const char * ifn, const char * fmode)
-{
- sexpInputStream is = sexpAlloc(sizeof(*is));
-
- is->nextChar = ' ';
- is->getChar = getChar;
- is->count = -1;
- is->byteSize = 8;
- is->bits = 0;
- is->nBits = 0;
-
- if (ifn == NULL) {
-/*@-assignexpose@*/
- is->inputFile = stdin;
-/*@=assignexpose@*/
- } else {
- is->inputFile = fopen(ifn, fmode);
- if (is->inputFile == NULL)
- ErrorMessage(ERROR, "Can't open input file %s.", ifn);
- }
- return is;
-}
-
-/*****************************************/
-/* INPUT (SCANNING AND PARSING) ROUTINES */
-/*****************************************/
-
-/* skipWhiteSpace(is)
- * Skip over any white space on the given sexpInputStream.
- */
-void skipWhiteSpace(sexpInputStream is)
-{
- while (isWhiteSpace(is->nextChar)) is->getChar(is);
-}
-
-/* skipChar(is,c)
- * Skip the following input character on input stream is, if it is
- * equal to the character c. If it is not equal, then an error occurs.
- */
-void skipChar(sexpInputStream is, int c)
-{
- if (is->nextChar == c)
- is->getChar(is);
- else
- ErrorMessage(ERROR, "character 0x%x found where '%c' was expected",
- (unsigned) is->nextChar,
- (unsigned) c);
-}
-
-/* scanToken(is,ss)
- * scan one or more characters into simple string ss as a token.
- */
-void scanToken(sexpInputStream is, sexpSimpleString ss)
-{
- skipWhiteSpace(is);
- while (isTokenChar(is->nextChar)) {
- appendCharToSimpleString(is->nextChar, ss);
- is->getChar(is);
- }
- return;
-}
-
-/* scanToEOF(is)
- * scan one or more characters (until EOF reached)
- * return an object that is just that string
- */
-sexpObject scanToEOF(sexpInputStream is)
-{
- sexpSimpleString ss = newSimpleString();
- sexpString s = newSexpString();
-
- setSexpStringString(s,ss);
- skipWhiteSpace(is);
- while (is->nextChar != EOF) {
- appendCharToSimpleString(is->nextChar, ss);
- is->getChar(is);
- }
- return (sexpObject)s;
-}
-
-/* scanDecimal(is)
- * returns long integer that is value of decimal number
- */
-unsigned long int scanDecimal(sexpInputStream is)
-{
- unsigned long int value = 0L;
- int i = 0;
-
- while (isDecDigit(is->nextChar)) {
- value = value*10 + decvalue[is->nextChar];
- is->getChar(is);
- if (i++ > 8)
- ErrorMessage(ERROR,"Decimal number %d... too long.",(int)value);
- }
- return value;
-}
-
-/* scanVerbatimString(is,ss,length)
- * Reads verbatim string of given length into simple string ss.
- */
-void scanVerbatimString(sexpInputStream is, sexpSimpleString ss, long int length)
-{
- long int i = 0L;
-
- skipWhiteSpace(is);
- skipChar(is,':');
- if (length == -1L) /* no length was specified */
- ErrorMessage(ERROR,"Verbatim string had no declared length.");
- for (i=0; i<length; i++) {
- appendCharToSimpleString(is->nextChar, ss);
- is->getChar(is);
- }
- return;
-}
-
-/* scanQuotedString(is,ss,length)
- * Reads quoted string of given length into simple string ss.
- * Handles ordinary C escapes.
- * If of indefinite length, length is -1.
- */
-void scanQuotedString(sexpInputStream is, sexpSimpleString ss, long int length)
-{
- int c;
- skipChar(is,'"');
- while (length == -1L || simpleStringLength(ss) <= length) {
- if (is->nextChar == '\"') {
- if (length == -1L || simpleStringLength(ss) == length) {
- skipChar(is,'\"');
- return;
- }
- else
- ErrorMessage(ERROR,"Quoted string ended too early. Declared length was %d",(int)length);
- }
- else if (is->nextChar == '\\') { /* handle escape sequence */
- is->getChar(is);
- c = is->nextChar;
- if (c == 'b') appendCharToSimpleString('\b', ss);
- else if (c == 't') appendCharToSimpleString('\t', ss);
- else if (c == 'v') appendCharToSimpleString('\v', ss);
- else if (c == 'n') appendCharToSimpleString('\n', ss);
- else if (c == 'f') appendCharToSimpleString('\f', ss);
- else if (c == 'r') appendCharToSimpleString('\r', ss);
- else if (c == '\"') appendCharToSimpleString('\"', ss);
- else if (c == '\'') appendCharToSimpleString('\'', ss);
- else if (c == '\\') appendCharToSimpleString('\\', ss);
- else if (c >= '0' && c <= '7') { /* octal number */
- int val = 0;
- int j;
-
- for (j=0; j<3; j++) {
- if (c >= '0' && c <= '7') {
- val = ((val << 3) | (c - '0'));
- if (j<2) { is->getChar(is); c = is->nextChar; }
- } else
- ErrorMessage(ERROR,"Octal character \\%o... too short.",
- val);
- }
- if (val > 255)
- ErrorMessage(ERROR,"Octal character \\%o... too big.",
- val);
- appendCharToSimpleString(val, ss);
- }
- else if (c == 'x') { /* hexadecimal number */
- int val = 0;
- int j;
-
- is->getChar(is);
- c = is->nextChar;
- for (j=0; j<2; j++) {
- if (isHexDigit(c)) {
- val = ((val << 4) | hexvalue[c]);
- if (j<1) { is->getChar(is); c = is->nextChar; }
- }
- else
- ErrorMessage(ERROR,"Hex character \\x%x... too short.",
- val);
- }
- appendCharToSimpleString(val, ss);
- }
- else if (c == '\n') { /* ignore backslash line feed */
- /* also ignore following carriage-return if present */
- is->getChar(is);
- if (is->nextChar != '\r') goto gotnextchar;
- }
- else if (c == '\r') { /* ignore backslash carriage-return */
- /* also ignore following linefeed if present */
- is->getChar(is);
- if (is->nextChar != '\n') goto gotnextchar;
- }
- else
- ErrorMessage(WARNING,"Escape character \\%c... unknown.", c);
- } /* end of handling escape sequence */
- else
- appendCharToSimpleString(is->nextChar, ss);
- is->getChar(is);
- gotnextchar: ;
- } /* end of main while loop */
- return;
-}
-
-/* scanHexString(is,ss,length)
- * Reads hexadecimal string into simple string ss.
- * String is of given length result, or length = -1 if indefinite length.
- */
-void scanHexString(sexpInputStream is, sexpSimpleString ss, long int length)
-{
- changeInputByteSize(is, 4);
- skipChar(is, '#');
- while (is->nextChar != EOF && (is->nextChar != '#' || is->byteSize==4)) {
- appendCharToSimpleString(is->nextChar, ss);
- is->getChar(is);
- }
- skipChar(is,'#');
- if (simpleStringLength(ss) != length && length >= 0)
- ErrorMessage(WARNING,
- "Hex string has length %u different than declared length %u",
- (unsigned)simpleStringLength(ss),
- (unsigned)length);
-}
-
-/* scanBase64String(is,ss,length)
- * Reads base64 string into simple string ss.
- * String is of given length result, or length = -1 if indefinite length.
- */
-void scanBase64String(sexpInputStream is, sexpSimpleString ss, long int length)
-{
- changeInputByteSize(is, 6);
- skipChar(is, '|');
- while (is->nextChar != EOF && (is->nextChar != '|' || is->byteSize == 6)) {
- appendCharToSimpleString(is->nextChar, ss);
- is->getChar(is);
- }
- skipChar(is,'|');
- if (simpleStringLength(ss) != length && length >= 0)
- ErrorMessage(WARNING,
- "Base64 string has length %u different than declared length %u",
- (unsigned)simpleStringLength(ss),
- (unsigned)length);
-}
-
-/* scanSimpleString(is)
- * Reads and returns a simple string from the input stream.
- * Determines type of simple string from the initial character, and
- * dispatches to appropriate routine based on that.
- */
-sexpSimpleString scanSimpleString(sexpInputStream is)
-{
- sexpSimpleString ss = newSimpleString();
- long int length;
-
- skipWhiteSpace(is);
- /* Note that it is important in the following code to test for token-ness
- * before checking the other cases, so that a token may begin with ":",
- * which would otherwise be treated as a verbatim string missing a length.
- */
- if (isTokenChar(is->nextChar) && !isDecDigit(is->nextChar))
- scanToken(is,ss);
- else if (isDecDigit(is->nextChar)
- || is->nextChar == '\"'
- || is->nextChar == '#'
- || is->nextChar == '|'
- || is->nextChar == ':')
- { if (isDecDigit(is->nextChar)) length = scanDecimal(is);
- else length = -1L;
- if (is->nextChar == '\"') scanQuotedString(is, ss, length);
- else if (is->nextChar == '#') scanHexString(is, ss, length);
- else if (is->nextChar == '|') scanBase64String(is, ss, length);
- else if (is->nextChar == ':') scanVerbatimString(is, ss, length);
- }
- else
- ErrorMessage(ERROR,"illegal character at position %d: %d (decimal)",
- is->count, is->nextChar );
- if (simpleStringLength(ss) == 0)
- ErrorMessage(WARNING,"Simple string has zero length.");
- return ss;
-}
-
-/* scanString(is)
- * Reads and returns a string [presentationhint]string from input stream.
- */
-sexpString scanString(sexpInputStream is)
-{
- sexpString s = newSexpString();
- sexpSimpleString ss;
-
- if (is->nextChar == '[') {
- /* scan presentation hint */
- skipChar(is,'[');
- ss = scanSimpleString(is);
- setSexpStringPresentationHint(s, ss);
- skipWhiteSpace(is);
- skipChar(is, ']');
- skipWhiteSpace(is);
- }
- ss = scanSimpleString(is);
- setSexpStringString(s, ss);
- closeSexpString(s);
- return s;
-}
-
-/* scanList(is)
- * Read and return a sexpList from the input stream.
- */
-sexpList scanList(sexpInputStream is)
-{
- sexpList list = newSexpList();
- sexpObject object;
-
- skipChar(is, '(');
- skipWhiteSpace(is);
- if (is->nextChar == ')') {
- /* ErrorMessage(ERROR,"List () with no contents is illegal."); */
- ; /* OK */
- } else {
- object = scanObject(is);
- sexpAddSexpListObject(list, object);
- }
- while (TRUE) {
- skipWhiteSpace(is);
- if (is->nextChar == ')') { /* we just grabbed last element of list */
- skipChar(is,')');
- closeSexpList(list);
- return list;
- } else {
- object = scanObject(is);
- sexpAddSexpListObject(list, object);
- }
- }
-}
-
-/* scanObject(is)
- * Reads and returns a sexpObject from the given input stream.
- */
-sexpObject scanObject(sexpInputStream is)
-{
- sexpObject object;
-
- skipWhiteSpace(is);
- if (is->nextChar == '{') {
- changeInputByteSize(is, 6); /* order of this statement and next is */
- skipChar(is,'{'); /* important! */
- object = scanObject(is);
- skipChar(is,'}');
- return object;
- } else {
- if (is->nextChar == '(')
- object = (sexpObject)scanList(is);
- else
- object = (sexpObject)scanString(is);
- return object;
- }
-}
diff --git a/rpmio/sexp/sexp-main.c b/rpmio/sexp/sexp-main.c
deleted file mode 100644
index c7839e2dd..000000000
--- a/rpmio/sexp/sexp-main.c
+++ /dev/null
@@ -1,195 +0,0 @@
-/* SEXP implementation code sexp-main.c
- * Ron Rivest
- * 6/29/1997
- */
-
-#include <stdio.h>
-#include <malloc.h>
-#include <stdlib.h>
-#include <popt.h>
-#include "sexp.h"
-
-/*@unchecked@*/ /*@observer@*/
-static const char *help =
-"The program `sexp' reads, parses, and prints out S-expressions.\n"
-" INPUT:\n"
-" Input is normally taken from stdin, but this can be changed:\n"
-" -i filename -- takes input from file instead.\n"
-" -p -- prompts user for console input\n"
-" Input is normally parsed, but this can be changed:\n"
-" -s -- treat input up to EOF as a single string\n"
-" CONTROL LOOP:\n"
-" The main routine typically reads one S-expression, prints it out again, \n"
-" and stops. This may be modified:\n"
-" -x -- execute main loop repeatedly until EOF\n"
-" OUTPUT:\n"
-" Output is normally written to stdout, but this can be changed:\n"
-" -o filename -- write output to file instead\n"
-" The output format is normally canonical, but this can be changed:\n"
-" -a -- write output in advanced transport format\n"
-" -b -- write output in base-64 output format\n"
-" -c -- write output in canonical format\n"
-" -l -- suppress linefeeds after output\n"
-" More than one output format can be requested at once.\n"
-" There is normally a line-width of 75 on output, but:\n"
-" -w width -- changes line width to specified width.\n"
-" (0 implies no line-width constraint)\n"
-" The default switches are: -p -a -b -c -x\n"
-" Typical usage: cat certificate-file | sexp -a -x \n";
-
-/*@unchecked@*/
-static int _debug = 0;
-/*@unchecked@*/ /*@null@*/
-static const char * ifn = NULL;
-/*@unchecked@*/ /*@null@*/
-static const char * ofn = NULL;
-/*@unchecked@*/
-static int swa = TRUE;
-/*@unchecked@*/
-static int swb = TRUE;
-/*@unchecked@*/
-static int swc = TRUE;
-/*@unchecked@*/
-static int swl = FALSE;
-/*@unchecked@*/
-static int swp = TRUE;
-/*@unchecked@*/
-static int sws = FALSE;
-/*@unchecked@*/
-static int swx = TRUE;
-/*@unchecked@*/
-static int width = -1;
-
-static struct poptOption optionsTable[] = {
- { "debug", 'd', POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, &_debug, -1,
- NULL, NULL },
-
- { "advanced", 'a', POPT_ARG_VAL, &swa, TRUE,
- "advanced transport format", NULL },
- { "base64", 'b', POPT_ARG_VAL, &swb, TRUE,
- "base64 format", NULL },
- { "canonical", 'c', POPT_ARG_VAL, &swc, TRUE,
- "canonical format", NULL },
- { "input", 'i', POPT_ARG_STRING, &ifn, 0,
- "read input from FILE", "FILE" },
- { "nolf", 'l', POPT_ARG_VAL, &swl, TRUE,
- "suppress linefeeds", NULL },
- { "output", 'o', POPT_ARG_STRING, &ofn, 0,
- "write output to FILE", "FILE" },
- { "prompt", 'p', POPT_ARG_VAL, &swp, TRUE,
- "prompt for input", NULL },
- { "single", 's', POPT_ARG_VAL, &sws, TRUE,
- "single string input", NULL },
- { "execute", 'x', POPT_ARG_VAL, &swx, TRUE,
- "execute loop until EOF", NULL },
- { "width", 'w', POPT_ARG_INT, &width, 0,
- "output line WIDTH", "WIDTH" },
-
- POPT_AUTOHELP
- POPT_TABLEEND
-};
-
-/*************************************************************************/
-/* main(argc,argv)
- */
-/*@=nullstate@*/
-int main(int argc, char **argv)
- /*@globals optionsTable, ifn, ofn, swa, swb, swc, swl, swp, sws, swx,
- width, fileSystem, internalState @*/
- /*@modifies swa, swb, swc, swl, swp, sws, swx,
- fileSystem, internalState @*/
-{
- poptContext optCon;
- int rc;
- sexpObject object;
- sexpInputStream is;
- sexpOutputStream os;
-
- initializeCharacterTables();
- initializeMemory();
-
- /* process switches */
- if (argc>1)
- swa = swb = swc = swp = sws = swx = swl = FALSE;
-
- optCon = poptGetContext(argv[0], argc, (const char **)argv, optionsTable, 0);
- while ((rc = poptGetNextOpt(optCon)) > 0) {
- switch (rc) {
- default:
- fprintf(stderr, "%s: option table misconfigured (%d)\n",
- argv[0], rc);
- goto exit;
- /*@notreached@*/ /*@switchbreak@*/ break;
- }
- }
-
- if (rc < -1) {
- fprintf(stderr, "%s", help); (void) fflush(stderr);
- goto exit;
- }
-
- is = sexpIFopen(ifn, "r");
-
- os = sexpOFopen(ofn, "w");
- sexpOFwidth(os, width);
-
- if (swa == FALSE && swb == FALSE && swc == FALSE)
- swc = TRUE; /* must have some output format! */
-
- /* main loop */
- if (swp == 0) sexpIFgetc(is);
- else sexpIFpoke(is, -2); /* this is not EOF */
-
- while (!sexpIFeof(is)) {
- if (swp) { fprintf(stdout, "Input:\n"); (void) fflush(stdout); }
-
- changeInputByteSize(is, 8);
- if (sexpIFpeek(is) == -2) sexpIFgetc(is);
-
- skipWhiteSpace(is);
- if (sexpIFeof(is)) break;
-
- if (sws == FALSE)
- object = scanObject(is);
- else
- object = scanToEOF(is);
-
- if (swc) {
- if (swp) {
- fprintf(stdout, "Canonical output:"); (void) fflush(stdout);
- sexpOFnewLine(os, ADVANCED);
- }
- canonicalPrintObject(os, object);
- if (!swl) { fprintf(stdout, "\n"); (void) fflush(stdout); }
- }
-
- if (swb) {
- if (swp) {
- fprintf(stdout, "Base64 (of canonical) output:"); (void) fflush(stdout);
- sexpOFnewLine(os, ADVANCED);
- }
- base64PrintWholeObject(os, object);
- if (!swl) { fprintf(stdout, "\n"); (void) fflush(stdout); }
- }
-
- if (swa) {
- if (swp) {
- fprintf(stdout, "Advanced transport output:"); (void) fflush(stdout);
- sexpOFnewLine(os, ADVANCED);
- }
- advancedPrintObject(os,object);
- if (!swl) { fprintf(stdout, "\n"); (void) fflush(stdout); }
- }
-
- if (!swx) break;
- if (!swp) skipWhiteSpace(is);
- else if (!swl) { fprintf(stdout, "\n"); (void) fflush(stdout); }
- }
- rc = 0;
-
-exit:
- optCon = poptFreeContext(optCon);
-
- return rc;
-}
-/*@=nullstate@*/
diff --git a/rpmio/sexp/sexp-output.c b/rpmio/sexp/sexp-output.c
deleted file mode 100644
index cf2b23522..000000000
--- a/rpmio/sexp/sexp-output.c
+++ /dev/null
@@ -1,642 +0,0 @@
-/* SEXP implementation code sexp-output.c
- * Ron Rivest
- * 5/5/1997
- */
-
-#include <stdio.h>
-#include <malloc.h>
-#include "sexp.h"
-
-/*@access sexpOutputStream @*/
-/*@access sexpSimpleString @*/
-
-/*@access sexpList @*/
-/*@access sexpString @*/
-/*@access sexpObject @*/
-
-struct sexpOutputStream_s {
- long int column; /* column where next character will go */
- long int maxcolumn; /* max usable column, or -1 if no maximum */
- long int indent; /* current indentation level (starts at 0) */
- void (*putChar)(); /* output a character */
- void (*newLine)(); /* go to next line (and indent) */
- int byteSize; /* 4 or 6 or 8 depending on output mode */
- int bits; /* bits waiting to go out */
- int nBits; /* number of bits waiting to go out */
- long int base64Count; /* number of hex or base64 chars printed
- this region */
- int mode; /* ADVANCED, BASE64, or CANONICAL */
-/*@shared@*/ /*@relnull@*/
- FILE *outputFile; /* where to put output, if not stdout */
-};
-
-/*@unchecked@*/ /*@observer@*/
-static char *hexDigits = "0123456789ABCDEF";
-
-/*@unchecked@*/ /*@observer@*/
-static char *base64Digits =
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
-
-/***********************/
-/* SEXP Output Streams */
-/***********************/
-
-/* putChar(os,c)
- * Puts the character c out on the output stream os.
- * Keeps track of the "column" the next output char will go to.
- */
-void putChar(sexpOutputStream os, int c)
-{
- (void) putc(c,os->outputFile);
- os->column++;
-}
-
-/* varPutChar(os,c)
- * putChar with variable sized output bytes considered.
- */
-void varPutChar(sexpOutputStream os, int c)
-{
- c &= 0xFF;
- os->bits = (os->bits << 8) | c;
- os->nBits += 8;
- while (os->nBits >= os->byteSize) {
- if ((os->byteSize==6 || os->byteSize==4
- || c == '}' || c == '{' || c == '#' || c == '|')
- && os->maxcolumn > 0
- && os->column >= os->maxcolumn)
- os->newLine(os,os->mode);
- if (os->byteSize == 4)
- os->putChar(os,
- hexDigits[(os->bits >> (os->nBits-4)) & 0x0F]);
- else if (os->byteSize == 6)
- os->putChar(os,
- base64Digits[(os->bits >> (os->nBits-6)) & 0x3F]);
- else if (os->byteSize == 8)
- os->putChar(os,os->bits & 0xFF);
- os->nBits -= os->byteSize;
- os->base64Count++;
- }
-}
-
-/* changeOutputByteSize(os,newByteSize,mode)
- * Change os->byteSize to newByteSize
- * record mode in output stream for automatic line breaks
- */
-void changeOutputByteSize(sexpOutputStream os, int newByteSize, int mode)
-{
- if (newByteSize != 4 && newByteSize !=6 && newByteSize !=8)
- ErrorMessage(ERROR,"Illegal output base %d.",newByteSize);
- if (newByteSize !=8 && os->byteSize != 8)
- ErrorMessage(ERROR,"Illegal change of output byte size from %d to %d.",
- os->byteSize, newByteSize);
- os->byteSize = newByteSize;
- os->nBits = 0;
- os->bits = 0;
- os->base64Count = 0;
- os->mode = mode;
-}
-
-/* flushOutput(os)
- * flush out any remaining bits
- */
-void flushOutput(sexpOutputStream os)
-{ if (os->nBits > 0)
- {
- if (os->byteSize == 4)
- os->putChar(os,hexDigits[(os->bits << (4 - os->nBits)) & 0x0F]);
- else if (os->byteSize == 6)
- os->putChar(os,base64Digits[(os->bits << (6 - os->nBits)) & 0x3F]);
- else if (os->byteSize == 8)
- os->putChar(os,os->bits & 0xFF);
- os->nBits = 0;
- os->base64Count++;
- }
- if (os->byteSize == 6) /* and add switch here */
- while ((os->base64Count & 3) != 0)
- { if (os->maxcolumn > 0 && os->column >= os->maxcolumn)
- os->newLine(os,os->mode);
- os->putChar(os,'=');
- os->base64Count++;
- }
-}
-
-/* newLine(os,mode)
- * Outputs a newline symbol to the output stream os.
- * For ADVANCED mode, also outputs indentation as one blank per
- * indentation level (but never indents more than half of maxcolumn).
- * Resets column for next output character.
- */
-void newLine(sexpOutputStream os, int mode)
-{
- if (mode == ADVANCED || mode == BASE64) {
- os->putChar(os, '\n');
- os->column = 0;
- }
- if (mode == ADVANCED) {
- int i;
- for (i=0; i<os->indent && (4*i)<os->maxcolumn; i++)
- os->putChar(os, ' ');
- }
-}
-
-void sexpOFnewLine(sexpOutputStream os, int mode)
-{
- os->newLine(os, mode);
-}
-
-void sexpOFwidth(sexpOutputStream os, int width)
-{
- if (width >= 0)
- os->maxcolumn = width;
-}
-
-/* sexpOFopen()
- * Creates and initializes new sexpOutputStream object.
- */
-sexpOutputStream sexpOFopen(const char * ofn, const char * fmode)
-{
- sexpOutputStream os;
- os = (sexpOutputStream) sexpAlloc(sizeof(*os));
- os->column = 0;
- os->maxcolumn = DEFAULTLINELENGTH;
- os->indent = 0;
- os->putChar = putChar;
- os->newLine = newLine;
- os->byteSize = 8;
- os->bits = 0;
- os->nBits = 0;
- os->mode = CANONICAL;
-
- if (ofn == NULL) {
-/*@-assignexpose@*/
- os->outputFile = stdout;
-/*@=assignexpose@*/
- } else {
- os->outputFile = fopen(ofn, fmode);
- if (os->outputFile == NULL)
- ErrorMessage(ERROR, "Can't open output file %s.", ofn);
- }
- return os;
-}
-
-/*******************/
-/* OUTPUT ROUTINES */
-/*******************/
-
-/* printDecimal(os,n)
- * print out n in decimal to output stream os
- */
-void printDecimal(sexpOutputStream os, long int n)
-{
- char buffer[50];
- int i;
-
-/*@-bufferoverflowhigh@*/
- sprintf(buffer, "%ld", n);
-/*@=bufferoverflowhigh@*/
- for (i=0; buffer[i]!=0; i++)
- varPutChar(os, buffer[i]);
-}
-
-/********************/
-/* CANONICAL OUTPUT */
-/********************/
-
-/* canonicalPrintVerbatimSimpleString(os,ss)
- * Print out simple string ss on output stream os as verbatim string.
- */
-void canonicalPrintVerbatimSimpleString(sexpOutputStream os, sexpSimpleString ss)
-{
- octet * c = simpleStringString(ss);
- size_t len = simpleStringLength(ss);
- size_t i;
-
- if (c == NULL)
- ErrorMessage(ERROR, "Can't print NULL string verbatim");
- /* print out len: */
- printDecimal(os, (long int)len);
- varPutChar(os, ':');
- /* print characters in fragment */
- for (i=0; i<len; i++) varPutChar(os, (int)*c++);
-}
-
-/* canonicalPrintString(os,s)
- * Prints out sexp string s onto output stream os
- */
-void canonicalPrintString(sexpOutputStream os, sexpString s)
-{
- sexpSimpleString ph = sexpStringPresentationHint(s);
- sexpSimpleString ss;
-
- if (ph != NULL) {
- varPutChar(os, '[');
- canonicalPrintVerbatimSimpleString(os,ph);
- varPutChar(os, ']');
- }
- ss = sexpStringString(s);
- if (ss == NULL)
- ErrorMessage(ERROR,"NULL string can't be printed.");
- else
- canonicalPrintVerbatimSimpleString(os, ss);
-}
-
-/* canonicalPrintList(os,list)
- * Prints out the list "list" onto output stream os
- */
-void canonicalPrintList(sexpOutputStream os, sexpList list)
-{
- sexpIter iter = sexpListIter(list);
- sexpObject object;
- varPutChar(os, '(');
- while (iter != NULL) {
- object = sexpIterObject(iter);
- if (object != NULL)
- canonicalPrintObject(os, object);
- iter = sexpIterNext(iter);
- }
- varPutChar(os, ')');
-}
-
-/* canonicalPrintObject(os,object)
- * Prints out object on output stream os
- * Note that this uses the common "type" field of lists and strings.
- */
-void canonicalPrintObject(sexpOutputStream os, sexpObject object)
-{
- if (isObjectString(object))
- canonicalPrintString(os, (sexpString)object);
- else if (isObjectList(object))
- canonicalPrintList(os, (sexpList)object);
- else ErrorMessage(ERROR,"NULL object can't be printed.");
-}
-
-/* *************/
-/* BASE64 MODE */
-/* *************/
-/* Same as canonical, except all characters get put out as base 64 ones */
-
-void base64PrintWholeObject(sexpOutputStream os, sexpObject object)
-{
- changeOutputByteSize(os, 8, BASE64);
- varPutChar(os,'{');
- changeOutputByteSize(os, 6, BASE64);
- canonicalPrintObject(os, object);
- flushOutput(os);
- changeOutputByteSize(os, 8, BASE64);
- varPutChar(os,'}');
-}
-
-/*****************/
-/* ADVANCED MODE */
-/*****************/
-
-/* TOKEN */
-
-/* canPrintAsToken(ss)
- * Returns TRUE if simple string ss can be printed as a token.
- * Doesn't begin with a digit, and all characters are tokenchars.
- */
-int canPrintAsToken(sexpOutputStream os, sexpSimpleString ss)
-{
- octet * c = simpleStringString(ss);
- size_t len = simpleStringLength(ss);
- size_t i;
-
- if (c == NULL) return FALSE;
-/*@-unsignedcompare@*/ /* XXX len now unsigned size_t. */
- if (len <= 0) return FALSE;
-/*@=unsignedcompare@*/
- if (isDecDigit((int)*c)) return FALSE;
- if (os->maxcolumn > 0 && os->column + len >= os->maxcolumn)
- return FALSE;
- for (i=0; i<len; i++)
- if (!isTokenChar((int)(*c++))) return FALSE;
- return TRUE;
-}
-
-/* advancedPrintTokenSimpleString(os,ss)
- * Prints out simple string ss as a token (assumes that this is OK).
- * May run over max-column, but there is no fragmentation allowed...
- */
-void advancedPrintTokenSimpleString(sexpOutputStream os, sexpSimpleString ss)
-{
- octet * c = simpleStringString(ss);
- size_t len = simpleStringLength(ss);
- size_t i;
-
- if (os->maxcolumn>0 && os->column > (os->maxcolumn - len))
- os->newLine(os, ADVANCED);
- for (i=0; i<len; i++)
- os->putChar(os, (int)(*c++));
-}
-
-/* advancedLengthSimpleStringToken(ss)
- * Returns length for printing simple string ss as a token
- */
-size_t advancedLengthSimpleStringToken(sexpSimpleString ss)
-{
- return simpleStringLength(ss);
-}
-
-
-/* VERBATIM */
-
-/* advancedPrintVerbatimSimpleString(os,ss)
- * Print out simple string ss on output stream os as verbatim string.
- * Again, can't fragment string, so max-column is just a suggestion...
- */
-void advancedPrintVerbatimSimpleString(sexpOutputStream os, sexpSimpleString ss)
-{
- octet * c = simpleStringString(ss);
- size_t len = simpleStringLength(ss);
- size_t i;
-
- if (c == NULL)
- ErrorMessage(ERROR, "Can't print NULL string verbatim");
- if (os->maxcolumn>0 && os->column > (os->maxcolumn - len))
- os->newLine(os, ADVANCED);
- printDecimal(os, (long int)len);
- os->putChar(os, ':');
- for (i=0; i<len; i++) os->putChar(os, (int)*c++);
-}
-
-/* advancedLengthSimpleStringVerbatim(ss)
- * Returns length for printing simple string ss in verbatim mode
- */
-size_t advancedLengthSimpleStringVerbatim(sexpSimpleString ss)
-{
- size_t len = simpleStringLength(ss);
- size_t i = 1;
- while (len > 9L) { i++; len = len / 10; }
- return (i+1+len);
-}
-
-/* BASE64 */
-
-/* advancedPrintBase64SimpleString(os,ss)
- * Prints out simple string ss as a base64 value.
- */
-void advancedPrintBase64SimpleString(sexpOutputStream os, sexpSimpleString ss)
-{
- octet * c = simpleStringString(ss);
- size_t len = simpleStringLength(ss);
- size_t i;
-
- if (c == NULL)
- ErrorMessage(ERROR, "Can't print NULL string base 64");
- varPutChar(os,'|');
- changeOutputByteSize(os, 6, ADVANCED);
- for (i=0; i<len; i++)
- varPutChar(os, (int)(*c++));
- flushOutput(os);
- changeOutputByteSize(os, 8, ADVANCED);
- varPutChar(os,'|');
-}
-
-/* HEXADECIMAL */
-
-/* advancedPrintHexSimpleString(os,ss)
- * Prints out simple string ss as a hexadecimal value.
- */
-void advancedPrintHexSimpleString(sexpOutputStream os, sexpSimpleString ss)
-{
- octet * c = simpleStringString(ss);
- size_t len = simpleStringLength(ss);
- size_t i;
-
- if (c == NULL)
- ErrorMessage(ERROR, "Can't print NULL string hexadecimal");
- os->putChar(os, '#');
- changeOutputByteSize(os, 4, ADVANCED);
- for (i=0; i<len; i++)
- varPutChar(os, (int)(*c++));
- flushOutput(os);
- changeOutputByteSize(os, 8, ADVANCED);
- os->putChar(os, '#');
-}
-
-/* advancedLengthSimpleStringHexadecimal(ss)
- * Returns length for printing simple string ss in hexadecimal mode
- */
-int advancedLengthSimpleStringHexadecimal(sexpSimpleString ss)
-{
- size_t len = simpleStringLength(ss);
-
- return (1+2*len+1);
-}
-
-/* QUOTED STRING */
-
-/* canPrintAsQuotedString(ss)
- * Returns TRUE if simple string ss can be printed as a quoted string.
- * Must have only tokenchars and blanks.
- */
-int canPrintAsQuotedString(sexpSimpleString ss)
-{
- octet * c = simpleStringString(ss);
- size_t len = simpleStringLength(ss);
- size_t i;
-
- if (c == NULL) return FALSE ;
-/*@-unsignedcompare@*/ /* XXX len now unsigned size_t. */
- if (len < 0) return FALSE;
-/*@=unsignedcompare@*/
- for (i=0; i<len; i++,c++) {
- if (!isTokenChar((int)(*c)) && *c != ' ')
- return FALSE;
- }
- return TRUE;
-}
-
-/* advancedPrintQuotedStringSimpleString(os,ss)
- * Prints out simple string ss as a quoted string
- * This code assumes that all characters are tokenchars and blanks,
- * so no escape sequences need to be generated.
- * May run over max-column, but there is no fragmentation allowed...
- */
-void advancedPrintQuotedStringSimpleString(sexpOutputStream os, sexpSimpleString ss)
-{
- octet * c = simpleStringString(ss);
- size_t len = simpleStringLength(ss);
- size_t i;
-
- os->putChar(os, '\"');
- for (i=0; i<len; i++) {
- if ( os->maxcolumn>0 && os->column >= os->maxcolumn-2 ) {
- os->putChar(os, '\\');
- os->putChar(os, '\n');
- os->column = 0;
- }
- os->putChar(os, *c++);
- }
- os->putChar(os, '\"');
-}
-
-/* advancedLengthSimpleStringQuotedString(ss)
- * Returns length for printing simple string ss in quoted-string mode
- */
-int advancedLengthSimpleStringQuotedString(sexpSimpleString ss)
-{
- size_t len = simpleStringLength(ss);
-
- return (1+len+1);
-}
-
-/* SIMPLE STRING */
-
-/* advancedPrintSimpleString(os,ss)
- * Prints out simple string ss onto output stream ss
- */
-void advancedPrintSimpleString(sexpOutputStream os, sexpSimpleString ss)
-{
- size_t len = simpleStringLength(ss);
-
- if (canPrintAsToken(os, ss))
- advancedPrintTokenSimpleString(os, ss);
- else if (canPrintAsQuotedString(ss))
- advancedPrintQuotedStringSimpleString(os, ss);
- else if (len <= 4 && os->byteSize == 8)
- advancedPrintHexSimpleString(os,ss);
- else if (os->byteSize == 8)
- advancedPrintBase64SimpleString(os, ss);
- else
- ErrorMessage(ERROR,"Can't print advanced mode with restricted output character set.");
-}
-
-/* advancedPrintString(os,s)
- * Prints out sexp string s onto output stream os
- */
-void advancedPrintString(sexpOutputStream os, sexpString s)
-{
- sexpSimpleString ph = sexpStringPresentationHint(s);
- sexpSimpleString ss = sexpStringString(s);
-
- if (ph != NULL) {
- os->putChar(os, '[');
- advancedPrintSimpleString(os, ph);
- os->putChar(os, ']');
- }
- if (ss == NULL)
- ErrorMessage(ERROR, "NULL string can't be printed.");
- else
- advancedPrintSimpleString(os, ss);
-}
-
-/* advancedLengthSimpleStringBase64(ss)
- * Returns length for printing simple string ss as a base64 string
- */
-int advancedLengthSimpleStringBase64(sexpSimpleString ss)
-{
- return (2+4*((simpleStringLength(ss)+2)/3));
-}
-
-/* advancedLengthSimpleString(os,ss)
- * Returns length of printed image of s
- */
-size_t advancedLengthSimpleString(sexpOutputStream os, sexpSimpleString ss)
-{
- size_t len = simpleStringLength(ss);
-
- if (canPrintAsToken(os,ss))
- return advancedLengthSimpleStringToken(ss);
- else if (canPrintAsQuotedString(ss))
- return advancedLengthSimpleStringQuotedString(ss);
- else if (len <= 4 && os->byteSize == 8)
- return advancedLengthSimpleStringHexadecimal(ss);
- else if (os->byteSize == 8)
- return advancedLengthSimpleStringBase64(ss);
- else
- return 0; /* an error condition */
-}
-
-/* advancedLengthString(os,s)
- * Returns length of printed image of string s
- */
-size_t advancedLengthString(sexpOutputStream os, sexpString s)
-{
- sexpSimpleString ph = sexpStringPresentationHint(s);
- sexpSimpleString ss = sexpStringString(s);
- size_t len = 0;
-
- if (ph != NULL)
- len += 2+advancedLengthSimpleString(os, ph);
- if (ss != NULL)
- len += advancedLengthSimpleString(os, ss);
- return len;
-}
-
-/* advancedLengthList(os,list)
- * Returns length of printed image of list given as iterator
- */
-size_t advancedLengthList(sexpOutputStream os, sexpList list)
-{
- sexpIter iter = sexpListIter(list);
- sexpObject object;
- size_t len = 1; /* for left paren */
-
- while (iter != NULL) {
- object = sexpIterObject(iter);
- if (object != NULL) {
- if (isObjectString(object))
- len += advancedLengthString(os, ((sexpString)object));
- /* else */
- if (isObjectList(object))
- len += advancedLengthList(os, ((sexpList)object));
- len++; /* for space after item */
- }
- iter = sexpIterNext(iter);
- }
- return len+1; /* for final paren */
-}
-
-/* advancedPrintList(os,list)
- * Prints out the list "list" onto output stream os.
- * Uses print-length to determine length of the image. If it all fits
- * on the current line, then it is printed that way. Otherwise, it is
- * written out in "vertical" mode, with items of the list starting in
- * the same column on successive lines.
- */
-void advancedPrintList(sexpOutputStream os, sexpList list)
-{
- int vertical = FALSE;
- int firstelement = TRUE;
- sexpIter iter;
- sexpObject object;
-
- os->putChar(os,'(');
- os->indent++;
- if (advancedLengthList(os,list) > os->maxcolumn - os->column)
- vertical = TRUE;
- iter = sexpListIter(list);
- while (iter != NULL) {
- object = sexpIterObject(iter);
- if (object != NULL) {
- if (!firstelement) {
- if (vertical) os->newLine(os,ADVANCED);
- else os->putChar(os,' ');
- }
- advancedPrintObject(os, object);
- }
- iter = sexpIterNext(iter);
- firstelement = FALSE;
- }
- if (os->maxcolumn>0 && os->column>os->maxcolumn-2)
- os->newLine(os, ADVANCED);
- os->indent--;
- os->putChar(os,')');
-}
-
-/* advancedPrintObject(os,object)
- * Prints out object on output stream os
- */
-void advancedPrintObject(sexpOutputStream os, sexpObject object)
-{
- if (os->maxcolumn>0 && os->column>os->maxcolumn-4)
- os->newLine(os, ADVANCED);
- if (isObjectString(object))
- advancedPrintString(os, (sexpString)object);
- else if (isObjectList(object))
- advancedPrintList(os, (sexpList)object);
- else
- ErrorMessage(ERROR, "NULL object can't be printed.");
-}
diff --git a/rpmio/sexp/sexp.h b/rpmio/sexp/sexp.h
deleted file mode 100644
index 195f23559..000000000
--- a/rpmio/sexp/sexp.h
+++ /dev/null
@@ -1,303 +0,0 @@
-/* SEXP standard header file: sexp.h
- * Ronald L. Rivest
- * 6/29/1997
- */
-
-/* GLOBAL DECLARATIONS */
-#define TRUE 1
-#define FALSE 0
-
-/* PRINTING MODES */
-#define CANONICAL 1 /* standard for hashing and tranmission */
-#define BASE64 2 /* base64 version of canonical */
-#define ADVANCED 3 /* pretty-printed */
-
-/* ERROR MESSAGE LEVELS */
-#define WARNING 1
-#define ERROR 2
-
-#define DEFAULTLINELENGTH 75
-
-/* TYPES OF OBJECTS */
-#define SEXP_STRING 1
-#define SEXP_LIST 2
-
-typedef unsigned char octet;
-
-typedef /*@abstract@*/ struct sexpSimpleString_s * sexpSimpleString;
-typedef /*@abstract@*/ struct sexpString_s * sexpString;
-typedef /*@abstract@*/ struct sexpList_s * sexpList;
-typedef /*@abstract@*/ union sexpObject_u * sexpObject;
-
-/* sexpIter */
-/* an "iterator" for going over lists */
-/* In this implementation, it is the same as a list */
-typedef /*@abstract@*/ sexpList sexpIter;
-
-typedef /*@abstract@*/ struct sexpInputStream_s * sexpInputStream;
-typedef /*@abstract@*/ struct sexpOutputStream_s * sexpOutputStream;
-
-/* sexpSimpleString */
-struct sexpSimpleString_s {
- size_t length;
- size_t allocatedLength;
-/*@null@*/
- octet *string;
-};
-
-/* sexpString */
-struct sexpString_s {
- int type;
-/*@null@*/
- sexpSimpleString presentationHint;
-/*@null@*/
- sexpSimpleString string;
-};
-
-/* sexpObject */
-
-/* sexpList */
-/* If first is NULL, then rest must also be NULL; this is empty list */
-struct sexpList_s {
- int type;
-/*@null@*/
- sexpObject first;
-/*@null@*/
- sexpList rest;
-};
-
-/* sexpObject */
-/* so we can have a pointer to something of either type */
-union sexpObject_u {
-/*@unused@*/
- struct sexpString_s string;
-/*@unused@*/
- struct sexpList_s list;
-};
-
-/* Function prototypes */
-
-/* sexp-basic */
-/*@mayexit@*/ /*@printflike@*/
-void ErrorMessage(int level, const char *fmt, ...)
- /*@globals fileSystem @*/
- /*@modifies fileSystem @*/;
-void initializeMemory(void)
- /*@*/;
-void * sexpAlloc(size_t n)
- /*@globals fileSystem @*/
- /*@modifies fileSystem @*/;
-sexpSimpleString newSimpleString(void)
- /*@globals fileSystem @*/
- /*@modifies fileSystem @*/;
-size_t simpleStringLength(sexpSimpleString ss)
- /*@*/;
-/*@exposed@*/ /*@null@*/
-octet *simpleStringString(sexpSimpleString ss)
- /*@*/;
-/*@null@*/
-sexpSimpleString reallocateSimpleString(sexpSimpleString ss)
- /*@globals fileSystem @*/
- /*@modifies ss, fileSystem @*/;
-void appendCharToSimpleString(int c, sexpSimpleString ss)
- /*@globals fileSystem @*/
- /*@modifies ss, fileSystem @*/;
-sexpString newSexpString(void)
- /*@globals fileSystem @*/
- /*@modifies fileSystem @*/;
-/*@exposed@*/ /*@null@*/
-sexpSimpleString sexpStringPresentationHint(sexpString s)
- /*@*/;
-void setSexpStringPresentationHint(sexpString s, sexpSimpleString ss)
- /*@modifies s @*/;
-void setSexpStringString(sexpString s, sexpSimpleString ss)
- /*@modifies s @*/;
-/*@exposed@*/ /*@null@*/
-sexpSimpleString sexpStringString(sexpString s)
- /*@*/;
-void closeSexpString(sexpString s)
- /*@*/;
-sexpList newSexpList(void)
- /*@globals fileSystem @*/
- /*@modifies fileSystem @*/;
-void sexpAddSexpListObject(sexpList list, sexpObject object)
- /*@globals fileSystem @*/
- /*@modifies list, fileSystem @*/;
-void closeSexpList(sexpList list)
- /*@*/;
-/*@observer@*/
-sexpIter sexpListIter(sexpList list)
- /*@*/;
-/*@exposed@*/ /*@observer@*/ /*@null@*/
-sexpIter sexpIterNext(sexpIter iter)
- /*@*/;
-/*@exposed@*/ /*@observer@*/ /*@null@*/
-sexpObject sexpIterObject(sexpIter iter)
- /*@*/;
-int isObjectString(sexpObject object)
- /*@*/;
-int isObjectList(sexpObject object)
- /*@*/;
-
-/* sexp-input */
-void initializeCharacterTables(void)
- /*@globals internalState @*/
- /*@modifies internalState @*/;
-int isWhiteSpace(int c)
- /*@*/;
-int isDecDigit(int c)
- /*@*/;
-int isHexDigit(int c)
- /*@*/;
-int isBase64Digit(int c)
- /*@*/;
-int isTokenChar(int c)
- /*@*/;
-/*@unused@*/
-int isAlpha(int c)
- /*@*/;
-void changeInputByteSize(sexpInputStream is, int newByteSize)
- /*@modifies is @*/;
-void getChar(sexpInputStream is)
- /*@globals fileSystem @*/
- /*@modifies is, fileSystem @*/;
-
-/*@-globuse@*/
-void sexpIFgetc(sexpInputStream is)
- /*@globals fileSystem @*/
- /*@modifies is, fileSystem @*/;
-/*@=globuse@*/
-int sexpIFpeek(sexpInputStream is)
- /*@*/;
-int sexpIFeof(sexpInputStream is)
- /*@*/;
-void sexpIFpoke(sexpInputStream is, int c)
- /*@modifies is @*/;
-sexpInputStream sexpIFopen(/*@null@*/ const char * ifn, const char * fmode)
- /*@globals fileSystem @*/
- /*@modifies fileSystem @*/;
-void skipWhiteSpace(sexpInputStream is)
- /*@modifies is @*/;
-void skipChar(sexpInputStream is, int c)
- /*@globals fileSystem @*/
- /*@modifies is, fileSystem @*/;
-void scanToken(sexpInputStream is, sexpSimpleString ss)
- /*@globals fileSystem @*/
- /*@modifies is, ss, fileSystem @*/;
-sexpObject scanToEOF(sexpInputStream is)
- /*@globals fileSystem @*/
- /*@modifies is, fileSystem @*/;
-unsigned long int scanDecimal(sexpInputStream is)
- /*@globals fileSystem @*/
- /*@modifies is, fileSystem @*/;
-void scanVerbatimString(sexpInputStream is, sexpSimpleString ss, long int length)
- /*@globals fileSystem @*/
- /*@modifies is, ss, fileSystem @*/;
-void scanQuotedString(sexpInputStream is, sexpSimpleString ss, long int length)
- /*@globals fileSystem @*/
- /*@modifies is, ss, fileSystem @*/;
-void scanHexString(sexpInputStream is, sexpSimpleString ss, long int length)
- /*@globals fileSystem @*/
- /*@modifies is, ss, fileSystem @*/;
-void scanBase64String(sexpInputStream is, sexpSimpleString ss, long int length)
- /*@globals fileSystem @*/
- /*@modifies is, ss, fileSystem @*/;
-sexpSimpleString scanSimpleString(sexpInputStream is)
- /*@globals fileSystem @*/
- /*@modifies is, fileSystem @*/;
-sexpString scanString(sexpInputStream is)
- /*@globals fileSystem @*/
- /*@modifies is, fileSystem @*/;
-sexpList scanList(sexpInputStream is)
- /*@globals fileSystem @*/
- /*@modifies is, fileSystem @*/;
-sexpObject scanObject(sexpInputStream is)
- /*@globals fileSystem @*/
- /*@modifies is, fileSystem @*/;
-
-/* sexp-output */
-void putChar(sexpOutputStream os, int c)
- /*@globals fileSystem @*/
- /*@modifies os, fileSystem @*/;
-void varPutChar(sexpOutputStream os, int c)
- /*@modifies os @*/;
-void changeOutputByteSize(sexpOutputStream os, int newByteSize, int mode)
- /*@globals fileSystem @*/
- /*@modifies os, fileSystem @*/;
-void flushOutput(sexpOutputStream os)
- /*@modifies os @*/;
-void newLine(sexpOutputStream os, int mode)
- /*@modifies os @*/;
-
-void sexpOFnewLine(sexpOutputStream os, int mode)
- /*@modifies os @*/;
-void sexpOFwidth(sexpOutputStream os, int width)
- /*@modifies os @*/;
-sexpOutputStream sexpOFopen(/*@null@*/ const char * ofn, const char * fmode)
- /*@globals fileSystem @*/
- /*@modifies fileSystem @*/;
-
-void printDecimal(sexpOutputStream os, long int n)
- /*@modifies os @*/;
-void canonicalPrintVerbatimSimpleString(sexpOutputStream os, sexpSimpleString ss)
- /*@globals fileSystem @*/
- /*@modifies os, fileSystem @*/;
-void canonicalPrintString(sexpOutputStream os, sexpString s)
- /*@globals fileSystem @*/
- /*@modifies os, fileSystem @*/;
-void canonicalPrintList(sexpOutputStream os, sexpList list)
- /*@globals fileSystem @*/
- /*@modifies os, fileSystem @*/;
-void canonicalPrintObject(sexpOutputStream os, sexpObject object)
- /*@globals fileSystem @*/
- /*@modifies os, fileSystem @*/;
-void base64PrintWholeObject(sexpOutputStream os, sexpObject object)
- /*@globals fileSystem @*/
- /*@modifies os, fileSystem @*/;
-int canPrintAsToken(sexpOutputStream os, sexpSimpleString ss)
- /*@*/;
-void advancedPrintTokenSimpleString(sexpOutputStream os, sexpSimpleString ss)
- /*@modifies os @*/;
-int advancedLengthSimpleStringToken(sexpSimpleString ss)
- /*@*/;
-/*@unused@*/
-void advancedPrintVerbatimSimpleString(sexpOutputStream os, sexpSimpleString ss)
- /*@globals fileSystem @*/
- /*@modifies os, fileSystem @*/;
-/*@unused@*/
-int advancedLengthSimpleStringVerbatim(sexpSimpleString ss)
- /*@*/;
-void advancedPrintBase64SimpleString(sexpOutputStream os, sexpSimpleString ss)
- /*@globals fileSystem @*/
- /*@modifies os, fileSystem @*/;
-void advancedPrintHexSimpleString(sexpOutputStream os, sexpSimpleString ss)
- /*@globals fileSystem @*/
- /*@modifies os, fileSystem @*/;
-int advancedLengthSimpleStringHexadecimal(sexpSimpleString ss)
- /*@*/;
-int canPrintAsQuotedString(sexpSimpleString ss)
- /*@*/;
-void advancedPrintQuotedStringSimpleString(sexpOutputStream os, sexpSimpleString ss)
- /*@modifies os @*/;
-int advancedLengthSimpleStringQuotedString(sexpSimpleString ss)
- /*@*/;
-void advancedPrintSimpleString(sexpOutputStream os, sexpSimpleString ss)
- /*@globals fileSystem @*/
- /*@modifies os, fileSystem @*/;
-void advancedPrintString(sexpOutputStream os, sexpString s)
- /*@globals fileSystem @*/
- /*@modifies os, fileSystem @*/;
-int advancedLengthSimpleStringBase64(sexpSimpleString ss)
- /*@*/;
-int advancedLengthSimpleString(sexpOutputStream os, sexpSimpleString ss)
- /*@*/;
-int advancedLengthString(sexpOutputStream os, sexpString s)
- /*@*/;
-int advancedLengthList(sexpOutputStream os, sexpList list)
- /*@*/;
-void advancedPrintList(sexpOutputStream os, sexpList list)
- /*@globals fileSystem @*/
- /*@modifies os, fileSystem @*/;
-void advancedPrintObject(sexpOutputStream os, sexpObject object)
- /*@globals fileSystem @*/
- /*@modifies os, fileSystem @*/;
diff --git a/rpmio/sexp/tests/.cvsignore b/rpmio/sexp/tests/.cvsignore
deleted file mode 100644
index 25a5e88ed..000000000
--- a/rpmio/sexp/tests/.cvsignore
+++ /dev/null
@@ -1,3 +0,0 @@
-Makefile
-Makefile.in
-*.out
diff --git a/rpmio/sexp/tests/Makefile.am b/rpmio/sexp/tests/Makefile.am
deleted file mode 100644
index 9ad153e3d..000000000
--- a/rpmio/sexp/tests/Makefile.am
+++ /dev/null
@@ -1,14 +0,0 @@
-## Process this file with automake to produce Makefile.in.
-
-AUTOMAKE_OPTIONS = 1.4 foreign
-
-all:
-
-EXTRA_DIST = \
- sexp-sample-a sexp-sample-b sexp-sample-c sexp-sample.exp
-
-noinst_SCRIPTS = chk-samples
-
-TESTS_ENVIRONMENT =
-
-TESTS = chk-samples
diff --git a/rpmio/sexp/tests/chk-samples b/rpmio/sexp/tests/chk-samples
deleted file mode 100755
index 9c1fd33ea..000000000
--- a/rpmio/sexp/tests/chk-samples
+++ /dev/null
@@ -1,19 +0,0 @@
-#!/bin/sh
-
-samples="
-sexp-sample-a
-sexp-sample-b
-sexp-sample-c
-"
-
-expected=sexp-sample.exp
-
-rc=0
-for s in $samples
-do
- ../sexp < $s > ${s}.out || rc=1
- diff -u ${s}.out $expected || rc=1
- rm -f ${s}.out
-done
-
-exit $rc
diff --git a/rpmio/sexp/tests/sexp-sample-a b/rpmio/sexp/tests/sexp-sample-a
deleted file mode 100644
index f6bf0eaac..000000000
--- a/rpmio/sexp/tests/sexp-sample-a
+++ /dev/null
@@ -1,20 +0,0 @@
-(certificate
- (issuer
- (name
- (public-key
- rsa-with-md5
- (e |NFGq/E3wh9f4rJIQVXhS|)
- (n |d738/4ghP9rFZ0gAIYZ5q9y6iskDJwASi5rEQpEQq8ZyMZeIZzIAR2I5iGE=|))
- aid-committee))
- (subject
- (ref
- (public-key
- rsa-with-md5
- (e |NFGq/E3wh9f4rJIQVXhS|)
- (n |d738/4ghP9rFZ0gAIYZ5q9y6iskDJwASi5rEQpEQq8ZyMZeIZzIAR2I5iGE=|))
- tom
- mother))
- (not-before "1997-01-01_09:00:00")
- (not-after "1998-01-01_09:00:00")
- (tag
- (spend (account "12345678") (* numeric range "1" "1000")))) \ No newline at end of file
diff --git a/rpmio/sexp/tests/sexp-sample-b b/rpmio/sexp/tests/sexp-sample-b
deleted file mode 100644
index 265a07285..000000000
--- a/rpmio/sexp/tests/sexp-sample-b
+++ /dev/null
@@ -1 +0,0 @@
-{KDExOmNlcnRpZmljYXRlKDY6aXNzdWVyKDQ6bmFtZSgxMDpwdWJsaWMta2V5MTI6cnNhLXdpdGgtbWQ1KDE6ZTE1OjRRqvxN8IfX+KySEFV4UikoMTpuNDQ6d738/4ghP9rFZ0gAIYZ5q9y6iskDJwASi5rEQpEQq8ZyMZeIZzIAR2I5iGEpKTEzOmFpZC1jb21taXR0ZWUpKSg3OnN1YmplY3QoMzpyZWYoMTA6cHVibGljLWtleTEyOnJzYS13aXRoLW1kNSgxOmUxNTo0Uar8TfCH1/iskhBVeFIpKDE6bjQ0One9/P+IIT/axWdIACGGeavcuorJAycAEouaxEKREKvGcjGXiGcyAEdiOYhhKSkzOnRvbTY6bW90aGVyKSkoMTA6bm90LWJlZm9yZTE5OjE5OTctMDEtMDFfMDk6MDA6MDApKDk6bm90LWFmdGVyMTk6MTk5OC0wMS0wMV8wOTowMDowMCkoMzp0YWcoNTpzcGVuZCg3OmFjY291bnQ4OjEyMzQ1Njc4KSgxOio3Om51bWVyaWM1OnJhbmdlMToxNDoxMDAwKSkpKQ==} \ No newline at end of file
diff --git a/rpmio/sexp/tests/sexp-sample-c b/rpmio/sexp/tests/sexp-sample-c
deleted file mode 100644
index a02692a8b..000000000
--- a/rpmio/sexp/tests/sexp-sample-c
+++ /dev/null
Binary files differ
diff --git a/rpmio/sexp/tests/sexp-sample.exp b/rpmio/sexp/tests/sexp-sample.exp
deleted file mode 100644
index 2ce8f0d89..000000000
--- a/rpmio/sexp/tests/sexp-sample.exp
+++ /dev/null
Binary files differ