aboutsummaryrefslogtreecommitdiff
path: root/libopt++
diff options
context:
space:
mode:
authorThe Android Open Source Project <initial-contribution@android.com>2008-10-21 07:00:00 -0700
committerThe Android Open Source Project <initial-contribution@android.com>2008-10-21 07:00:00 -0700
commit48ae5fc270ea3bbb965b4bd07cb1691a5c115642 (patch)
tree639ac5dd123a7fd28dfe4c86743b37c23b199b46 /libopt++
parentcc2ee177dbb3befca43e36cfc56778b006c3d050 (diff)
downloadoprofile-48ae5fc270ea3bbb965b4bd07cb1691a5c115642.tar.gz
Initial Contributionandroid-1.0release-1.0
Diffstat (limited to 'libopt++')
-rw-r--r--libopt++/Makefile.am5
-rw-r--r--libopt++/Makefile.in439
-rw-r--r--libopt++/popt_options.cpp321
-rw-r--r--libopt++/popt_options.h123
4 files changed, 0 insertions, 888 deletions
diff --git a/libopt++/Makefile.am b/libopt++/Makefile.am
deleted file mode 100644
index f175ce7..0000000
--- a/libopt++/Makefile.am
+++ /dev/null
@@ -1,5 +0,0 @@
-AM_CPPFLAGS=-I ${top_srcdir}/libutil++ -I ${top_srcdir}/libutil
-AM_CXXFLAGS = @OP_CXXFLAGS@
-
-noinst_LIBRARIES = libopt++.a
-libopt___a_SOURCES = popt_options.cpp popt_options.h
diff --git a/libopt++/Makefile.in b/libopt++/Makefile.in
deleted file mode 100644
index d0f7a8d..0000000
--- a/libopt++/Makefile.in
+++ /dev/null
@@ -1,439 +0,0 @@
-# Makefile.in generated by automake 1.9.5 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005 Free Software Foundation, Inc.
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
-@SET_MAKE@
-
-SOURCES = $(libopt___a_SOURCES)
-
-srcdir = @srcdir@
-top_srcdir = @top_srcdir@
-VPATH = @srcdir@
-pkgdatadir = $(datadir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-top_builddir = ..
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-INSTALL = @INSTALL@
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-subdir = libopt++
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/binutils.m4 \
- $(top_srcdir)/m4/builtinexpect.m4 \
- $(top_srcdir)/m4/compileroption.m4 \
- $(top_srcdir)/m4/configmodule.m4 \
- $(top_srcdir)/m4/copyifchange.m4 $(top_srcdir)/m4/docbook.m4 \
- $(top_srcdir)/m4/extradirs.m4 $(top_srcdir)/m4/findkernel.m4 \
- $(top_srcdir)/m4/kerneloption.m4 \
- $(top_srcdir)/m4/kernelversion.m4 \
- $(top_srcdir)/m4/mallocattribute.m4 \
- $(top_srcdir)/m4/poptconst.m4 \
- $(top_srcdir)/m4/precompiledheader.m4 $(top_srcdir)/m4/qt.m4 \
- $(top_srcdir)/m4/resultyn.m4 $(top_srcdir)/m4/sstream.m4 \
- $(top_srcdir)/m4/typedef.m4 $(top_srcdir)/configure.in
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
- $(ACLOCAL_M4)
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/config.h
-CONFIG_CLEAN_FILES =
-LIBRARIES = $(noinst_LIBRARIES)
-AR = ar
-ARFLAGS = cru
-libopt___a_AR = $(AR) $(ARFLAGS)
-libopt___a_LIBADD =
-am_libopt___a_OBJECTS = popt_options.$(OBJEXT)
-libopt___a_OBJECTS = $(am_libopt___a_OBJECTS)
-DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
-depcomp = $(SHELL) $(top_srcdir)/depcomp
-am__depfiles_maybe = depfiles
-CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
- $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
-CXXLD = $(CXX)
-CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \
- -o $@
-COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
- $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-CCLD = $(CC)
-LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
-SOURCES = $(libopt___a_SOURCES)
-DIST_SOURCES = $(libopt___a_SOURCES)
-ETAGS = etags
-CTAGS = ctags
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-ACLOCAL = @ACLOCAL@
-AMDEP_FALSE = @AMDEP_FALSE@
-AMDEP_TRUE = @AMDEP_TRUE@
-AMTAR = @AMTAR@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-BFD_LIBS = @BFD_LIBS@
-CAT_ENTRY_END = @CAT_ENTRY_END@
-CAT_ENTRY_START = @CAT_ENTRY_START@
-CC = @CC@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DATE = @DATE@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DOCBOOK_ROOT = @DOCBOOK_ROOT@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-EXTRA_CFLAGS_MODULE = @EXTRA_CFLAGS_MODULE@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-KINC = @KINC@
-KSRC = @KSRC@
-KVERS = @KVERS@
-LD = @LD@
-LDFLAGS = @LDFLAGS@
-LIBERTY_LIBS = @LIBERTY_LIBS@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LTLIBOBJS = @LTLIBOBJS@
-MAKEINFO = @MAKEINFO@
-MOC = @MOC@
-MODINSTALLDIR = @MODINSTALLDIR@
-OBJEXT = @OBJEXT@
-OPROFILE_DIR = @OPROFILE_DIR@
-OPROFILE_MODULE_ARCH = @OPROFILE_MODULE_ARCH@
-OP_CFLAGS = @OP_CFLAGS@
-OP_CXXFLAGS = @OP_CXXFLAGS@
-OP_DOCDIR = @OP_DOCDIR@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-POPT_LIBS = @POPT_LIBS@
-PTRDIFF_T_TYPE = @PTRDIFF_T_TYPE@
-QT_INCLUDES = @QT_INCLUDES@
-QT_LDFLAGS = @QT_LDFLAGS@
-QT_LIB = @QT_LIB@
-QT_VERSION = @QT_VERSION@
-RANLIB = @RANLIB@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-SIZE_T_TYPE = @SIZE_T_TYPE@
-STRIP = @STRIP@
-UIC = @UIC@
-VERSION = @VERSION@
-XML_CATALOG = @XML_CATALOG@
-XSLTPROC = @XSLTPROC@
-XSLTPROC_FLAGS = @XSLTPROC_FLAGS@
-X_CFLAGS = @X_CFLAGS@
-X_EXTRA_LIBS = @X_EXTRA_LIBS@
-X_LIBS = @X_LIBS@
-X_PRE_LIBS = @X_PRE_LIBS@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_RANLIB = @ac_ct_RANLIB@
-ac_ct_STRIP = @ac_ct_STRIP@
-am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
-am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
-am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
-am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build_alias = @build_alias@
-datadir = @datadir@
-enable_abi_FALSE = @enable_abi_FALSE@
-enable_abi_TRUE = @enable_abi_TRUE@
-exec_prefix = @exec_prefix@
-have_qt_FALSE = @have_qt_FALSE@
-have_qt_TRUE = @have_qt_TRUE@
-have_xsltproc_FALSE = @have_xsltproc_FALSE@
-have_xsltproc_TRUE = @have_xsltproc_TRUE@
-host_alias = @host_alias@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-kernel_support_FALSE = @kernel_support_FALSE@
-kernel_support_TRUE = @kernel_support_TRUE@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localstatedir = @localstatedir@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-sysconfdir = @sysconfdir@
-target_alias = @target_alias@
-topdir = @topdir@
-AM_CPPFLAGS = -I ${top_srcdir}/libutil++ -I ${top_srcdir}/libutil
-AM_CXXFLAGS = @OP_CXXFLAGS@
-noinst_LIBRARIES = libopt++.a
-libopt___a_SOURCES = popt_options.cpp popt_options.h
-all: all-am
-
-.SUFFIXES:
-.SUFFIXES: .cpp .o .obj
-$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
- @for dep in $?; do \
- case '$(am__configure_deps)' in \
- *$$dep*) \
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
- && exit 0; \
- exit 1;; \
- esac; \
- done; \
- echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign libopt++/Makefile'; \
- cd $(top_srcdir) && \
- $(AUTOMAKE) --foreign libopt++/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
- @case '$?' in \
- *config.status*) \
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
- *) \
- echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
- cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
- esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure: $(am__configure_deps)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4): $(am__aclocal_m4_deps)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-clean-noinstLIBRARIES:
- -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES)
-libopt++.a: $(libopt___a_OBJECTS) $(libopt___a_DEPENDENCIES)
- -rm -f libopt++.a
- $(libopt___a_AR) libopt++.a $(libopt___a_OBJECTS) $(libopt___a_LIBADD)
- $(RANLIB) libopt++.a
-
-mostlyclean-compile:
- -rm -f *.$(OBJEXT)
-
-distclean-compile:
- -rm -f *.tab.c
-
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/popt_options.Po@am__quote@
-
-.cpp.o:
-@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
-@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $<
-
-.cpp.obj:
-@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
-@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
-uninstall-info-am:
-
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
- list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) ' { files[$$0] = 1; } \
- END { for (i in files) print i; }'`; \
- mkid -fID $$unique
-tags: TAGS
-
-TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
- $(TAGS_FILES) $(LISP)
- tags=; \
- here=`pwd`; \
- list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) ' { files[$$0] = 1; } \
- END { for (i in files) print i; }'`; \
- if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
- test -n "$$unique" || unique=$$empty_fix; \
- $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
- $$tags $$unique; \
- fi
-ctags: CTAGS
-CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
- $(TAGS_FILES) $(LISP)
- tags=; \
- here=`pwd`; \
- list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) ' { files[$$0] = 1; } \
- END { for (i in files) print i; }'`; \
- test -z "$(CTAGS_ARGS)$$tags$$unique" \
- || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
- $$tags $$unique
-
-GTAGS:
- here=`$(am__cd) $(top_builddir) && pwd` \
- && cd $(top_srcdir) \
- && gtags -i $(GTAGS_ARGS) $$here
-
-distclean-tags:
- -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-
-distdir: $(DISTFILES)
- @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
- topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
- list='$(DISTFILES)'; for file in $$list; do \
- case $$file in \
- $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
- $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
- esac; \
- if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
- dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
- if test "$$dir" != "$$file" && test "$$dir" != "."; then \
- dir="/$$dir"; \
- $(mkdir_p) "$(distdir)$$dir"; \
- else \
- dir=''; \
- fi; \
- if test -d $$d/$$file; then \
- if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
- cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
- fi; \
- cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
- else \
- test -f $(distdir)/$$file \
- || cp -p $$d/$$file $(distdir)/$$file \
- || exit 1; \
- fi; \
- done
-check-am: all-am
-check: check-am
-all-am: Makefile $(LIBRARIES)
-installdirs:
-install: install-am
-install-exec: install-exec-am
-install-data: install-data-am
-uninstall: uninstall-am
-
-install-am: all-am
- @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-am
-install-strip:
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- `test -z '$(STRIP)' || \
- echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
- -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-
-maintainer-clean-generic:
- @echo "This command is intended for maintainers to use"
- @echo "it deletes files that may require special tools to rebuild."
-clean: clean-am
-
-clean-am: clean-generic clean-noinstLIBRARIES mostlyclean-am
-
-distclean: distclean-am
- -rm -rf ./$(DEPDIR)
- -rm -f Makefile
-distclean-am: clean-am distclean-compile distclean-generic \
- distclean-tags
-
-dvi: dvi-am
-
-dvi-am:
-
-html: html-am
-
-info: info-am
-
-info-am:
-
-install-data-am:
-
-install-exec-am:
-
-install-info: install-info-am
-
-install-man:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-am
- -rm -rf ./$(DEPDIR)
- -rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-am
-
-mostlyclean-am: mostlyclean-compile mostlyclean-generic
-
-pdf: pdf-am
-
-pdf-am:
-
-ps: ps-am
-
-ps-am:
-
-uninstall-am: uninstall-info-am
-
-.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
- clean-noinstLIBRARIES ctags distclean distclean-compile \
- distclean-generic distclean-tags distdir dvi dvi-am html \
- html-am info info-am install install-am install-data \
- install-data-am install-exec install-exec-am install-info \
- install-info-am install-man install-strip installcheck \
- installcheck-am installdirs maintainer-clean \
- maintainer-clean-generic mostlyclean mostlyclean-compile \
- mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \
- uninstall-am uninstall-info-am
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/libopt++/popt_options.cpp b/libopt++/popt_options.cpp
deleted file mode 100644
index a960e2e..0000000
--- a/libopt++/popt_options.cpp
+++ /dev/null
@@ -1,321 +0,0 @@
-/**
- * @file popt_options.cpp
- * option parsing
- *
- * @remark Copyright 2002 OProfile authors
- * @remark Read the file COPYING
- *
- * @author Philippe Elie
- * @author John Levon
- */
-
-#include <iostream>
-
-#include "op_popt.h"
-#include "op_version.h"
-
-#include "popt_options.h"
-#include "string_manip.h"
-
-using namespace std;
-
-namespace popt {
-
-/**
- * option_base - base class for implementation of a command line option
- *
- * Every command line option added before calling parse_options()
- * is of this type.
- */
-class option_base {
-public:
- /**
- * option_base - construct an option with the given options.
- * @param option_name name part of long form e.g. --option
- * @param short_name short form name e.g. -o
- * @param help_str short description of the option
- * @param arg_help_str short description of the argument (if any)
- * @param data a pointer to the data to fill in
- * @param popt_flags the popt library data type
- */
- option_base(char const * option_name, char short_name,
- char const * help_str, char const * arg_help_str,
- void * data, int popt_flags);
-
- virtual ~option_base() {}
-
- /**
- * post_process - perform any necessary post-processing
- */
- virtual void post_process() {}
-
-protected:
- char const * option_name;
-};
-
-
-/** the popt array singleton options */
-static vector<poptOption> popt_options;
-static vector<option_base *> options_list;
-
-static int showvers;
-
-static struct poptOption appended_options[] = {
- { "version", 'v', POPT_ARG_NONE, &showvers, 0, "show version", NULL, },
- POPT_AUTOHELP
- POPT_TABLEEND
- };
-
-
-/* options parameter can't be a local variable because caller can use the
- * returned poptContext which contains pointer inside the options array */
-static poptContext do_parse_options(int argc, char const ** argv,
- vector<poptOption> & options,
- vector<string> & additional_params)
-{
- options = popt_options;
-
- int const nr_appended_options =
- sizeof(appended_options) / sizeof(appended_options[0]);
-
- options.insert(options.end(), appended_options,
- appended_options + nr_appended_options);
-
- poptContext con = op_poptGetContext(NULL, argc, argv, &options[0], 0);
-
- if (showvers) {
- show_version(argv[0]);
- }
-
- char const * file;
- while ((file = poptGetArg(con)) != 0) {
- additional_params.push_back(file);
- }
-
- for (size_t i = 0 ; i < options_list.size() ; ++i) {
- options_list[i]->post_process();
- }
-
- return con;
-}
-
-
-void parse_options(int argc, char const ** argv,
- vector<string> & additional_params)
-{
- vector<poptOption> options;
-
- poptContext con =
- do_parse_options(argc, argv, options, additional_params);
-
- poptFreeContext(con);
-}
-
-
-template <typename T> class option_imp;
-
-
-/**
- * option<void> - a binary option
- *
- * Use this option type for constructing specified / not-specified
- * options e.g. --frob
- */
-template <> class option_imp<void> : public option_base {
-public:
- option_imp(bool & value, char const * option_name, char short_name,
- char const * help_str);
-
- ~option_imp() {}
-
- void post_process();
-
-private:
- bool & value;
- int popt_value;
-};
-
-
-/**
- * option<int> - a integer option
- *
- * Use this for options taking an integer e.g. --frob 6
- */
-template <> class option_imp<int> : public option_base {
-public:
- option_imp(int & value, char const * option_name, char short_name,
- char const * help_str, char const * arg_help_str);
-
- ~option_imp() {}
-};
-
-
-/**
- * option<string> - a string option
- *
- * Use this for options taking a string e.g. --frob parsley
- */
-template <> class option_imp<string> : public option_base {
-public:
- option_imp(string & value, char const * option_name,
- char short_name, char const * help_str,
- char const * arg_help_str);
-
- void post_process();
-
- ~option_imp() {}
-
-private:
- // we need an intermediate char array to pass to popt libs
- char * popt_value;
- string & value;
-};
-
-
-/**
- * option< vector<string> > - a string vector option
- *
- * Use this for options taking a number of string arguments,
- * separated by the given separator.
- */
-template <> class option_imp< vector<string> > : public option_base {
-public:
- option_imp(vector<string> & value,
- char const * option_name, char short_name,
- char const * help_str, char const * arg_help_str,
- char separator = ',');
-
- void post_process();
-
- ~option_imp() {}
-
-private:
- vector<string> & value;
- // we need an intermediate char array to pass to popt libs
- char * popt_value;
- char const separator;
-};
-
-
-option::~option()
-{
- delete the_option;
-}
-
-
-/// non templatized ctor for boolean option
-option::option(bool & value, char const * name, char short_name, char const * help)
- : the_option(new option_imp<void>(value, name, short_name, help))
-{
-}
-
-
-/// specialization of option ctor for integer option
-template <>
-option::option(int & value, char const * name, char short_name,
- char const * help, char const * arg_help)
- : the_option(new option_imp<int>
- (value, name, short_name, help, arg_help))
-{
-}
-
-
-/// specialization of option ctor for string option
-template <>
-option::option(string & value, char const * name, char short_name,
- char const * help, char const * arg_help)
- : the_option(new option_imp<string>
- (value, name, short_name, help, arg_help))
-{
-}
-
-
-/// specialization of option ctor for vector<string> option
-template <>
-option::option(vector<string> & value, char const * name, char short_name,
- char const * help, char const * arg_help)
- : the_option(new option_imp< vector<string> >
- (value, name, short_name, help, arg_help))
-{
-}
-
-
-option_base::option_base(char const * name, char short_name,
- char const * help, char const * arg_help,
- void * data, int popt_flags)
- : option_name(name)
-{
- poptOption const opt = { name, short_name, popt_flags,
- data, 0, help, arg_help };
-
- popt_options.push_back(opt);
-
- options_list.push_back(this);
-}
-
-
-option_imp<void>::option_imp(bool & val, char const * name, char short_name,
- char const * help)
- : option_base(name, short_name, help, 0, &popt_value, POPT_ARG_NONE),
- value(val), popt_value(0)
-{
-}
-
-
-void option_imp<void>::post_process()
-{
- if (popt_value) {
- if (is_prefix(option_name, "no-"))
- value = !popt_value;
- else
- value = popt_value;
- }
-}
-
-
-option_imp<int>::option_imp(int & value, char const * name, char short_name,
- char const * help, char const * arg_help)
- : option_base(name, short_name, help, arg_help, &value, POPT_ARG_INT)
-{
-}
-
-
-option_imp<string>::option_imp(string & val, char const * name, char short_name,
- char const * help, char const * arg_help)
- : option_base(name, short_name, help, arg_help,
- &popt_value, POPT_ARG_STRING),
- popt_value(0), value(val)
-{
-}
-
-
-void option_imp<string>::post_process()
-{
- if (popt_value) {
- value = popt_value;
- popt_value = 0;
- }
-}
-
-
-option_imp< vector<string> >::option_imp(vector<string> & val,
- char const * name, char short_name,
- char const * help,
- char const * arg_help, char sepchar)
- : option_base(name, short_name, help, arg_help,
- &popt_value, POPT_ARG_STRING),
- value(val), popt_value(0), separator(sepchar)
-{
-}
-
-
-void option_imp< vector<string> >::post_process()
-{
- if (popt_value) {
- value = separate_token(popt_value, separator);
-
- popt_value = 0;
- }
-}
-
-} // namespace popt
diff --git a/libopt++/popt_options.h b/libopt++/popt_options.h
deleted file mode 100644
index 7f72aa6..0000000
--- a/libopt++/popt_options.h
+++ /dev/null
@@ -1,123 +0,0 @@
-/**
- * @file popt_options.h
- * option parsing
- *
- * This provides a simple facility for adding command-line
- * options, and parsing them.
- *
- * You can add a number of options and then call parse_options()
- * to process them, for example :
- *
- * \code
- * bool allow_frob;
- * string frob;
- * static popt::option allow_frob_opt(allow_frob, "allow-frob", 'a', "allow frobs");
- * static popt::option frob_opt(frob, "frob", 'f', "what to frob", "name");
- *
- * ...
- * popt::parse_options(argc, argv, add_params);
- * \endcode
- *
- * Note than if you try to implement an option for an unsupported type like :
- * \code
- * static unsigned int i;
- * static popt::option i_opt(i, ....);
- * \endcode
- * you don't get a compile time error but a link time error.
- *
- * The call to parse_options() will fill in allow_frob and frob, if they
- * are passed to the program (myfrobber --allow-frob --frob foo), and place
- * any left over command line arguments in the add_params vector. Note
- * that the template parameter denotes the type of the option argument.
- *
- * When the template parameter type is bool, option starting with "no-" prefix
- * are implicitely considered as negated before writing the associated bool so
- * this will work as expected:
- * \code
- * bool demangle;
- * popt::option(demangle, "demangle", 'd', "demangle C++ symbols"),
- * popt::option(demangle, "no-demangle", '\0', "don't demangle C++ symbols"),
- * \endcode
- *
- * @remark Copyright 2002 OProfile authors
- * @remark Read the file COPYING
- *
- * @author Philippe Elie
- * @author John Levon
- */
-
-#ifndef POPT_OPTIONS_H
-#define POPT_OPTIONS_H
-
-#include <string>
-#include <vector>
-
-namespace popt {
-
-/**
- * parse_options - parse command line options
- * @param argc like the parameter of main()
- * @param argv like the parameter of main()
- * @param additional_params additional options are stored here
- *
- * Parse the given command line with the previous
- * options created. Multiple additional arguments
- * that are not recognised will be added to the additional_params
- * vector.
- */
-void parse_options(int argc, char const ** argv,
- std::vector<std::string> & additional_params);
-
-class option_base;
-
-/**
- * option - base class for a command line option
- *
- * Every command line option added before calling parse_options()
- * is of this type.
- */
-class option {
-public:
- /**
- * Templatized constructor for an option. This adds the option
- * to the option list on construction. This is specialized for
- * each recognised option value type below.
- */
- template <class T> option(T &, char const * option_name,
- char short_name, char const * help_str,
- char const * arg_help_str);
-
- /**
- * boolean operations don't get the same set of parameters as other
- * option, as there is no argument to give help for.
- * Due to a bug in gcc 2.95 we can't use a default parameter
- * in the templatized ctor above because 2.95 is unable to match
- * the right ctor. So on we add a non-templatized ctor with an exact
- * match for boolean option.
- */
- option(bool &, char const * option_name,
- char short_name, char const * help_str);
-
- ~option();
-
-private:
- option_base * the_option;
-};
-
-
-/**
- * The supported option type, boolean option are matched by a non templatized
- * ctor above.
- */
-template <> option::option(int &, char const * option_name, char short_name,
- char const * help_str, char const * arg_help_str);
-template <> option::option(std::string &, char const * option_name,
- char short_name, char const * help_str,
- char const * arg_help_str);
-template <> option::option(std::vector<std::string> &,
- char const * option_name, char short_name,
- char const * help_str, char const * arg_help_str);
-
-} // namespace popt
-
-#endif // POPT_OPTIONS_H