Changeset - d1ba36f30e32
[Not reviewed]
default
1 4 0
Nathan Brink (binki) - 15 years ago 2010-07-22 20:58:35
ohnobinki@ohnopublishing.net
Re-add the ``client'' to the buildsystem and remove the pointless free() and malloc() substitution attempt.
5 files changed with 33 insertions and 44 deletions:
0 comments (0 inline, 0 general)
Makefile.am
Show inline comments
 
@@ -3,19 +3,21 @@ ACLOCAL_AMFLAGS = -I m4
 

	
 
AM_CPPFLAGS = -DSYSCONFDIR='"$(sysconfdir)"' \
 
	-DLOCALSTATEDIR='"$(localstatedir)"' \
 
	-I$(top_srcdir)/src
 
AM_CFLAGS = $(DISTLIBS_CFLAGS)
 
LIBS = $(DISTLIBS_LIBS)
 
LDADD = libdistrencommon.la
 

	
 
bin_PROGRAMS = 
 
bin_PROGRAMS = distren
 
if ENABLE_SERVER
 
bin_PROGRAMS += distrend distrenslave distrensimpleslave
 
endif
 

	
 
include_HEADERS = src/client/distren.h
 

	
 
lib_LTLIBRARIES = libdistren.la
 
pkglib_LTLIBRARIES = libdistrencommon.la
 

	
 
# libdistrencommon.la:
 
libdistrencommon_la_SOURCES = src/common/asprintf.c src/common/asprintf.h \
 
	src/common/execio.c src/common/execio.h \
 
	src/common/misc.c src/common/misc.h \
 
@@ -26,12 +28,24 @@ libdistrencommon_la_SOURCES = src/common
 
	src/common/remoteio.c src/common/libremoteio.h \
 
	src/common/request.c src/common/request.h
 
#see http://sources.redhat.com/autobook/autobook/autobook_91.html
 
# either increase the revision number or the interface number each release!
 
libdistrencommon_la_LDFLAGS = $(AM_LDFLAGS) -version-info 0:0:0
 

	
 
#library client
 
libdistren_la_SOURCES = \
 
	src/client/libdistren.c src/client/libdistren.h \
 
	src/client/libdistren_config.c \
 
	src/client/libdistren_job.c
 
libdistren_la_LIBADD = libdistrencommon.la
 

	
 
#CLI client.
 
distren_SOURCES = \
 
	src/client/distren.c
 
distren_LDADD = libdistrencommon.la libdistren.la
 

	
 
# shared server sources:
 
SERVER_SOURCES = \
 
	src/server/slavefuncs.c	src/server/slavefuncs.h \
 
	src/server/distrenjob.c	src/server/distrenjob.h
 
# distrend:
 
distrend_CFLAGS = $(AM_CFLAGS) $(MYSQL_CFLAGS)
src/client/libdistren.c
Show inline comments
 
@@ -79,9 +79,9 @@ int distren_submit_file(distren_t handle
 

	
 
/**
 

	
 
 */
 
int distren_free(distren_t handle)
 
{
 
  _free(handle, handle);
 
  free(handle);
 
  return 0;
 
}
src/client/libdistren.h
Show inline comments
 
@@ -23,18 +23,22 @@
 
/*
 
  Private definitions for libdistren.
 
 */
 

	
 
#include "distren.h"
 

	
 
#include "common/multiio.h"
 

	
 
struct distren
 
{
 
  distren_malloc_t malloc;
 
  distren_free_t free;
 
  struct options_common *options; /*< use a pointer just to avoid #include "options.h"? */
 
  char *server;
 

	
 
  multiio_context_t multiio;
 
};
 

	
 
struct distren_job
 
{
 
  char *jobid;
 
};
 
@@ -59,19 +63,23 @@ void *_malloc(distren_t distren, size_t 
 
/**
 
   All of libdisren should use this instead of malloc.h's free()
 
*/
 
void _free(distren_t distren, void *tofree);
 

	
 
/**
 
   Sets up the distren handle with information garnered from
 
   configuration files, etc. Uses the environment variable
 
   DISTREN_CONFIG or the built-in default config file location.
 
 * Sets up the distren handle with information garnered from
 
 * configuration files, etc. Uses the environment variable
 
 * DISTREN_CONFIG or the built-in default config file location.
 
 *
 
 * Also initializes multiio.
 
 */
 
int _distren_getoptions(distren_t handle);
 

	
 
/**
 
   Unsets-up the distren handle with options loadable from a config file.
 
 * Unsets-up the distren handle with options loadable from a config file.
 
 *
 
 * Also unloads multiio.
 
 */
 
int _distren_loseoptions(distren_t handle);
 

	
 
#endif
 

	
src/client/libdistren_config.c
Show inline comments
 
@@ -36,13 +36,15 @@ int _distren_getoptions(distren_t handle
 
  cfg_opt_t cfg_opts[] =
 
    {
 
      CFG_STR("server", NULL, 0),
 
      CFG_END()
 
    };
 
  
 
  if(options_init(0, NULL, &cfg, cfg_opts, "client", &handle->options))
 
  handle->multiio = multiio_context_new();
 

	
 
  if(options_init(0, NULL, &cfg, cfg_opts, "client", &handle->options, handle->multiio))
 
    {
 
      fprintf(stderr, "error getting configuration\n");
 
      return 1;
 
    }
 
  
 
  handle->server = cfg_getstr(cfg, "server");
 
@@ -54,9 +56,10 @@ int _distren_getoptions(distren_t handle
 
/**
 
@todo stubish
 
 */
 
int _distren_loseoptions(distren_t handle)
 
{
 
  options_free(handle->options);
 
  multiio_context_free(handle->multiio);
 
  
 
  return 0;
 
}
src/client/libdistren_unbias.c
Show inline comments
 
deleted file
0 comments (0 inline, 0 general)