diff --git a/Makefile.in b/Makefile.in index 3c44c2ec9..b3a3b964d 100644 --- a/Makefile.in +++ b/Makefile.in @@ -33,7 +33,7 @@ CC := @CC@ CFLAGS := @CFLAGS@ @INCLUDEDIR@ -Wall -std=gnu99 -fno-strict-aliasing CPPFLAGS=@CPPFLAGS@ -LDFLAGS:= -l@CURSESLIB@ @LDFLAGS@ @LIBDIR@ +LDFLAGS:= -l@CURSESLIB@ @LIBS@ @LDFLAGS@ @LIBDIR@ INSTALL:=@INSTALL@ prefix = @prefix@ @@ -69,7 +69,7 @@ FISHD_OBJS := fishd.o env_universal_common.o common.o util.o wutil.o \ #All objects that the system needs to build mimedb MIME_OBJS := mimedb.o xdgmimealias.o xdgmime.o xdgmimeglob.o \ - xdgmimeint.o xdgmimemagic.o xdgmimeparent.o + xdgmimeint.o xdgmimemagic.o xdgmimeparent.o wutil.o # # Files containing documentation for builtins. Should be listed diff --git a/config.h.in b/config.h.in index 194a72818..0250a5229 100644 --- a/config.h.in +++ b/config.h.in @@ -15,6 +15,12 @@ /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H +/* Define to 1 if you have the `rt' library (-lrt). */ +#undef HAVE_LIBRT + +/* Define to 1 if you have the `socket' library (-lsocket). */ +#undef HAVE_LIBSOCKET + /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H diff --git a/env_universal.c b/env_universal.c index 61d42c945..bb03c7fa5 100644 --- a/env_universal.c +++ b/env_universal.c @@ -9,6 +9,11 @@ #include #include #include +#if HAVE_NCURSES_H +#include +#else +#include +#endif #include #include diff --git a/env_universal_common.c b/env_universal_common.c index 3a7416c77..d4a31fcd4 100644 --- a/env_universal_common.c +++ b/env_universal_common.c @@ -509,7 +509,7 @@ static void enqueue( const void *k, { const wchar_t *key = (const wchar_t *)k; const var_entry_t *val = (const var_entry_t *)v; - queue_t *queue = (queue_t *)q; + dyn_queue_t *queue = (dyn_queue_t *)q; message_t *msg = create_message( val->export?SET_EXPORT:SET, key, val->val ); msg->count=1; diff --git a/env_universal_common.h b/env_universal_common.h index bec9c93da..0832097c2 100644 --- a/env_universal_common.h +++ b/env_universal_common.h @@ -61,7 +61,7 @@ typedef struct connection /** Queue of onsent messages */ - queue_t unsent; + dyn_queue_t unsent; /** Set to one when this connection should be killed */ diff --git a/gen_hdr.sh b/gen_hdr.sh index 7bf013125..5e09f40e3 100755 --- a/gen_hdr.sh +++ b/gen_hdr.sh @@ -5,7 +5,7 @@ # into a C string literal. # NAME is the name of the function we are generating documentation for. -NAME=$(basename $1 .doxygen) +NAME=`basename $1 .doxygen` # Render the page nroff -man doc_src/builtin_doc/man/man1/${NAME}.1 | col -b | cat -s | sed -e '$d' | ./gen_hdr2 diff --git a/util.c b/util.c index 31ccf7b4e..14e841bf2 100644 --- a/util.c +++ b/util.c @@ -72,20 +72,20 @@ int maxi( int a, /* Queue functions */ -void q_init( queue_t *q ) +void q_init( dyn_queue_t *q ) { q->start = (void **)malloc( sizeof(void*)*1 ); q->stop = &q->start[1]; q->put_pos = q->get_pos = q->start; } -void q_destroy( queue_t *q ) +void q_destroy( dyn_queue_t *q ) { free( q->start ); } /* - static q_print( queue_t *q ) + static q_print( dyn_queue_t *q ) { int i; int size = (q->stop-q->start); @@ -106,7 +106,7 @@ void q_destroy( queue_t *q ) /** Reallocate the queue_t */ -static int q_realloc( queue_t *q ) +static int q_realloc( dyn_queue_t *q ) { void **old_start = q->start; void **old_stop = q->stop; @@ -131,7 +131,7 @@ static int q_realloc( queue_t *q ) return 1; } -int q_put( queue_t *q, void *e ) +int q_put( dyn_queue_t *q, void *e ) { *q->put_pos = e; @@ -144,7 +144,7 @@ int q_put( queue_t *q, void *e ) return 1; } -void *q_get( queue_t *q) +void *q_get( dyn_queue_t *q) { void *e = *q->get_pos; if( ++q->get_pos == q->stop ) @@ -152,12 +152,12 @@ void *q_get( queue_t *q) return e; } -void *q_peek( queue_t *q ) +void *q_peek( dyn_queue_t *q ) { return *q->get_pos; } -int q_empty( queue_t *q ) +int q_empty( dyn_queue_t *q ) { // fprintf( stderr, "Queue %d is %s\n", q, (q->put_pos == q->get_pos)?"empty":"non-empty" ); return q->put_pos == q->get_pos; diff --git a/util.h b/util.h index 04c76bac0..f498811ea 100644 --- a/util.h +++ b/util.h @@ -10,7 +10,7 @@ /** Data structure for an automatically resizing dynamically allocated queue, */ -typedef struct queue +typedef struct dyn_queue { /** Start of the array */ void **start; @@ -21,7 +21,7 @@ typedef struct queue /** Where to remove elements */ void **get_pos; } -queue_t; +dyn_queue_t; /** Internal struct used by hash_table_t. @@ -159,17 +159,17 @@ float minf( float a, float b ); element to be inserted into the buffer is the first element to be returned. */ -void q_init( queue_t *q ); +void q_init( dyn_queue_t *q ); /** Destroy the queue */ -void q_destroy( queue_t *q ); +void q_destroy( dyn_queue_t *q ); /** Insert element into queue */ -int q_put( queue_t *q, void *e ); +int q_put( dyn_queue_t *q, void *e ); /** Remove and return next element from queue */ -void *q_get( queue_t *q); +void *q_get( dyn_queue_t *q); /** Return next element from queue without removing it */ -void *q_peek( queue_t *q); +void *q_peek( dyn_queue_t *q); /** Returns 1 if the queue is empty, 0 otherwise */ -int q_empty( queue_t *q ); +int q_empty( dyn_queue_t *q ); /** Initialize a hash table. The hash function must never return the value 0.