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 34 insertions and 45 deletions:
0 comments (0 inline, 0 general)
Makefile.am
Show inline comments
 
@@ -6,13 +6,15 @@ AM_CPPFLAGS = -DSYSCONFDIR='"$(sysconfdi
 
	-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:
 
@@ -29,6 +31,18 @@ libdistrencommon_la_SOURCES = src/common
 
# 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/client/libdistren.c
Show inline comments
 
@@ -82,6 +82,6 @@ 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
 
@@ -26,12 +26,16 @@
 

	
 
#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
 
@@ -62,14 +66,18 @@ void *_malloc(distren_t distren, size_t 
 
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);
 

	
src/client/libdistren_config.c
Show inline comments
 
@@ -38,8 +38,10 @@ int _distren_getoptions(distren_t handle
 
      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;
 
@@ -57,6 +59,7 @@ int _distren_getoptions(distren_t handle
 
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)