Browse code

Add extern C

Ben Judd authored on 03/01/2024 16:38:45
Showing 1 changed files
... ...
@@ -1,6 +1,10 @@
1 1
 #ifndef OPTIONS_H
2 2
 #define OPTIONS_H OPTIONS_H
3 3
 
4
+#ifdef __cplusplus
5
+extern "C" {
6
+#endif
7
+
4 8
 typedef struct {
5 9
 	int benchmark;
6 10
 	const char *filter;
... ...
@@ -18,4 +22,8 @@ typedef struct {
18 22
 void options_init(options_t *options);
19 23
 void options_parse(options_t *options, int argc, char *argv[]);
20 24
 
25
+#ifdef __cplusplus
26
+}
27
+#endif
28
+
21 29
 #endif
Browse code

show selection info (with -i option)

Ondrej Martinek authored on 16/03/2019 04:54:08 • John Hawthorn committed on 28/12/2019 07:17:18
Showing 1 changed files
... ...
@@ -12,6 +12,7 @@ typedef struct {
12 12
 	const char *prompt;
13 13
 	unsigned int workers;
14 14
 	char input_delimiter;
15
+	int show_info;
15 16
 } options_t;
16 17
 
17 18
 void options_init(options_t *options);
Browse code

Simplify input_delimiter handling

John Hawthorn authored on 16/08/2019 08:09:29
Showing 1 changed files
... ...
@@ -11,7 +11,7 @@ typedef struct {
11 11
 	unsigned int scrolloff;
12 12
 	const char *prompt;
13 13
 	unsigned int workers;
14
-	int read_null;
14
+	char input_delimiter;
15 15
 } options_t;
16 16
 
17 17
 void options_init(options_t *options);
Browse code

Add ability to use null as input delimiter.

Update tty to print newline as space
Add tty_putc

Ashkan Kiani authored on 03/05/2019 10:30:13 • John Hawthorn committed on 16/08/2019 08:05:01
Showing 1 changed files
... ...
@@ -11,6 +11,7 @@ typedef struct {
11 11
 	unsigned int scrolloff;
12 12
 	const char *prompt;
13 13
 	unsigned int workers;
14
+	int read_null;
14 15
 } options_t;
15 16
 
16 17
 void options_init(options_t *options);
Browse code

Add -j option to control parallelism

John Hawthorn authored on 01/02/2017 02:13:27
Showing 1 changed files
... ...
@@ -10,6 +10,7 @@ typedef struct {
10 10
 	unsigned int num_lines;
11 11
 	unsigned int scrolloff;
12 12
 	const char *prompt;
13
+	unsigned int workers;
13 14
 } options_t;
14 15
 
15 16
 void options_init(options_t *options);
Browse code

Pass options to choices_init

John Hawthorn authored on 01/02/2017 02:06:42
Showing 1 changed files
... ...
@@ -12,6 +12,7 @@ typedef struct {
12 12
 	const char *prompt;
13 13
 } options_t;
14 14
 
15
+void options_init(options_t *options);
15 16
 void options_parse(options_t *options, int argc, char *argv[]);
16 17
 
17 18
 #endif
Browse code

Store state in tty_interface_t

John Hawthorn authored on 20/06/2016 06:17:53
Showing 1 changed files
... ...
@@ -1,3 +1,6 @@
1
+#ifndef OPTIONS_H
2
+#define OPTIONS_H OPTIONS_H
3
+
1 4
 typedef struct {
2 5
 	int benchmark;
3 6
 	const char *filter;
... ...
@@ -10,3 +13,5 @@ typedef struct {
10 13
 } options_t;
11 14
 
12 15
 void options_parse(options_t *options, int argc, char *argv[]);
16
+
17
+#endif
Browse code

Extract option parsing to separate file

John Hawthorn authored on 20/06/2016 01:03:47
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,12 @@
1
+typedef struct {
2
+	int benchmark;
3
+	const char *filter;
4
+	const char *init_search;
5
+	const char *tty_filename;
6
+	int show_scores;
7
+	unsigned int num_lines;
8
+	unsigned int scrolloff;
9
+	const char *prompt;
10
+} options_t;
11
+
12
+void options_parse(options_t *options, int argc, char *argv[]);