diff --git a/src/zmapNoThreads/README b/src/zmapNoThreads/README deleted file mode 100755 index a98ad970f408310708652423298bb3ac89cfcc4e..0000000000000000000000000000000000000000 --- a/src/zmapNoThreads/README +++ /dev/null @@ -1,11 +0,0 @@ -================================================================================ -No threads - -A non-threaded, non-server version of the calls to get data from a database. - -This is (hopefully) a cheap and cheerful way to integrate zmap into acedb without -compromising the zmap design too much. - -We replicate the zmapConn interface but with direct calls to the attached database. - - diff --git a/src/zmapNoThreads/makefile b/src/zmapNoThreads/makefile deleted file mode 100755 index 853a3248de420f0e0139daae4e29a7094dec4e88..0000000000000000000000000000000000000000 --- a/src/zmapNoThreads/makefile +++ /dev/null @@ -1,49 +0,0 @@ -# -# Makes the manager part of the ZMap application. -# - - -# -# point to common make include file which contains all the rules etc. -# -ROOT_DIRECTORY = .. -MAKE_DIR = $(ROOT_DIRECTORY)/zmapMake - - -# local macros -PUB_HDRS = zmapSys.h zmapConn.h -APP_PRIV_HDRS = zmapConnNoThr_P.h -APP_SRC = zmapConnNoThr.c -APP_OBJ = zmapConnNoThr.o - -# the main routines will need some different treatment maybe...???? try putting -# them all together, don't know if it will work..... - -# -# These must all be set for the common includes to work. -# -CURRENT_LIB = $(ZMAPNOTHR_LIB) -CURRENT_OBJ = $(APP_OBJ) -CURRENT_DEP = $(PUB_HDRS) $(APP_PRIV_HDRS) -CURRENT_SRC = $(APP_PRIV_HDRS) $(APP_SRC) - -# -# include all common defines -# -include $(MAKE_DIR)/common.defs - - -# -# override any of the common defines that you need to here... -# - - -# -# include all common targets -# -include $(MAKE_DIR)/common.targets - - -# -# include your own targets here. -# diff --git a/src/zmapNoThreads/zmapConnNoThr.c b/src/zmapNoThreads/zmapConnNoThr.c deleted file mode 100755 index c500a564c0e37057eaa5c274ebad1a80e98d4dd7..0000000000000000000000000000000000000000 --- a/src/zmapNoThreads/zmapConnNoThr.c +++ /dev/null @@ -1,158 +0,0 @@ -/* File: zmapthrcontrol.c - * Author: Ed Griffiths (edgrif@sanger.ac.uk) - * Copyright (c) Sanger Institute, 2003 - *------------------------------------------------------------------- - * ZMap is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * or see the on-line version at http://www.gnu.org/copyleft/gpl.txt - *------------------------------------------------------------------- - * This file is part of the ZMap genome database package - * and was written by - * Ed Griffiths (Sanger Institute, UK) edgrif@sanger.ac.uk and - * Rob Clack (Sanger Institute, UK) rnc@sanger.ac.uk - * - * Description: - * Exported functions: See zmapConn.h - * HISTORY: - * Last edited: Dec 14 09:42 2004 (edgrif) - * Created: Thu Jul 24 14:37:18 2003 (edgrif) - * CVS info: $Id: zmapConnNoThr.c,v 1.11 2004-12-15 14:10:45 edgrif Exp $ - *------------------------------------------------------------------- - */ - -#include <ZMap/zmapSys.h> -#include <zmapConnNoThr_P.h> - -/* temp. */ -extern char *testGetData(void) ; - -/* Turn on/off all debugging messages for threads. */ -gboolean zmap_thr_debug_G = TRUE ; - - -/* NEEDED */ -ZMapConnection zMapConnCreate(char *machine, int port, char *protocol, - int timeout, char *version, - char *sequence, int start, int end, GData *types, - ZMapProtocolAny initial_request) -{ - ZMapConnection connection ; - int status ; - - connection = g_new0(ZMapConnectionStruct, 1) ; - - connection->machine = g_strdup(machine) ; - connection->port = port ; - connection->sequence = g_strdup(sequence) ; - connection->thread_id = (void *)connection ; - connection->request.state = ZMAP_REQUEST_WAIT ; - connection->reply.state = ZMAP_REPLY_WAIT ; - - return connection ; -} - - - -/* NEEDED */ -void zMapConnLoadData(ZMapConnection connection, gchar *data) -{ - connection->request.state = ZMAP_REQUEST_GETDATA ; - - /* call acedb routine to get the data. */ - connection->reply.data = testGetData() ; - - connection->reply.state = ZMAP_REPLY_GOTDATA ; - - return ; -} - - - -#ifdef ED_G_NEVER_INCLUDE_THIS_CODE -gboolean zMapConnGetReply(ZMapConnection connection, ZMapThreadReply *state) -{ - gboolean got_value = TRUE ; - - *state = connection->reply.state ; - - return got_value ; -} -#endif /* ED_G_NEVER_INCLUDE_THIS_CODE */ - - - -/* NEEDED */ -void zMapConnSetReply(ZMapConnection connection, ZMapThreadReply state) -{ - connection->reply.state = state ; - - return ; -} - -/* NEEDED */ -gboolean zMapConnGetReplyWithData(ZMapConnection connection, ZMapThreadReply *state, - void **data, char **err_msg) -{ - gboolean got_value = TRUE ; - - *state = connection->reply.state ; - *data = connection->reply.data ; - *err_msg = connection->reply.error_msg ; - - return got_value ; -} - -/* NEEDED */ -/* We need to hack this to have the process number or something like that....actually the - * address of the connection would do..... */ -void *zMapConnGetThreadid(ZMapConnection connection) -{ - return connection->thread_id ; -} - - -/* NEEDED */ -/* Kill the thread by cancelling it, as this will asynchronously we cannot release the connections - * resources in this call. */ -void zMapConnKill(ZMapConnection connection) -{ - int status ; - - ZMAP_THR_DEBUG(("GUI: killing and destroying connection for thread %x\n", connection->thread_id)) ; - - /* code here did a pthread_cancel only, so nothing to be done here.... */ - - return ; -} - - -/* NEEDED */ -/* Release the connections resources, don't do this until the slave thread has gone. */ -void zMapConnDestroy(ZMapConnection connection) -{ - g_free(connection->machine) ; - g_free(connection->sequence) ; - - g_free(connection) ; - - return ; -} - - - - -/* - * --------------------- Internal routines ------------------------------ - */ - diff --git a/src/zmapNoThreads/zmapConnNoThr_P.h b/src/zmapNoThreads/zmapConnNoThr_P.h deleted file mode 100755 index 895b8f6cd05b8f00813b7a2101df672d99a82ca3..0000000000000000000000000000000000000000 --- a/src/zmapNoThreads/zmapConnNoThr_P.h +++ /dev/null @@ -1,89 +0,0 @@ -/* File: zmapConn_P.h - * Author: Ed Griffiths (edgrif@sanger.ac.uk) - * Copyright (c) Sanger Institute, 2003 - *------------------------------------------------------------------- - * ZMap is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * or see the on-line version at http://www.gnu.org/copyleft/gpl.txt - *------------------------------------------------------------------- - * This file is part of the ZMap genome database package - * and was written by - * Rob Clack (Sanger Institute, UK) rnc@sanger.ac.uk, - * Ed Griffiths (Sanger Institute, UK) edgrif@sanger.ac.uk and - * Simon Kelley (Sanger Institute, UK) srk@sanger.ac.uk - * - * Description: - * Exported functions: See XXXXXXXXXXXXX.h - * HISTORY: - * Last edited: Nov 19 11:48 2003 (edgrif) - * Created: Thu Jul 24 14:36:08 2003 (edgrif) - * CVS info: $Id: zmapConnNoThr_P.h,v 1.1 2004-03-03 12:28:43 edgrif Exp $ - *------------------------------------------------------------------- - */ -#ifndef ZMAP_CONN_PRIV_H -#define ZMAP_CONN_PRIV_H - -#include <glib.h> - -#ifdef ED_G_NEVER_INCLUDE_THIS_CODE -#include <ZMap/zmapSys.h> -#endif /* ED_G_NEVER_INCLUDE_THIS_CODE */ - -#include <ZMap/zmapConn.h> - - -#define ZMAP_THR_DEBUG(ALL_ARGS_WITH_BRACKETS) \ -do { \ - if (zmap_thr_debug_G) \ - printf ALL_ARGS_WITH_BRACKETS ; \ - } while (0) - - -typedef struct -{ - ZMapThreadRequest state ; /* Contains request to slave. */ -} ZMapRequestStruct, *ZMapRequest ; - -/* Replies via a simpler mutex. */ -typedef struct -{ - ZMapThreadReply state ; /* Contains reply from slave. */ - char *data ; /* May also contain data for some replies. */ - char *error_msg ; /* May contain error message for when - thread fails. */ -} ZMapReplyStruct, *ZMapReply ; - - - -/* The ZMapConnection, there is one per connection to a database, i.e. one per slave - * thread. */ -typedef struct _ZMapConnectionStruct -{ - /* These are read only after creation of the thread. */ - gchar *machine ; - int port ; - gchar *sequence ; - char *thread_id ; /* will contain connect addr. */ - - - /* These control the communication between the GUI thread and the connection threads, - * they are mutex locked and the request code makes use of the condition variable. */ - ZMapRequestStruct request ; /* GUIs request. */ - ZMapReplyStruct reply ; /* Slaves reply. */ - -} ZMapConnectionStruct ; - - - -#endif /* !ZMAP_CONN_PRIV_H */