Commit f9e81512 authored by John DuBois's avatar John DuBois

[1324]

Changed PROGNAME to static char *
Build program modules as C files
Removed malloc.h
parent a4c51111
......@@ -25,6 +25,7 @@ static void initialize(void);
// The current version information
const char* VERSION = "perfdhcp v1.0 2011-10-30";
static const char* PROGNAME = "perfdhcp";
static int v6 = 0; // DHCPv6 operation (-6)
static int initialOnly = 0; // Do only initial exchange (-i)
......
......@@ -17,6 +17,10 @@
#ifndef CLOPTIONS_H
#define CLOPTIONS_H
#ifdef __cplusplus
extern "C" {
#endif
#include <stdint.h>
#include "procconf.h"
......@@ -46,4 +50,8 @@ const char* getServer(void); // Server to contact
const char* getLocalName(void); // Local host/interface (-l)
const char* getMaxDrop(void); // Max dropped responses (-D)
#ifdef __cplusplus
}
#endif
#endif
......@@ -21,8 +21,6 @@
extern "C" {
#endif
#define PROGNAME "perfdhcp"
/*
* The masks associated with keyletters, used in dkdesc structures for setup
* and passed in the diag_req argument to the output/test functions to
......
......@@ -15,7 +15,6 @@
*/
#include <string.h>
#include <malloc.h>
#include <stdlib.h>
#include <stdio.h>
#include <ctype.h>
......@@ -309,7 +308,7 @@ procCmdLineArgs(int* argc, const char** argv[], const confvar_t optConf[],
*p = '\0';
optind = 1;
while ((optchar = getopt(*argc, const_cast<char**>(*argv), optstr)) != -1)
while ((optchar = getopt(*argc, *argv, optstr)) != -1)
{
int ind;
int ret;
......
......@@ -22,6 +22,10 @@
#ifndef PROCCONF_H
#define PROCCONF_H
#ifdef __cplusplus
extern "C" {
#endif
#include <limits.h> /* for UINT_MAX */
/*
......@@ -125,4 +129,8 @@ procOpts(int* argc, const char** argv[], const confvar_t optConf[],
*/
void confdataFree(confdata_t *confdata);
#ifdef __cplusplus
}
#endif
#endif
......@@ -15,9 +15,9 @@ if HAVE_GTEST
TESTS += run_unittests
run_unittests_SOURCES = run_unittests.cc
run_unittests_SOURCES += cloptions_unittest.cc
run_unittests_SOURCES += $(top_builddir)/tests/tools/perfdhcp/cloptions.cc
run_unittests_SOURCES += $(top_builddir)/tests/tools/perfdhcp/procconf.cc
run_unittests_SOURCES += $(top_builddir)/tests/tools/perfdhcp/dkdebug.cc
run_unittests_SOURCES += $(top_builddir)/tests/tools/perfdhcp/cloptions.c
run_unittests_SOURCES += $(top_builddir)/tests/tools/perfdhcp/procconf.c
run_unittests_SOURCES += $(top_builddir)/tests/tools/perfdhcp/dkdebug.c
run_unittests_CPPFLAGS = $(AM_CPPFLAGS) $(GTEST_INCLUDES)
run_unittests_LDFLAGS = $(AM_LDFLAGS) $(GTEST_LDFLAGS)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment