summaryrefslogtreecommitdiff
path: root/options.h
diff options
context:
space:
mode:
authorChanho Park <chanho61.park@samsung.com>2014-08-22 20:34:56 +0900
committerChanho Park <chanho61.park@samsung.com>2014-08-22 20:34:56 +0900
commit517f5529d7008eba87b8b2fee5ec9ec0a5075f6e (patch)
treec71720a9b41309713c089478f921165bd2d63b25 /options.h
parent689b9dbb8d7f88ab91e7741932ed000b6e49be9a (diff)
downloadltrace-517f5529d7008eba87b8b2fee5ec9ec0a5075f6e.tar.gz
ltrace-517f5529d7008eba87b8b2fee5ec9ec0a5075f6e.tar.bz2
ltrace-517f5529d7008eba87b8b2fee5ec9ec0a5075f6e.zip
Imported Upstream version 0.7.91upstream/0.7.91upstream
Diffstat (limited to 'options.h')
-rw-r--r--options.h51
1 files changed, 44 insertions, 7 deletions
diff --git a/options.h b/options.h
index e1cc823..6c28ed9 100644
--- a/options.h
+++ b/options.h
@@ -1,5 +1,6 @@
/*
* This file is part of ltrace.
+ * Copyright (C) 2012 Petr Machata, Red Hat Inc.
* Copyright (C) 2009,2010 Joe Damato
* Copyright (C) 1998,2002,2008 Juan Cespedes
* Copyright (C) 2006 Ian Wienand
@@ -20,11 +21,15 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA
*/
+#ifndef _OPTIONS_H_
+#define _OPTIONS_H_
#include <stdio.h>
#include <sys/types.h>
+#include <sys/time.h>
#include "forward.h"
+#include "vect.h"
struct options_t {
int align; /* -a: default alignment column for results */
@@ -63,15 +68,47 @@ struct opt_p_t {
struct opt_p_t *next;
};
-struct opt_F_t
-{
- struct opt_F_t *next;
- char *filename;
- int own_filename : 1;
+extern struct opt_p_t *opt_p; /* attach to process with a given pid */
+
+enum opt_F_kind {
+ OPT_F_UNKNOWN = 0,
+ OPT_F_BROKEN,
+ OPT_F_FILE,
+ OPT_F_DIR,
};
-extern struct opt_p_t *opt_p; /* attach to process with a given pid */
+struct opt_F_t {
+ char *pathname;
+ int own_pathname : 1;
+ enum opt_F_kind kind : 2;
+};
+
+/* If entry->kind is OPT_F_UNKNOWN, figure out whether it should be
+ * OPT_F_FILE or OPT_F_DIR, cache the result, and return it. Return
+ * OPT_F_BROKEN on failure. Error message will have been printed in
+ * that case. */
+enum opt_F_kind opt_F_get_kind(struct opt_F_t *entry);
-extern struct opt_F_t *opt_F; /* alternate configuration file(s) */
+/* Destroy and release any memory associated with ENTRY (but don't
+ * free ENTRY itself). */
+void opt_F_destroy(struct opt_F_t *entry);
+
+/* PATHS contains colon-separated list of values, akin to enviroment
+ * variables PATH, PYTHONPATH, and others. No escaping is possible.
+ * The list is split and added to VEC, which shall be a vector
+ * initialized like VECT_INIT(VEC, struct opt_F_t); Returns 0 on
+ * success or a negative value on failure. */
+int parse_colon_separated_list(const char *paths, struct vect *vec);
+
+/* Vector of struct opt_F_t. */
+extern struct vect opt_F;
+
+struct opt_c_struct {
+ int count;
+ struct timeval tv;
+};
+extern struct dict *dict_opt_c;
extern char **process_options(int argc, char **argv);
+
+#endif /* _OPTIONS_H_ */