cleaned up includes, autoconf is now optional, since cmake now creates a config.h

This commit is contained in:
Sears Russell 2009-07-26 18:51:45 +00:00
parent 260310e151
commit 081c61b414
51 changed files with 567 additions and 637 deletions

View file

@ -26,6 +26,7 @@
<option id="gnu.c.compiler.option.include.paths.2049135479" name="Include paths (-I)" superClass="gnu.c.compiler.option.include.paths" valueType="includePath">
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/stasis/src/}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/stasis/}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/stasis/build/}&quot;"/>
</option>
<inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.1962414466" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/>
</tool>

View file

@ -56,6 +56,21 @@ if(NOT HAVE_FUSE)
message(STATUS "fuse not found; sample application 'stasis_fuse' will not be built")
endif(NOT HAVE_FUSE)
INCLUDE(CheckFunctionExists)
INCLUDE(CheckCSourceCompiles)
CHECK_FUNCTION_EXISTS(sync_file_range HAVE_SYNC_FILE_RANGE)
CHECK_FUNCTION_EXISTS(fdatasync HAVE_FDATASYNC)
CHECK_C_SOURCE_COMPILES("#define _GNU_SOURCE
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
int main(int argc, char * argv[]) {
argc = O_DIRECT;
}
" HAVE_O_DIRECT)
MACRO(CREATE_CHECK NAME)
ADD_EXECUTABLE(${NAME} ${NAME}.c)
TARGET_LINK_LIBRARIES(${NAME} ${COMMON_LIBRARIES})
@ -75,7 +90,8 @@ ENDMACRO(CREATE_EXECUTABLE)
# Output the config.h file
#CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h)
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/build
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/src
/usr/include)
# set linker path for this and all subdirs
@ -95,3 +111,5 @@ INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/stasis
FILES_MATCHING PATTERN "*.h"
PATTERN ".svn" EXCLUDE
PATTERN ".deps" EXCLUDE)
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h)

View file

@ -1,6 +1,6 @@
#include <stasis/transactional.h>
#include <string.h>
#include <unistd.h>
#include <stdio.h>
void alloc_rids(long long num_rids, recordid ** slow, recordid ** fast) {
*slow = malloc(num_rids * sizeof(**slow));

5
config.h.cmake Normal file
View file

@ -0,0 +1,5 @@
#define _GNU_SOURCE
#cmakedefine HAVE_FDATASYNC
#cmakedefine HAVE_SYNC_FILE_RANGE
#cmakedefine HAVE_O_DIRECT

View file

@ -27,14 +27,15 @@
*/
#include <assert.h>
#include <stdlib.h>
#include <stdio.h>
#include <stasis/common.h>
#include <stasis/allocationPolicy.h>
#include <stasis/lhtable.h>
#include <stasis/redblack.h>
#include <stasis/transactional.h>
#include <assert.h>
#include <stdio.h>
#define ALLOCATION_POLICY_SANITY_CHECKS
// Each availablePage should either be in availablePages, or in

View file

@ -1,6 +1,5 @@
#include <stasis/common.h>
#include <stasis/transactional.h>
#include <stdlib.h>
#include <stdio.h>
typedef struct {
byte * keyArray;
byte * valueArray;

View file

@ -1,5 +1,3 @@
#include <pthread.h>
#include <config.h>
#include <stasis/bufferManager/bufferHash.h>
#include <stasis/bufferPool.h>
@ -11,7 +9,9 @@
#include <stasis/replacementPolicy.h>
#include <stasis/bufferManager.h>
#include <stasis/page.h>
#include <assert.h>
#include <stdio.h>
//#define LATCH_SANITY_CHECKING

View file

@ -1,5 +1,3 @@
#include <string.h>
#include <stasis/common.h>
#include <stasis/bufferManager.h>
@ -12,6 +10,8 @@
#include <stasis/lhtable.h>
#include <stdio.h>
static struct LH_ENTRY(table) *activePages; /* page lookup */
static pthread_mutex_t loadPagePtr_mutex;
static Page * dummy_page;

View file

@ -14,16 +14,14 @@
#include <stasis/logger/logger2.h>
#include <assert.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <stdlib.h>
/** For O_DIRECT. It's unclear that this is the correct thing to \#define, but it works under linux. */
#define __USE_GNU
#include <stdio.h>
#include <fcntl.h>
#include <unistd.h>
/** Allows boostrapping of the header page. */
/** Allows bootstrapping of the header page. */
#include <stasis/operations/pageOperations.h>
static int stable = -1;

View file

@ -1,5 +1,3 @@
#include <stdlib.h>
#include <config.h>
#include <stasis/transactional.h>
#include <stasis/bufferManager.h>
#include <stasis/bufferPool.h>

View file

@ -3,9 +3,8 @@
int ___compensation_count___ = 0;
#include <assert.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
static pthread_key_t error_key;
void compensations_init () {

View file

@ -1,6 +1,5 @@
#include <stasis/consumer.h>
#include <assert.h>
#include <stdlib.h>
#include <stasis/logger/logMemory.h>
static lladdConsumer_def_t consumers[MAX_CONSUMER_TYPES];

View file

@ -1,7 +1,5 @@
// Calculate a CRC 32 checksum.
#include <stasis/crc32.h> /*Added 10-6-04 */
#include <stdlib.h>
#include <stdio.h>
// LAST MODIFIED:[7-28-93]

View file

@ -1,6 +1,4 @@
#include <config.h>
#include <stdlib.h>
#include <string.h>
#include <stasis/common.h>
#include <stasis/doubleLinkedList.h>
#include <assert.h>

View file

@ -1,12 +1,9 @@
#include <stasis/fifo.h>
#include <stasis/crc32.h>
#include <stdlib.h>
#include <stdio.h>
#include <stasis/logger/logMemory.h>
#include <string.h>
#include <assert.h>
#include <stdio.h>
/**
Obtain a member of a fifoPool based on the value of multiplexKey. Use CRC32 to assign the key to a consumer.
*/

View file

@ -1,9 +1,7 @@
#include <stasis/graph.h>
#include <alloca.h>
#include <assert.h>
#include <stdlib.h>
#include <stasis/page.h>
#include <stasis/crc32.h>
#include <assert.h>
int numOut = 0;
int numTset = 0;

View file

@ -1,6 +1,5 @@
#include <stasis/io/handle.h>
#include <stdio.h>
#include <stdlib.h>
/** @file

View file

@ -1,20 +1,10 @@
#include <config.h>
#ifdef HAVE_SYNC_FILE_RANGE
#define _GNU_SOURCE
#endif
#include <fcntl.h>
#include <stasis/common.h>
#include <stasis/io/handle.h>
#include <stdlib.h>
#include <string.h>
#include <pthread.h>
#include <errno.h>
#include <sys/types.h>
#include <unistd.h>
#include <stdio.h>
#include <assert.h>
#include <sys/types.h>
#include <sys/stat.h>
/** @file */

View file

@ -1,8 +1,4 @@
#include <stasis/io/handle.h>
#include <stdlib.h>
#include <string.h>
#include <pthread.h>
#include <errno.h>
/** @file */
typedef struct mem_impl {

View file

@ -1,15 +1,11 @@
#include "config.h"
#include <stasis/common.h>
#include <stasis/constants.h>
#include <stasis/io/handle.h>
#include <stasis/linkedlist.h>
#include <stasis/redblack.h>
#include <pthread.h>
#include <errno.h>
#include <stdlib.h>
#include <assert.h>
#include <stdio.h>
#include <string.h>
#include <assert.h>
/**

View file

@ -1,8 +1,5 @@
#include <config.h>
#define _XOPEN_SOURCE 500
#ifdef HAVE_SYNC_FILE_RANGE
#define _GNU_SOURCE
#endif
#include <fcntl.h>
#include <unistd.h>

View file

@ -1,8 +1,9 @@
#define _GNU_SOURCE
#include <stdio.h>
#include <stasis/common.h>
#include <stasis/io/rangeTracker.h>
#include <stasis/redblack.h>
#include <stdlib.h>
#include <stdio.h>
#include <assert.h>

View file

@ -1,12 +1,11 @@
#include <stasis/iterator.h>
#include <assert.h>
#include <stdlib.h>
#include <stasis/operations.h>
#include <stasis/arrayCollection.h>
#include <stasis/logger/logMemory.h>
#include <stasis/operations/group.h>
#include <assert.h>
static lladdIterator_def_t iterators[MAX_ITERATOR_TYPES];
void lladdIterator_register(int type, lladdIterator_def_t info) {

View file

@ -1,12 +1,10 @@
#include <stdlib.h>
#include <stasis/lhtable.h>
#include <stasis/hash.h>
#include <pbl/pbl.h>
#include <assert.h>
#include <string.h>
#include <stdio.h>
#include <stasis/latches.h>
#include <assert.h>
#define FILL_FACTOR (0.5)
//#define MEASURE_GLOBAL_BUCKET_LENGTH

View file

@ -44,13 +44,8 @@ terms specified in this license.
*
* simple linked list
*****************************/
#include <config.h>
#include <stasis/common.h>
#include <stasis/linkedlist.h>
#include <stdio.h>
void printList(LinkedList **l) {
LinkedList * tmp = *l;
printf ("List is ");

View file

@ -1,15 +1,13 @@
#include <pbl/pbl.h>
#include <stasis/lockManager.h>
#include <stasis/compensations.h>
#include <stasis/latches.h>
#include <stasis/hash.h>
#include <sys/time.h>
#include <time.h>
#include <stasis/latches.h>
#include <stdlib.h>
#include <errno.h>
#include <stdio.h>
#include <assert.h>
#include <string.h>
#include <stasis/hash.h>
#define MUTEX_COUNT 32

View file

@ -1,21 +1,15 @@
#define _SVID_SOURCE
#define _BSD_SOURCE
#include <dirent.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <errno.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <pthread.h>
#include <stasis/common.h>
#include <stasis/latches.h>
#include <stasis/logger/filePool.h>
#include <stdio.h>
/**
@see stasis_log_safe_writes_state for more documentation;
identically named fields serve analagous purposes.

View file

@ -39,10 +39,6 @@ authors grant the U.S. Government and others acting in its behalf
permission to use and distribute the software in accordance with the
terms specified in this license.
---*/
#include <stdlib.h>
#include <stasis/common.h>
#include <stasis/logger/logHandle.h>
struct LogHandle {

View file

@ -2,13 +2,11 @@
NOTE: Person who's using the consumer interface calls close first, (for now).
*/
#include <stdlib.h>
#include <assert.h>
#include <stasis/logger/logMemory.h>
#include <errno.h>
#include <stasis/compensations.h>
#include <assert.h>
typedef struct {
pthread_mutex_t mutex;
pthread_mutex_t readerMutex;

View file

@ -1,6 +1,4 @@
#include <stdio.h>
#include <stasis/logger/logWriterUtils.h>
#include <stdlib.h>
/** @file
This file contains old-ish utility methods that wrap fseek, read, etc...

View file

@ -1,6 +1,7 @@
#include <stasis/transactional.h>
#include <stasis/logger/reorderingHandle.h>
#include <string.h>
#include <stdio.h>
long stasis_log_reordering_usleep_after_flush = 0;

View file

@ -41,15 +41,6 @@ terms specified in this license.
---*/
#include <sys/types.h>
#include <sys/stat.h>
#include <stdio.h>
#include <string.h>
#include <fcntl.h>
#include <unistd.h>
#include <stdlib.h>
#include <assert.h>
#include <config.h>
#include <stasis/common.h>
@ -60,6 +51,10 @@ terms specified in this license.
#include <stasis/logger/logWriterUtils.h>
#include <stasis/logger/logHandle.h>
#include <assert.h>
#include <stdio.h>
#include <fcntl.h>
/**
* @file
*

View file

@ -1,6 +1,5 @@
#include <stasis/multiplexer.h>
#include <stasis/crc32.h>
#include <stdlib.h>
#include <stasis/operations/linearHashNTA.h>
#include <stasis/logger/logMemory.h>

View file

@ -4,10 +4,8 @@
#include <stasis/latches.h>
#include <stasis/transactional.h>
#include <stasis/hash.h>
#include <stdlib.h>
#include <stdio.h>
#include <assert.h>
#include <string.h>
/*#ifndef PTHREAD_MUTEX_RECURSIVE
#define PTHREAD_MUTEX_RECURSIVE PTHREAD_MUTEX_RECURSIVE_NP

View file

@ -1,7 +1,9 @@
#include <stasis/operations.h>
#include <stasis/page.h>
#include <stasis/logger/reorderingHandle.h>
#include <string.h>
#include <stdio.h>
static int op_lsn_free_set(const LogEntry *e, Page *p) {
if(p->pageType != SLOTTED_LSN_FREE_PAGE) { abort() ; }
assert(e->update.arg_size >= (sizeof(pageoff_t) * 2));

View file

@ -1,7 +1,5 @@
#include <stasis/operations.h>
#include <stasis/hash.h>
#include <limits.h>
#include <assert.h>
#include <stasis/latches.h>
#include <stasis/page.h>
@ -20,10 +18,9 @@
#define headerHashBits (headerRidB->page)
#define headerNextSplit (headerRidB->slot)
#include <math.h>
#include <stdlib.h>
#include <string.h>
#include <pbl/pbl.h>
#include <assert.h>
/**
next.size == 0 implies empty bucket
next.size == -1 implies end of list

View file

@ -1,13 +1,8 @@
#define _XOPEN_SOURCE 600
#include <stdlib.h>
#include <config.h>
#include <stasis/page.h>
#include <stasis/logger/logEntry.h>
#include <stasis/operations/pageOperations.h>
#include <stasis/operations/regions.h>
#include <assert.h>
#include <alloca.h>
static pthread_mutex_t pageAllocMutex;

View file

@ -1,9 +1,6 @@
#include <stasis/transactional.h>
#include <stdlib.h>
#include <stdio.h>
#include <assert.h>
#include <string.h>
typedef struct {
short nextEntry;

View file

@ -49,9 +49,9 @@ terms specified in this license.
#include <stasis/operations.h>
#include <stasis/logger/logger2.h>
#include <stdlib.h>
#include <assert.h>
#include <stdio.h>
recordid prepare_bogus_rec = { 0, 0, 0};
static int op_prepare(const LogEntry * e, Page * p) {

View file

@ -67,18 +67,10 @@ terms specified in this license.
*/
#include <stdlib.h>
#include <config.h>
#include <stasis/common.h>
#include <stasis/latches.h>
#include <stasis/page.h>
#include <assert.h>
#include <stdio.h>
#include <stasis/constants.h>
#include <assert.h>
#include <stasis/blobManager.h>
#include <stasis/lockManager.h>
#include <stasis/compensations.h>
@ -88,6 +80,8 @@ terms specified in this license.
#include <stasis/bufferPool.h>
#include <stasis/truncation.h>
#include <assert.h>
static page_impl page_impls[MAX_PAGE_TYPE];
static stasis_dirty_page_table_t * dirtyPages;

View file

@ -1,7 +1,7 @@
#include "config.h"
#include <stasis/page.h>
#include <stasis/page/slotted.h>
#include <assert.h>
//#include <assert.h>
#define SLOTTED_PAGE_OVERHEAD_PER_RECORD (2 * sizeof(short))
#define SLOTTED_PAGE_HEADER_OVERHEAD (3 * sizeof(short))
@ -21,7 +21,6 @@
#define SLOTTED_PAGE_CHECK_FOR_OVERLAP
#endif
#include <stasis/truncation.h>
/**
Run sanity checks to make sure page is in a consistent state.

View file

@ -1,8 +1,7 @@
#include <stasis/pageHandle.h>
#include <assert.h>
#include <string.h>
#include <errno.h>
#include <stdio.h>
/**
@todo Make sure this doesn't need to be atomic. (It isn't!) Can

View file

@ -24,9 +24,7 @@ static char rcsid[]="$Id$";
** exactly the same
*/
#include <stddef.h>
#include <stdlib.h>
#include <unistd.h>
#include <stasis/common.h>
#include <stasis/redblack.h>
#define assert(expr)

View file

@ -1,13 +1,10 @@
#include <config.h>
#include <stdlib.h>
#include <assert.h>
#include <stdio.h>
#include <stasis/common.h>
#include <stasis/lhtable.h>
#include <stasis/redblack.h>
#include <stasis/replacementPolicy.h>
#include <assert.h>
typedef struct stasis_replacement_policy_lru_entry {
void * value;
uint64_t clock;

View file

@ -1,7 +1,5 @@
#include <config.h>
#include <stdlib.h>
#include <stasis/common.h>
#include <stasis/replacementPolicy.h>
//#include <stasis/lhtable.h>
#include <stasis/doubleLinkedList.h>
#include <assert.h>

View file

@ -1,7 +1,4 @@
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include <stdio.h>
#include <stasis/common.h>
#include <stasis/ringbuffer.h>
//#define TRACK_OFFSETS

View file

@ -3,6 +3,7 @@
#include <stasis/latches.h>
#include <math.h>
#include <stdio.h>
void acquired_lock(profile_tuple * tup, long spin_count) {
tup->sum_spin += spin_count;

View file

@ -23,7 +23,7 @@
#include <stasis/blobManager.h> // XXX remove this, move Tread() to set.c
#include <assert.h>
#include <limits.h>
#include <stdio.h>
static int stasis_initted = 0;

View file

@ -75,24 +75,29 @@ terms specified in this license.
#include <limits.h>
#if STDC_HEADERS
# include <stdlib.h>
# include <string.h>
#elif HAVE_STRINGS_H
# include <strings.h>
#endif /*STDC_HEADERS*/
//#if STDC_HEADERS
//# include <stdlib.h>
//# include <string.h>
//#elif HAVE_STRINGS_H
//# include <strings.h>
//#endif /*STDC_HEADERS*/
//
//#if HAVE_UNISTD_H
//# include <unistd.h>
//#endif
//
//#if HAVE_ERRNO_H
//# include <errno.h>
//#endif /*HAVE_ERRNO_H*/
//#ifndef errno
// /* Some systems define this! */
//extern int errno;
//#endif
#if HAVE_UNISTD_H
# include <unistd.h>
#endif
#if HAVE_ERRNO_H
# include <errno.h>
#endif /*HAVE_ERRNO_H*/
#ifndef errno
/* Some systems #define this! */
extern int errno;
#endif
#include<stdlib.h>
#include<string.h>
#include<unistd.h>
#include<errno.h>
//#define byte unsigned char
//#define lsn_t long
@ -117,6 +122,10 @@ typedef int16_t pagetype_t;
/*#define PROFILE_LATCHES*/
/*#define NO_LATCHES */
#if _POSIX_C_SOURCE >= 199309L || _XOPEN_SOURCE >= 500
#define HAVE_FDATASYNC
#endif
#ifdef DEBUGGING
/** @todo Files that use DEBUG have to pull in stdio.h, which is a pain! */
#define DEBUG(...) \

View file

@ -6,6 +6,7 @@
*/
#include <stasis/common.h>
#include <stdio.h>
BEGIN_C_DECLS

View file

@ -15,22 +15,11 @@
* Found the code at this url:
* http://www.cs.nmsu.edu/~jcook/Tools/pthreads/rw.c
*/
#include <stasis/common.h>
#include <stdlib.h>
#include <pthread.h>
#include <stdio.h>
#include <unistd.h>
#ifndef __LIBDFA_RW_H
#define __LIBDFA_RW_H
#ifdef __cplusplus
# define BEGIN_C_DECLS extern "C" {
# define END_C_DECLS }
#else /* !__cplusplus */
# define BEGIN_C_DECLS
# define END_C_DECLS
#endif /* __cplusplus */
BEGIN_C_DECLS
typedef struct {