Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/fakefeed.c
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
#ifdef __cplusplus
extern "C"{
#endif
#include <stdio.h>
#include <stdlib.h>
#include <time.h>

#include "fakefeed.h"
#ifdef __cplusplus
}
#endif

#define arraylen(x) (sizeof(x)/sizeof(*(x)))
#define itemfrom(x) x[rand()%arraylen(x)]
Expand Down
18 changes: 11 additions & 7 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,35 +11,36 @@
//
// AquaQ Analytics
// kdb+ consultancy, training and support

#ifdef __cplusplus
extern "C"{
#endif
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <string.h>
#include <time.h>

// We define two custom thread and socket types (thread_t and socket_t based on the operating
// system that we are based on).
#ifdef WIN32
#include <winsock2.h>
#include <windows.h>
#include <process.h>

#define thread_t HANDLE;
#define socket_t SOCKET;
#define thread_t HANDLE
#define socket_t SOCKET
#else
#include <pthread.h>
#include <unistd.h>

#define thread_t pthread_t;
#define socket_t int;
#define thread_t pthread_t
#define socket_t int
#endif

#define KXVER 3
#include "k.h"
#include "socketpair.h"
#include "fakefeed.h"


thread_t thread;
socket_t sockets[2];

Expand Down Expand Up @@ -233,3 +234,6 @@ K halt(K x)

return (K) 0;
}
#ifdef __cplusplus
}
#endif