Commit 3fbf812f authored by unknown's avatar unknown
Browse files

Remove unneeded module "com"


BitKeeper/deleted/.del-Makefile.am~2b013aa835a140c4:
  Delete: innobase/com/Makefile.am
BitKeeper/deleted/.del-com0com.c~473a1f0f440ce91b:
  Delete: innobase/com/com0com.c
BitKeeper/deleted/.del-com0shm.c~6a16f0c3d81de1f:
  Delete: innobase/com/com0shm.c
BitKeeper/deleted/.del-makefilewin~3e26f0df100887f2:
  Delete: innobase/com/makefilewin
BitKeeper/deleted/.del-com0com.h~533a7eaa16ec585a:
  Delete: innobase/include/com0com.h
BitKeeper/deleted/.del-com0com.ic~671e309916e285b:
  Delete: innobase/include/com0com.ic
BitKeeper/deleted/.del-com0shm.h~5f3df7c04221b0fe:
  Delete: innobase/include/com0shm.h
BitKeeper/deleted/.del-com0shm.ic~f827cfca1603fa6b:
  Delete: innobase/include/com0shm.ic
innobase/configure.in:
  Remove com/Makefile
innobase/include/Makefile.am:
  Remove com*.h
innobase/include/usr0sess.h:
  Remove unused communication functions
innobase/include/usr0sess.ic:
  Remove unused communication functions
innobase/include/usr0types.h:
  Remove sess_sys_t and sess_sig_t
innobase/usr/usr0sess.c:
  Remove unused functions
innobase/dict/dict0crea.c:
  Remove unneeded params of que_fork_start_command()
innobase/include/que0que.h:
  Remove unneeded params of que_fork_start_command()
innobase/row/row0mysql.c:
  Remove unneeded params of que_fork_start_command()
innobase/include/srv0srv.h:
  Remove references to the com module
innobase/srv/srv0srv.c:
  Remove references to the com module
  Remove unused vars srv_n_{com,worker}_threads
  Make some global vars static
innobase/que/que0que.c:
  Remove references to odbc
  Add #ifdef UNIV_SYNC_DEBUG around some ut_ad()
  Remove unneeded params of que_fork_start_command()
  Remove unreachable code
  Output diagnostics to stderr, not stdout
innobase/include/trx0trx.h:
  Remove unneeded params of trx_sig_send() and trx_sig_reply()
innobase/trx/trx0trx.c:
  Remove unneeded params of trx_sig_send() and trx_sig_reply()
  Remove params of sess_open()
innobase/srv/srv0start.c:
  Remove reference to com0com.h
  Remove call to sess_sys_init_at_db_start()
innobase/trx/trx0purge.c:
  Remove references to the com module
  Remove params of sess_open()
  Remove unneeded params of que_fork_start_command()
innobase/trx/trx0roll.c:
  Remove params of sess_open()
  Remove unneeded params of que_fork_start_command()
  Remove unneeded params of trx_sig_send() and trx_sig_reply()
parent 4d47802f
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -22,7 +22,7 @@ TAR = gtar

noinst_HEADERS = ib_config.h

SUBDIRS =		os ut btr buf com data dict dyn eval fil fsp fut \
SUBDIRS =		os ut btr buf data dict dyn eval fil fsp fut \
			ha ibuf include lock log mach mem mtr page \
			pars que read rem row srv sync thr trx usr

innobase/com/Makefile.am

deleted100644 → 0
+0 −24
Original line number Diff line number Diff line
# Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
# & Innobase Oy
# 
# This program 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

include ../include/Makefile.i

noinst_LIBRARIES =	libcom.a

libcom_a_SOURCES =	com0com.c com0shm.c

EXTRA_PROGRAMS =	

innobase/com/com0com.c

deleted100644 → 0
+0 −345
Original line number Diff line number Diff line
/******************************************************
The communication primitives

(c) 1995 Innobase Oy

Created 9/23/1995 Heikki Tuuri
*******************************************************/

#include "com0com.h"
#ifdef UNIV_NONINL
#include "com0com.ic"
#endif

#include "mem0mem.h"
#include "com0shm.h"

/*
	IMPLEMENTATION OF COMMUNICATION PRIMITIVES
	==========================================

The primitives provide a uniform function interface for
use in communication. The primitives have been modeled
after the Windows Sockets interface. Below this uniform
API, the precise methods of communication, for example,
shared memory or Berkeley sockets, can be implemented
as subroutines.
*/

struct com_endpoint_struct{
	ulint	type;		/* endpoint type */
	void*	par;		/* type-specific data structures */
	ibool	bound;		/* TRUE if the endpoint has been
				bound to an address */
};

/*************************************************************************
Accessor functions for an endpoint */
UNIV_INLINE
ulint
com_endpoint_get_type(
/*==================*/
	com_endpoint_t*	ep)
{
	ut_ad(ep);
	return(ep->type);
}

UNIV_INLINE
void
com_endpoint_set_type(
/*==================*/
	com_endpoint_t*	ep,
	ulint		type)
{
	ut_ad(ep);
	ut_ad(type == COM_SHM);

	ep->type = type;
}

UNIV_INLINE
void*
com_endpoint_get_par(
/*=================*/
	com_endpoint_t*	ep)
{
	ut_ad(ep);
	return(ep->par);
}

UNIV_INLINE
void
com_endpoint_set_par(
/*=================*/
	com_endpoint_t*	ep,
	void*		par)
{
	ut_ad(ep);
	ut_ad(par);

	ep->par = par;
}

UNIV_INLINE
ibool
com_endpoint_get_bound(
/*===================*/
	com_endpoint_t*	ep)
{
	ut_ad(ep);
	return(ep->bound);
}

UNIV_INLINE
void
com_endpoint_set_bound(
/*===================*/
	com_endpoint_t*	ep,
	ibool		bound)
{
	ut_ad(ep);

	ep->bound = bound;
}


/*************************************************************************
Creates a communications endpoint. */

com_endpoint_t*
com_endpoint_create(
/*================*/
			/* out, own: communications endpoint, NULL if
			did not succeed */
	ulint	type)	/* in: communication type of endpoint:
			only COM_SHM supported */
{
	com_endpoint_t*	ep;
	void*		par;

	ep = mem_alloc(sizeof(com_endpoint_t));
	
	com_endpoint_set_type(ep, type);
	com_endpoint_set_bound(ep, FALSE);
	
	if (type == COM_SHM) {
		par = com_shm_endpoint_create();
		com_endpoint_set_par(ep, par);
	} else {
		par = NULL;
		ut_error;
	}

	if (par != NULL) {
		return(ep);
	} else {
		mem_free(ep);
		return(NULL);
	}
}

/*************************************************************************
Frees a communications endpoint. */

ulint
com_endpoint_free(
/*==============*/
				/* out: O if succeed, else error number */
	com_endpoint_t*	ep)	/* in, own: communications endpoint */
{
	ulint	type;
	ulint	ret;
	void*	par;

	type = com_endpoint_get_type(ep);
	par  = com_endpoint_get_par(ep);

	if (type == COM_SHM) {
		ret = com_shm_endpoint_free((com_shm_endpoint_t*)par);
	} else {
		ret = 0;
		ut_error;
	}

	if (ret) {
		return(ret);
	} else {
		mem_free(ep);
		return(0);
	}
}

/*************************************************************************
Sets an option, like the maximum datagram size for an endpoint.
The options may vary depending on the endpoint type. */

ulint
com_endpoint_set_option(
/*====================*/
				/* out: 0 if succeed, else error number */
	com_endpoint_t*	ep,	/* in: endpoint */
	ulint		optno,	/* in: option number, only
				COM_OPT_MAX_DGRAM_SIZE currently supported */
	byte*		optval,	/* in: pointer to a buffer containing the
				option value to set */
	ulint		optlen)	/* in: option value buffer length */
{
	ulint	type;
	ulint	ret;
	void*	par;

	type = com_endpoint_get_type(ep);
	par  = com_endpoint_get_par(ep);

	if (type == COM_SHM) {
		ret = com_shm_endpoint_set_option((com_shm_endpoint_t*)par,
						  optno, optval, optlen);
	} else {
		ret = 0;
		ut_error;
	}

	return(ret);
}
	
/*************************************************************************
Binds a communications endpoint to the specified address. */

ulint
com_bind(
/*=====*/
				/* out: 0 if succeed, else error number */
	com_endpoint_t*	ep,	/* in: communications endpoint */
	char*		name,	/* in: address name */
	ulint		len)	/* in: name length */
{
	ulint	type;
	ulint	ret;
	void*	par;

	ut_ad(len <= COM_MAX_ADDR_LEN);

	if (com_endpoint_get_bound(ep)) {
		return(COM_ERR_ALREADY_BOUND);
	}

	type = com_endpoint_get_type(ep);
	par  = com_endpoint_get_par(ep);

	if (type == COM_SHM) {
		ret = com_shm_bind((com_shm_endpoint_t*)par, name, len);
	} else {
		ret = 0;
		ut_error;
	}

	if (ret == 0) {
		com_endpoint_set_bound(ep, TRUE);
	}		
	
	return(ret);
}

/*************************************************************************
Waits for a datagram to arrive at an endpoint. */

ulint
com_recvfrom(
/*=========*/
				/* out: 0 if succeed, else error number */
	com_endpoint_t*	ep,	/* in: communications endpoint */
	byte*		buf,	/* out: datagram buffer; the buffer is
				supplied by the caller */
	ulint		buf_len,/* in: datagram buffer length */
	ulint*		len,	/* out: datagram length */
	char*		from,	/* out: address name buffer; the buffer is
				supplied by the caller */
	ulint		from_len,/* in: address name buffer length */
	ulint*		addr_len)/* out: address name length */
{
	ulint	type;
	ulint	ret;
	void*	par;

	if (!com_endpoint_get_bound(ep)) {

		return(COM_ERR_NOT_BOUND);
	}

	type = com_endpoint_get_type(ep);
	par  = com_endpoint_get_par(ep);

	if (type == COM_SHM) {
		ret = com_shm_recvfrom((com_shm_endpoint_t*)par,
					buf, buf_len, len, from, from_len,
					addr_len);
	} else {
		ret = 0;

		ut_error;
	}

	return(ret);
}

/*************************************************************************
Sends a datagram to the specified destination. */

ulint
com_sendto(
/*=======*/
				/* out: 0 if succeed, else error number */
	com_endpoint_t*	ep,	/* in: communications endpoint */
	byte*		buf,	/* in: datagram buffer */
	ulint		len,	/* in: datagram length */
	char*		to,	/* in: address name buffer */
	ulint		tolen)	/* in: address name length */
{
	ulint	type;
	ulint	ret;
	void*	par;

	if (!com_endpoint_get_bound(ep)) {
		return(COM_ERR_NOT_BOUND);
	}

	type = com_endpoint_get_type(ep);
	par  = com_endpoint_get_par(ep);

	if (type == COM_SHM) {
		ret = com_shm_sendto((com_shm_endpoint_t*)par, buf, len,
								to, tolen);
	} else {
		ret = 0;
		ut_error;
	}

	return(ret);
}

/*************************************************************************
Gets the maximum datagram size for an endpoint. */

ulint
com_endpoint_get_max_size(
/*======================*/
				/* out: maximum size */
	com_endpoint_t*	ep)	/* in: endpoint */
{
	ulint	type;
	ulint	ret;
	void*	par;

	type = com_endpoint_get_type(ep);
	par  = com_endpoint_get_par(ep);

	if (type == COM_SHM) {
		ret = com_shm_endpoint_get_size((com_shm_endpoint_t*)par);
	} else {
		ret = 0;
		ut_error;
	}

	return(ret);
}

innobase/com/com0shm.c

deleted100644 → 0
+0 −1129

File deleted.

Preview size limit exceeded, changes collapsed.

innobase/com/makefilewin

deleted100644 → 0
+0 −12
Original line number Diff line number Diff line
include ..\include\makefile.i

com.lib: com0com.obj com0shm.obj
	lib -out:..\libs\com.lib com0com.obj com0shm.obj

com0com.obj: com0com.c
	$(CCOM) $(CFL) -c com0com.c

com0shm.obj: com0shm.c
	$(CCOM) $(CFL) -c com0shm.c

Loading