libpopt no longer use

sort_link -> sort_link_t.
This commit is contained in:
rocky
2005-10-08 09:08:10 +00:00
parent 21be3082f5
commit 1223d47875
4 changed files with 22 additions and 93 deletions

View File

@@ -1,5 +1,5 @@
/*
$Id: isort.c,v 1.4 2005/01/23 05:31:03 rocky Exp $
$Id: isort.c,v 1.5 2005/10/08 09:08:10 rocky Exp $
Copyright (C) 2004, 2005 Rocky Bernstein <rocky@panix.com>
Copyright (C) 1998 Monty xiphmont@mit.edu
@@ -46,9 +46,9 @@ sort_alloc(long size)
ret->size=-1;
ret->maxsize=size;
ret->head=calloc(65536,sizeof(sort_link *));
ret->head=calloc(65536,sizeof(sort_link_t *));
ret->bucketusage=calloc(1, 65536*sizeof(long));
ret->revindex=calloc(size,sizeof(sort_link));
ret->revindex=calloc(size,sizeof(sort_link_t));
ret->lastbucket=0;
return(ret);
@@ -58,7 +58,7 @@ void
sort_unsortall(sort_info_t *i)
{
if(i->lastbucket>2000){ /* a guess */
memset(i->head,0,65536*sizeof(sort_link *));
memset(i->head,0,65536*sizeof(sort_link_t *));
}else{
long b;
for(b=0;b<i->lastbucket;b++)
@@ -84,8 +84,8 @@ sort_sort(sort_info_t *i,long sortlo,long sorthi)
long j;
for(j=sorthi-1;j>=sortlo;j--){
sort_link **hv=i->head+i->vector[j]+32768;
sort_link *l=i->revindex+j;
sort_link_t **hv=i->head+i->vector[j]+32768;
sort_link_t *l=i->revindex+j;
if(*hv==NULL){
i->bucketusage[i->lastbucket]=i->vector[j]+32768;
@@ -112,10 +112,10 @@ sort_setup(sort_info_t *i, int16_t *vector, long *abspos, long size,
i->hi=max(0,min(sorthi-*abspos,size));
}
sort_link *
sort_link_t *
sort_getmatch(sort_info_t *i, long post, long overlap, int value)
{
sort_link *ret;
sort_link_t *ret;
if(i->sortbegin==-1)sort_sort(i,i->lo,i->hi);
/* Now we reuse lo and hi */
@@ -139,10 +139,10 @@ sort_getmatch(sort_info_t *i, long post, long overlap, int value)
return(ret);
}
sort_link *
sort_nextmatch(sort_info_t *i, sort_link *prev)
sort_link_t *
sort_nextmatch(sort_info_t *i, sort_link_t *prev)
{
sort_link *ret=prev->next;
sort_link_t *ret=prev->next;
if(!ret || ipos(i,ret)>=i->hi)return(NULL);
return(ret);

View File

@@ -1,5 +1,5 @@
/*
$Id: isort.h,v 1.2 2005/01/07 02:42:29 rocky Exp $
$Id: isort.h,v 1.3 2005/10/08 09:08:10 rocky Exp $
Copyright (C) 2004, 2005 Rocky Bernstein <rocky@panix.com>
Copyright (C) 1998 Monty xiphmont@mit.edu
@@ -24,7 +24,7 @@
typedef struct sort_link{
struct sort_link *next;
} sort_link;
} sort_link_t;
typedef struct sort_info {
int16_t *vector; /* vector (storage doesn't belong to us) */
@@ -39,22 +39,22 @@ typedef struct sort_info {
int val; /* ...and val */
/* sort structs */
sort_link **head; /* sort buckets (65536) */
sort_link_t **head; /* sort buckets (65536) */
long *bucketusage; /* of used buckets (65536) */
long lastbucket;
sort_link *revindex;
sort_link_t *revindex;
} sort_info_t;
extern sort_info_t *sort_alloc(long size);
extern sort_info_t *sort_alloc(long int size);
extern void sort_unsortall(sort_info_t *i);
extern void sort_setup(sort_info_t *i,int16_t *vector,long *abspos,long size,
long sortlo, long sorthi);
extern void sort_free(sort_info_t *i);
extern sort_link *sort_getmatch(sort_info_t *i, long post, long overlap,
int value);
extern sort_link *sort_nextmatch(sort_info_t *i, sort_link *prev);
extern sort_link_t *sort_getmatch(sort_info_t *i, long post, long overlap,
int value);
extern sort_link_t *sort_nextmatch(sort_info_t *i, sort_link_t *prev);
#define is(i) (i->size)
#define ib(i) (*i->abspos)

View File

@@ -1,5 +1,5 @@
/*
$Id: paranoia.c,v 1.15 2005/10/05 00:50:41 rocky Exp $
$Id: paranoia.c,v 1.16 2005/10/08 09:08:10 rocky Exp $
Copyright (C) 2004, 2005 Rocky Bernstein <rocky@panix.com>
Copyright (C) 1998 Monty xiphmont@mit.edu
@@ -265,8 +265,8 @@ try_sort_sync(cdrom_paranoia_t *p,
void (*callback)(long int, paranoia_cb_mode_t))
{
long dynoverlap=p->dynoverlap;
sort_link *ptr=NULL;
long int dynoverlap=p->dynoverlap;
sort_link_t *ptr=NULL;
unsigned char *Bflags=B->flags;
/* block flag matches 0x02 (unmatchable) */

View File

@@ -1,71 +0,0 @@
# Configure paths for libpopt, based on m4's part of gnome
# (c) 2002, 2004 Herbert Valerio Riedel
dnl AM_PATH_LIBPOPT([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
dnl Test for libpopt, sets LIBPOPT_{CFLAGS,LIBS}
dnl alas there's no easy way to check the version available
AC_DEFUN([AM_PATH_LIBPOPT], [
AC_ARG_WITH(libpopt-prefix,[ --with-libpopt-prefix=PFX Prefix where libpopt is installed (optional)],
libpopt_prefix="$withval", libpopt_prefix="")
if test x$libpopt_prefix != x ; then
LIBPOPT_CFLAGS="-I$libpopt_prefix/include"
LIBPOPT_LIBS="-L$libpopt_prefix/lib -lpopt"
else
LIBPOPT_CFLAGS=""
LIBPOPT_LIBS="-lpopt"
fi
AC_MSG_CHECKING(for libpopt library)
dnl save CFLAGS and LIBS
ac_save_CFLAGS="$CFLAGS"
ac_save_LIBS="$LIBS"
CFLAGS="$CFLAGS $LIBPOPT_CFLAGS"
LIBS="$LIBPOPT_LIBS $LIBS"
dnl now check whether the installed libpopt is usable
rm -f conf.glibtest
AC_TRY_RUN([
#include <popt.h>
int
main(int argc, const char *argv[])
{
char *s;
const struct poptOption options[] = {
POPT_AUTOHELP
{ NULL, 0, 0, NULL, 0, NULL, NULL },
{"foo", 'f', POPT_ARG_STRING|POPT_ARGFLAG_OPTIONAL, &s, NULL,
"test doc", "FILE"},
};
poptContext context = poptGetContext("popt-test", argc, argv, options, 0);
poptSetOtherOptionHelp (context, "[OPTION...] <argument...>");
poptGetNextOpt(context);
return 0;
}
],, no_popt=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
CFLAGS="$ac_save_CFLAGS"
LIBS="$ac_save_LIBS"
dnl handle test result
if test "x$no_popt" = x ; then
AC_MSG_RESULT(yes)
ifelse([$1], , :, [$1])
else
AC_MSG_RESULT(no or not new enough - need libpopt 1.7 or greater)
LIBPOPT_CFLAGS=""
LIBPOPT_LIBS=""
ifelse([$2], , :, [$2])
fi
AC_SUBST(LIBPOPT_CFLAGS)
AC_SUBST(LIBPOPT_LIBS)
])
dnl EOF