diff --git a/lib/Makefile.am b/lib/Makefile.am index c3d8e356..61b3ebc5 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -33,7 +33,7 @@ lib_LTLIBRARIES = libspdylay.la OBJECTS = spdylay_pq.c -HFILES = spdylay_pq.h +HFILES = spdylay_pq.h spdylay_int.h libspdylay_la_SOURCES = $(HFILES) $(OBJECTS) libspdylay_la_LDFLAGS = -no-undefined \ diff --git a/lib/spdylay_int.h b/lib/spdylay_int.h new file mode 100644 index 00000000..e23d9ffe --- /dev/null +++ b/lib/spdylay_int.h @@ -0,0 +1,32 @@ +/* + * Spdylay - SPDY Library + * + * Copyright (c) 2012 Tatsuhiro Tsujikawa + * + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE + * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +#ifndef SPDYLAY_INT_H +#define SPDYLAY_INT_H + +/* Macros, types and constants for internal use */ + +typedef int (*spdylay_compar)(const void *lhs, const void *rhs); + +#endif /* SPDYLAY_INT_H */ diff --git a/lib/spdylay_pq.c b/lib/spdylay_pq.c index 4386788d..79f1cbdd 100644 --- a/lib/spdylay_pq.c +++ b/lib/spdylay_pq.c @@ -24,7 +24,7 @@ */ #include "spdylay_pq.h" -int spdylay_pq_init(spdylay_pq *pq, spdylay_pq_compar compar) +int spdylay_pq_init(spdylay_pq *pq, spdylay_compar compar) { pq->capacity = 4096; pq->q = malloc(pq->capacity); diff --git a/lib/spdylay_pq.h b/lib/spdylay_pq.h index 78089481..6b71ce92 100644 --- a/lib/spdylay_pq.h +++ b/lib/spdylay_pq.h @@ -30,19 +30,18 @@ #endif /* HAVE_CONFIG_H */ #include +#include "spdylay_int.h" /* Implementation of priority queue */ -typedef int (*spdylay_pq_compar)(const void *lhs, const void *rhs); - typedef struct { void **q; size_t length; size_t capacity; - spdylay_pq_compar compar; + spdylay_compar compar; } spdylay_pq; -int spdylay_pq_init(spdylay_pq *pq, spdylay_pq_compar cmp); +int spdylay_pq_init(spdylay_pq *pq, spdylay_compar cmp); void spdylay_pq_free(spdylay_pq *pq);