16 #include <sys/socket.h>
18 #include <netinet/in.h>
19 #include <netinet/tcp.h>
34 #define debug_printf(a, b)
36 #define GBCMS_TRANSACTION_TIMEOUT 60*60 // one hour timeout
37 #define MAX_QUEUE_LEN 5
39 #define GBCM_COMMAND_UNFOLD (GBTUM_MAGIC_NUMBER)
40 #define GBCM_COMMAND_GET_UPDATA (GBTUM_MAGIC_NUMBER+1)
41 #define GBCM_COMMAND_PUT_UPDATE (GBTUM_MAGIC_NUMBER+2)
42 #define GBCM_COMMAND_UPDATED (GBTUM_MAGIC_NUMBER+3)
43 #define GBCM_COMMAND_BEGIN_TRANSACTION (GBTUM_MAGIC_NUMBER+4)
44 #define GBCM_COMMAND_COMMIT_TRANSACTION (GBTUM_MAGIC_NUMBER+5)
45 #define GBCM_COMMAND_ABORT_TRANSACTION (GBTUM_MAGIC_NUMBER+6)
46 #define GBCM_COMMAND_INIT_TRANSACTION (GBTUM_MAGIC_NUMBER+7)
47 #define GBCM_COMMAND_FIND (GBTUM_MAGIC_NUMBER+8)
48 #define GBCM_COMMAND_CLOSE (GBTUM_MAGIC_NUMBER+9)
49 #define GBCM_COMMAND_KEY_ALLOC (GBTUM_MAGIC_NUMBER+11)
50 #define GBCM_COMMAND_UNDO (GBTUM_MAGIC_NUMBER+12)
51 #define GBCM_COMMAND_DONT_WAIT (GBTUM_MAGIC_NUMBER+13)
53 #define GBCM_COMMAND_SEND (GBTUM_MAGIC_NUMBER+0x1000)
54 #define GBCM_COMMAND_SEND_COUNT (GBTUM_MAGIC_NUMBER+0x2000)
55 #define GBCM_COMMAND_SETDEEP (GBTUM_MAGIC_NUMBER+0x3000)
56 #define GBCM_COMMAND_SETINDEX (GBTUM_MAGIC_NUMBER+0x4000)
57 #define GBCM_COMMAND_PUT_UPDATE_KEYS (GBTUM_MAGIC_NUMBER+0x5000)
58 #define GBCM_COMMAND_PUT_UPDATE_CREATE (GBTUM_MAGIC_NUMBER+0x6000)
59 #define GBCM_COMMAND_PUT_UPDATE_DELETE (GBTUM_MAGIC_NUMBER+0x7000)
60 #define GBCM_COMMAND_PUT_UPDATE_UPDATE (GBTUM_MAGIC_NUMBER+0x8000)
61 #define GBCM_COMMAND_PUT_UPDATE_END (GBTUM_MAGIC_NUMBER+0x9000)
62 #define GBCM_COMMAND_TRANSACTION_RETURN (GBTUM_MAGIC_NUMBER+0x100000)
63 #define GBCM_COMMAND_FIND_ERG (GBTUM_MAGIC_NUMBER+0x108000)
64 #define GBCM_COMMAND_KEY_ALLOC_RES (GBTUM_MAGIC_NUMBER+0x10b000)
65 #define GBCM_COMMAND_UNDO_CMD (GBTUM_MAGIC_NUMBER+0x10a0001)
72 return GBS_global_string(
"ARBDB %s error: %s (errcode=%s#%i)", clientserver, what_failed, rev_tag, sourceLine);
75 #define CLIENT_ERROR(reason) clientserver_error("client", reason, __LINE__)
76 #define SERVER_ERROR(reason) clientserver_error("server", reason, __LINE__)
77 #define COMM_ERROR(reason) clientserver_error("communication", reason, __LINE__)
79 #define CLIENT_RECEIVE_ERROR() CLIENT_ERROR("receive failed")
80 #define SERVER_RECEIVE_ERROR() SERVER_ERROR("receive failed")
81 #define COMM_RECEIVE_ERROR() COMM_ERROR("receive failed")
83 #define CLIENT_SEND_ERROR() CLIENT_ERROR("send failed")
84 #define SERVER_SEND_ERROR() SERVER_ERROR("send failed")
85 #define COMM_SEND_ERROR() COMM_ERROR("send failed")
87 #define CLIENT_SEND_ERROR_AT_ITEM(gb_item) CLIENT_ERROR(GBS_global_string("send failed (entry='%s')", GB_KEY(gb_item)))
148 char *panic_file =
NULp;
149 char *db_panic =
NULp;
157 "**** ARB DATABASE SERVER received a HANGUP SIGNAL ****\n"
158 "- Looking for file '%s'\n",
167 "- Could not read '%s' (Reason: %s)\n"
172 char *newline = strchr(db_panic,
'\n');
173 if (newline) newline[0] = 0;
175 fprintf(stderr,
"- Trying to save DATABASE in ASCII mode into file '%s'\n", db_panic);
179 if (error) fprintf(stderr,
"Error while saving '%s': %s\n", db_panic, error);
180 else fprintf(stderr,
"- DATABASE saved into '%s' (ASCII)\n", db_panic);
188 const int org_transaction_level = transaction_level;
190 transaction_level = 0;
192 if (error) error =
save_as(db_panic,
"a");
193 transaction_level = org_transaction_level;
205 error =
"reopen of server not allowed";
215 char *unix_name =
NULp;
242 fprintf(stderr,
"%s\n", error);
255 for (si=hs->
soci; si; si=si->
next) {
256 shutdown(si->
socket, SHUT_RDWR);
259 shutdown(hs->
hso, SHUT_RDWR);
291 buffer[i++] = (
long)gbd;
292 buffer[i++] = gbd->
index;
302 buffer[i++] = send_headera ? end : -1;
303 buffer[i++] = deep ? gbc->
d.
size : -1;
306 if (
gbcm_write(socket, (
const char *)buffer, i*
sizeof(
long))) {
314 for (
int index = 0; index < end; index++) {
315 buf2[index] = hdl[index].
flags;
325 for (
int index = 0; index < end; index++) {
330 if (error)
return error;
339 buffer[i++] = gbe->
info.
i;
341 if (
gbcm_write(socket, (
const char *)buffer, i*
sizeof(
long))) {
347 buffer[i++] = gbe->
size();
348 memsize = buffer[i++] = gbe->
memsize();
350 if (
gbcm_write(socket, (
const char *)buffer, i*
sizeof(
long))) {
361 #define RETURN_SERVER_FAULT_ON_BAD_ADDRESS(ptr) \
363 GB_ERROR error = GBK_test_address((long*)(ptr), GBTUM_MAGIC_NUMBER); \
365 GB_warningf("%s (%s, #%i)", error, __FILE__, __LINE__); \
366 return GBCM_SERVER_FAULT; \
378 long size =
gbcm_read(socket, (
char *)buffer,
sizeof(
long) * 3);
379 if (size !=
sizeof(
long) * 3) {
380 fprintf(stderr,
"receive failed header size\n");
384 fprintf(stderr,
"receive failed wrong command\n");
390 i =
sizeof(
long) * (i - 3);
392 size =
gbcm_read(socket, (
char *)buffer, i);
399 long index_pos = buffer[i++];
400 if (!gb_source && gbc && index_pos<gbc->d.nheader) {
419 if (stype !=
GB_DB) {
425 if (mode==-1)
goto dont_create_in_a_folded_container;
453 dont_create_in_a_folded_container :
462 long nheader = buffer[i++];
463 long nitems = buffer[i++];
469 size =
gbcm_read(socket, (
char *)buffer2, realsize);
470 if (size != realsize) {
474 if (gb2 && mode >= -1) {
479 if (nheader < gbc2->d.nheader) {
484 for (
long item = 0; item < nheader; item++) {
486 GBQUARK new_index = buffer2->key_quark;
487 if (new_index && !old_index) {
514 if (mode==0 && nitems<=1) {
522 for (
long item = 0; item < nitems; item++) {
532 if ((mode==0) && !gb_source) {
541 ge2->
info.
i = buffer[i++];
544 long realsize = buffer[i++];
545 long memsize = buffer[i++];
551 size =
gbcm_read(socket, storage, memsize);
552 if (size != memsize) {
553 fprintf(stderr,
"receive failed data\n");
563 memsize = buffer[i++];
566 size =
gbcm_read(socket, buffer2, memsize);
567 if (size != memsize) {
584 while ((!socinf->
dl) || (socinf->
dl->
next)) {
596 for (socinf = hs->
soci; socinf; socinf=socinf->
next) {
597 if (socinf->
socket == socket)
break;
601 while (!socinf->
dl || (socinf->
dl->
next)) {
610 for (socinf = hs->
soci; socinf; socinf=socinf->
next) {
614 for (socinf = hs->
soci; socinf; socinf=socinf->
next) {
643 buffer[1] = (
long)gbd;
652 for (
int index = 0; index < end; index++) {
661 buffer[1] = (
long)gbd;
664 const int SEND_HEADER = 0;
681 buffer[1] = (
long)gbd;
687 for (
int i=1; i<Main->
keycnt; i++) {
689 buffer[0] = key.
nref;
705 int index,
start, end;
719 if (index_pos[0]==-2) {
729 if (index_pos[0] >= 0) {
730 start = (
int)index_pos[0];
743 for (index = start; index < end; index++) {
779 if (
gbcm_read(socket, (
char *) buffer,
sizeof(
long) * 3) !=
sizeof(
long) * 3) {
782 gbd = (
GBDATA *) buffer[2];
804 for (cs[0] = cs_main[0]; cs[0]; cs[0]=cs_main[0]) {
805 cs_main[0] = cs[0]->
next;
806 buffer[0] = (
long)cs[0]->client_id;
807 buffer[1] = (
long)cs[0]->server_id;
862 FD_SET(socket, &set);
864 struct timeval timeout;
866 timeout.tv_usec = 100000;
872 GB_export_errorf(
"ARB_DB ERROR CLIENT TRANSACTION TIMEOUT, CLIENT DISCONNECTED (I waited %lu seconds)", timeout.tv_sec);
901 long client_clock = (
long)long_client_clock;
934 FD_SET(socket, &set);
943 GB_export_errorf(
"ARB_DB ERROR CLIENT TRANSACTION TIMEOUT, CLIENT DISCONNECTED (I waited %lu seconds)", timeout.tv_sec);
992 char *to_free =
NULp;
1022 if (to_free) free(to_free);
1025 if (to_free) free(to_free);
1075 else if (type ==
GB_INT) {
1090 buffer[0] = (
void *)gbd->index;
1092 gbcm_write(socket, (
const char *) buffer,
sizeof(
long) * 2);
1098 gbcm_write(socket, (
const char *) buffer,
sizeof(
long) * 2);
1135 fputs(
"Obsolete server function called\n", stderr);
1167 long len =
gbcm_read(con, (
char *)buf,
sizeof(
long) * 3);
1168 if (len ==
sizeof(
long) * 3) {
1169 long magic_number = buf[0];
1172 fprintf(stderr,
"Illegal Access\n");
1175 magic_number &= ~GBTUM_MAGIC_NUMBER_FILTER;
1198 if (wait_extra_time) {
1200 timeout.tv_usec = 100000;
1204 timeout.tv_usec = (hs->
timeout % 1000) * 1000;
1206 if (wait_extra_time) {
1219 FD_SET(hs->
hso, &set);
1220 FD_SET(hs->
hso, &setex);
1223 FD_SET(si->socket, &set);
1224 FD_SET(si->socket, &setex);
1236 if (anz==-1)
return false;
1237 if (!anz)
return false;
1241 if (FD_ISSET(hs->
hso, &set)) {
1245 Socinf *sptr = ARB_calloc<Socinf>(1);
1251 setsockopt(con, IPPROTO_TCP, TCP_NODELAY, (
char *)optval, 4);
1258 for (
Socinf *si=hs->
soci; si; si_last=si, si=si_next) {
1262 if (FD_ISSET(si->socket, &set)) {
1268 }
else if (!FD_ISSET(si->socket, &setex))
continue;
1272 if (close(si->socket)) {
1273 printf(
"aisc_accept_calls: ");
1274 printf(
"couldn't close socket errno = %i!\n", errno);
1291 fprintf(stdout,
"ARB_DB_SERVER: a client died abnormally\n");
1326 if (index_pos == -2) {
1333 for (
long item = 0; !irror && item<nitems; item++) {
1344 if (index_pos < 0) {
1377 if (
gbcm_read(socket, (
char *)&(buffer[0]),
sizeof(
long)*2) !=
sizeof(
long)*2) {
1380 gbd = (
GBDATA *)buffer[0];
1436 if (
gbcm_read(socket, (
char *)buffer,
sizeof(
long)*2) !=
sizeof(
long)*2) {
1440 long size = buffer[0];
1444 for (
int i=1; i<size; i++) {
1445 if (
gbcm_read(socket, (
char *)buffer,
sizeof(
long)*2) !=
sizeof(
long)*2) {
1451 KEY.
nref = buffer[0];
1462 freeset(KEY.
key, key);
1489 Main->
clock = server_clock;
1493 if (
gbcm_read(socket, (
char *)buffer,
sizeof(
long)*2) !=
sizeof(
long)*2) {
1509 switch (buffer[0]) {
1533 if (error)
return error;
1537 goto endof_gbcmc_begin_transaction;
1544 endof_gbcmc_begin_transaction :
1569 Main->
clock = server_clock;
1586 if (
gbcm_read(socket, (
char *)buffer, 2 *
sizeof(
long)) != 2 *
sizeof(
long)) {
1590 if (error)
return error;
1638 if (hs && hs->
soci) {
1670 bool inside =
false;
1691 clients = hs ? hs->
nsoc : 0;
1705 if (!
gbcm_read(socket, (
char *) readvar,
sizeof(
long) * 2)) {
1714 gb_unfold(gb_client, 0, (
int)readvar[0]);
1722 GB_internal_errorf(
"ARBDB fatal error: function '%s' may not be called in server",
function);
1892 if (user && strcmp(loginname, user->
username) == 0) {
1913 return GBS_global_string(
"Too many users in this database (user='%s')", loginname);
1944 if (user && strcmp(loginname, user->
username) == 0) {
1947 if (i) fprintf(stdout,
"User '%s' has logged out\n", loginname);
1963 static long lastpid = -1;
1971 if (lastpid != -25) {
1972 long pid = getpid();
1974 if (pid != lastpid) {
1978 const char *arb_pid =
GB_getenv(
"ARB_PID");
1981 if (!arb_pid) arb_pid =
"";
1993 fprintf(pidfile,
"%li ", pid);
GB_ERROR GB_begin_transaction(GBDATA *gbd)
static GBCM_ServerResult gbcms_write_keys(int socket, GBDATA *gbd)
#define GBCM_COMMAND_PUT_UPDATE_UPDATE
char * gbcm_read_string(int socket)
static __ATTR__USERESULT GB_ERROR gbcm_write_bin(int socket, GBDATA *gbd, long *buffer, long deep, int send_headera)
NOT4PERL GBDATA * GB_find_int(GBDATA *gbd, const char *key, long val, GB_SEARCH_TYPE gbs)
static GBCONTAINER * gbcms_gb_main
GB_ERROR clientserver_error(const char *clientserver, const char *what_failed, int sourceLine)
static GBCM_ServerResult gbcms_talking_undo(int socket, long *, void *, GBDATA *gbd)
#define GBCM_COMMAND_FIND
GBCM_ServerResult gbcm_write_flush(int socket)
GB_ERROR GB_commit_transaction(GBDATA *gbd)
char * GB_read_fp(FILE *in)
#define GBCM_COMMAND_PUT_UPDATE_DELETE
static TalkingFunction aisc_talking_functions[]
static GBCM_ServerResult gbcms_write_updated(int socket, GBDATA *gbd, long hsin, long client_clock, long *buffer)
#define RETURN_SERVER_FAULT_ON_BAD_ADDRESS(ptr)
static GBCM_ServerResult gbcms_talking_commit_transaction(int socket, long *, void *, GBDATA *gbd)
static void gbcms_shift_delete_list(void *hsi, void *soi)
long GBS_write_hash(GB_HASH *hs, const char *key, long val)
GB_ERROR gbcmc_send_undo_commands(GBDATA *gbd, enum gb_undo_commands command)
void gb_touch_header(GBCONTAINER *gbc)
#define GBCM_COMMAND_BEGIN_TRANSACTION
#define GBCM_COMMAND_KEY_ALLOC
#define INSTALL_SIGHANDLER(sig, handler, context)
gb_data_base_type_union info
bool inside_remote_action
GBDATA * GB_find(GBDATA *gbd, const char *key, GB_SEARCH_TYPE gbs)
GB_MAIN_TYPE * GB_MAIN(GBDATA *gbd)
static GBCM_ServerResult gbcms_talking_unfold(int socket, long *, void *, GBDATA *gb_in)
#define GBTUM_MAGIC_NUMBER_FILTER
GBCONTAINER * expect_container() const
gb_user * users[GB_MAX_USERS]
unsigned int folded_container
long gb_create_key(GB_MAIN_TYPE *Main, const char *key, bool create_gb_key)
GB_ERROR gbcmc_end_sendupdate(GBDATA *gbd)
long GBS_write_numhash(GB_NUMHASH *hs, long key, long val)
#define CLIENT_SEND_ERROR_AT_ITEM(gb_item)
#define ASSERT_RESULT(Type, Expected, Expr)
GBDATA * GBCMC_find(GBDATA *gbd, const char *key, GB_TYPES type, const char *str, GB_CASE case_sens, GB_SEARCH_TYPE gbs)
char * ARB_strdup(const char *str)
const char * GB_get_arb_revision_tag(void)
void GB_internal_errorf(const char *templat,...)
void touch_update(long udate)
GB_ERROR gbcmc_commit_transaction(GBDATA *gbd)
CONSTEXPR_INLINE GBCONTAINER * GB_GRANDPA(GBDATA *gbd)
const char * GBS_global_string(const char *templat,...)
void gb_write_index_key(GBCONTAINER *father, long index, GBQUARK new_index)
CONSTEXPR_INLINE gb_header_list * GB_DATA_LIST_HEADER(gb_data_list &dl)
GBCM_ServerResult gbcm_write(int socket, const char *ptr, long size)
#define CLIENT_RECEIVE_ERROR()
static void gbcms_sighup(int)
#define GBCM_COMMAND_PUT_UPDATE_END
GBCM_ServerResult gbcm_write_long(int socket, long data)
#define COMM_SEND_ERROR()
GB_MAIN_TYPE * GBCONTAINER_MAIN(GBCONTAINER *gbc)
#define GBCM_COMMAND_FIND_ERG
static void gb_delete_entry(GBCONTAINER *&gbc)
long creation_date() const
GB_ERROR gbcmc_sendupdate_update(GBDATA *gbd, int send_headera)
char buffer[MESSAGE_BUFFERSIZE]
#define GBCM_COMMAND_DONT_WAIT
GB_ERROR save_as(const char *as_path, const char *savetype)
static HelixNrInfo * start
#define GBCM_COMMAND_PUT_UPDATE
GB_ERROR GB_export_error(const char *error)
GB_ERROR GB_await_error()
static GBCM_ServerResult gbcm_read_bin(int socket, GBCONTAINER *gbc, long *buffer, long mode, GBDATA *gb_source, void *cs_main)
GBCM_ServerResult(* TalkingFunction)(int socket, long *hsin, void *sin, GBDATA *gbd)
GB_ERROR gb_unfold(GBCONTAINER *gbc, long deep, int index_pos)
static GBCM_ServerResult commit_or_abort_transaction(int socket, GBDATA *gbd, ARB_TRANS_TYPE commit_or_abort)
GBCM_ServerResult gbcm_read_two(int socket, long a, long *b, long *c)
static GBCM_ServerResult gbcms_talking_put_update(int socket, long *, void *, GBDATA *)
GB_CSTR GB_read_key_pntr(GBDATA *gbd)
GB_ERROR GB_set_undo_mem(GBDATA *gbd, long memsize)
GB_ERROR gbcmc_init_transaction(GBCONTAINER *gbc)
#define CLIENT_SEND_ERROR()
GB_HASH * key_2_index_hash
static GBCM_ServerResult gbcms_talking_disable_wait_for_new_request(int, long *hsin, void *, GBDATA *)
GB_ERROR gbcm_unfold_client(GBCONTAINER *gbc, long deep, long index_pos)
long gbcm_read(int socket, char *ptr, long size)
GB_BUFFER GB_give_buffer(size_t size)
static GBCM_ServerResult gbcms_talking_init_transaction(int socket, long *hsin, void *sin, GBDATA *)
static __ATTR__USERESULT GB_ERROR gbcmc_read_keys(int socket, GBDATA *gbd)
long GBS_read_numhash(GB_NUMHASH *hs, long key)
GB_ERROR gbcmc_sendupdate_create(GBDATA *gbd)
static GBCM_ServerResult gbcms_talking_updated(int, long *, void *, GBDATA *)
GB_ERROR gbcm_open_socket(const char *path, bool do_connect, int *psocket, char **unix_name)
static GBCM_ServerResult gbcms_talking(int con, long *hs, void *sin)
bool is_container() const
GB_ERROR GBCMS_open(const char *path, long timeout, GBDATA *gb_main)
static GBCM_ServerResult gbcms_talking_key_alloc(int socket, long *, void *, GBDATA *gbd)
long gbcm_read_long(int socket)
static void error(const char *msg)
GB_ERROR GB_abort_transaction(GBDATA *gbd)
FILE * GB_fopen_tempfile(const char *filename, const char *fmode, char **res_fullname)
GB_ERROR gb_delete_force(GBDATA *source)
GB_ERROR gbcms_add_to_delete_list(GBDATA *gbd)
char * GB_undo_info(GBDATA *gb_main, GB_UNDO_TYPE type)
GBCONTAINER * as_container() const
GB_write_int const char GB_write_autoconv_string WRITE_SKELETON(write_pointer, GBDATA *,"%p", GB_write_pointer) char *AW_awa if)(!gb_var) return strdup("")
void * gbm_get_mem(size_t size, long index)
static GBCM_ServerResult gbcms_talking_get_update(int, long *, void *, GBDATA *)
void gb_create_header_array(GBCONTAINER *gbc, int size)
#define GBCM_COMMAND_SETDEEP
GBCM_ServerResult gbcm_write_string(int socket, const char *key)
#define debug_printf(a, b)
CONSTEXPR_INLINE GBCONTAINER * GB_FATHER(GBDATA *gbd)
long gbcm_write_two(int socket, long a, long c)
static GBCM_ServerResult gbcms_talking_abort_transaction(int socket, long *, void *, GBDATA *gbd)
#define GBCM_COMMAND_PUT_UPDATE_CREATE
#define GBCM_COMMAND_INIT_TRANSACTION
gbcms_delete_list * del_last
GB_ERROR gbcmc_begin_transaction(GBDATA *gbd)
GB_ERROR gbcmc_sendupdate_delete(GBDATA *gbd)
ARB_TRANS_TYPE running_client_transaction
#define GBCM_COMMAND_UNDO_CMD
static GBCM_ServerResult gbcms_talking_find(int socket, long *, void *, GBDATA *gbd)
#define GBCM_COMMAND_UNFOLD
GB_ERROR GB_print_error()
int get_transaction_level() const
char * gbcmc_send_undo_info_commands(GBDATA *gbd, enum gb_undo_commands command)
GBENTRY * gb_make_entry(GBCONTAINER *father, const char *key, long index_pos, GBQUARK keyq, GB_TYPES type)
GB_CSTR GB_getenv(const char *env)
gbcms_delete_list * del_first
GB_ERROR GB_undo(GBDATA *gb_main, GB_UNDO_TYPE type) __ATTR__USERESULT
gb_server_data * server_data
fputs(TRACE_PREFIX, stderr)
GB_ERROR GB_export_errorf(const char *templat,...)
void GB_internal_error(const char *message)
TYPE * ARB_calloc(size_t nelem)
GB_ERROR GB_tell_server_dont_wait(GBDATA *gbd)
GBCONTAINER * gb_make_container(GBCONTAINER *father, const char *key, long index_pos, GBQUARK keyq)
#define GBTUM_MAGIC_NUMBER
#define GBCM_COMMAND_COMMIT_TRANSACTION
bool stored_external() const
#define assert_or_exit(cond)
#define GBCM_COMMAND_SETINDEX
GB_CSTR GB_getenvUSER(void)
static GBCM_ServerResult gbcms_write_deleted(int socket, long hsin, long client_clock, long *buffer)
void gb_save_extern_data_in_ts(GBENTRY *gbe)
#define GBCM_COMMAND_ABORT_TRANSACTION
#define GBCM_COMMAND_SEND
long GB_read_clients(GBDATA *gbd)
#define __ATTR__USERESULT
void touch_creation_and_update(long date)
GB_ERROR panic_save(const char *db_panic)
static GBCM_ServerResult gbcms_talking_begin_transaction(int socket, long *hsin, void *sin, GBDATA *long_client_clock)
#define GBCM_COMMAND_TRANSACTION_RETURN
static void g_bcms_delete_Socinf(Socinf *THIS)
GB_ERROR gbcm_logout(GB_MAIN_TYPE *Main, const char *loginname)
GB_BUFFER GB_give_buffer2(long size)
#define GBCMS_TRANSACTION_TIMEOUT
#define GBCM_COMMAND_CLOSE
static GBCM_ServerResult gbcms_talking_close(int, long *, void *, GBDATA *)
bool GB_is_server(GBDATA *gbd)
static void invalid_use_in_server(const char *function)
#define GBCM_COMMAND_SEND_COUNT
GBDATA * GB_find_string(GBDATA *gbd, const char *key, const char *str, GB_CASE case_sens, GB_SEARCH_TYPE gbs)
static GBCM_ServerResult gbcms_talking_obsolete(int, long *, void *, GBDATA *)
GBENTRY * as_entry() const
long gbcmc_key_alloc(GBDATA *gbd, const char *key)
static void dumpError(GB_ERROR error)
gbcmc_comm * gbcmc_open(const char *path)
void GB_set_remote_action(GBDATA *gbd, bool in_action)
bool GB_inside_remote_action(GBDATA *gbd)
#define GBCM_COMMAND_KEY_ALLOC_RES
void GBCMS_shutdown(GBDATA *gbd)
GB_ERROR GB_request_undo_type(GBDATA *gb_main, GB_UNDO_TYPE type) __ATTR__USERESULT_TODO
#define GBCM_COMMAND_PUT_UPDATE_KEYS
void gbm_free_mem(void *block, size_t size, long index)
const char * GB_KEY(GBDATA *gbd)
GB_ERROR gbcmc_abort_transaction(GBDATA *gbd)
static __ATTR__USERESULT GB_ERROR gbcmc_unfold_list(int socket, GBDATA *gbd)
void gb_touch_entry(GBDATA *gbd, GB_CHANGE val)
GBCM_ServerResult gbcmc_close(gbcmc_comm *link)
void gb_create_key_array(GB_MAIN_TYPE *Main, int index)
#define STATIC_ASSERT(const_expression)
void write_into_comm_buffer(long &buffer, T &t)
GB_ERROR gbcmc_begin_sendupdate(GBDATA *gbd)
GB_ERROR gbcm_login(GBCONTAINER *gb_main, const char *loginname)
#define CLIENT_ERROR(reason)
char * GBS_global_string_copy(const char *templat,...)
bool GBCMS_accept_calls(GBDATA *gbd, bool wait_extra_time)
#define GBCM_COMMAND_UNDO
bool GB_is_privatefile(const char *path, bool read_private)
GB_ERROR GB_install_pid(int mode)