projects
/
selector.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
d90645e
)
Cosmetics.
author
Francois Fleuret
<francois@fleuret.org>
Sat, 27 Jun 2009 22:58:10 +0000
(
00:58
+0200)
committer
Francois Fleuret
<francois@fleuret.org>
Sat, 27 Jun 2009 22:58:10 +0000
(
00:58
+0200)
selector.c
patch
|
blob
|
history
diff --git
a/selector.c
b/selector.c
index
13f73b1
..
1923b7a
100644
(file)
--- a/
selector.c
+++ b/
selector.c
@@
-22,8
+22,11
@@
*
*/
*
*/
-/* To use it as a super-history-search for bash:
- selector -q -b -i -d -v -w -l ${HISTSIZE} <(history)
+/*
+
+ To use it as a super-history-search for bash:
+ selector -q -b -i -d -v -w -l ${HISTSIZE} <(history)
+
*/
#define _GNU_SOURCE
*/
#define _GNU_SOURCE
@@
-123,12
+126,12
@@
void error_feedback() {
}
}
}
}
-/*********************************************************************
/
-
/*
A quick and dirty hash table
+/*********************************************************************
+ A quick and dirty hash table
-
The table itself stores indexes of the strings taken in a char
- **table. When a string is added, if it was already in the table,
-
the
new index replaces the previous one. */
+ The table itself stores indexes of the strings taken in a char
+ **table. When a string is added, if it was already in the table, the
+ new index replaces the previous one. */
int *new_hash_table(int hash_table_size) {
int *result, k;
int *new_hash_table(int hash_table_size) {
int *result, k;
@@
-151,7
+154,8
@@
int test_and_add(char *new_string, int new_index,
int k;
/* This is my recipe. I checked, it seems to work (as long as
int k;
/* This is my recipe. I checked, it seems to work (as long as
- hash_table_size is not a multiple of 387433 that should be okay) */
+ hash_table_size is not a multiple of 387433 that should be
+ okay) */
for(k = 0; new_string[k]; k++) {
code = code * 387433 + (unsigned int) (new_string[k]);
for(k = 0; new_string[k]; k++) {
code = code * 387433 + (unsigned int) (new_string[k]);
@@
-181,9
+185,9
@@
int test_and_add(char *new_string, int new_index,
return -1;
}
return -1;
}
-/*********************************************************************
/
-
/*
A matcher matches either with a collection of substrings, or with a
-
regexp */
+/*********************************************************************
+ A matcher matches either with a collection of substrings, or with a
+ regexp */
typedef struct {
regex_t preg;
typedef struct {
regex_t preg;
@@
-256,8
+260,8
@@
void initialize_matcher(int use_regexp, int case_sensitive,
}
}
}
}
-/*********************************************************************
/
-
/*
Buffer edition */
+/*********************************************************************
+ Buffer edition */
void delete_char(char *buffer, int *position) {
if(buffer[*position]) {
void delete_char(char *buffer, int *position) {
if(buffer[*position]) {
@@
-1049,7
+1053,7
@@
int main(int argc, char **argv) {
echo();
endwin();
echo();
endwin();
-/* Here we come back to standard display */
+
/* Here we come back to standard display */
if((key == KEY_ENTER || key == '\n')) {
if((key == KEY_ENTER || key == '\n')) {