- * selector is a simple shell command for selection of strings with a
- * dynamic pattern-matching.
+ * selector is a simple command line utility for selection of strings
+ * with a dynamic pattern-matching.
//////////////////////////////////////////////////////////////////////
// A quick and dirty hash table
//////////////////////////////////////////////////////////////////////
// A quick and dirty hash table
int first_line = new_line, last_line = new_line, nb_match = 1;
// We find the first and last line to show, so that the total of
int first_line = new_line, last_line = new_line, nb_match = 1;
// We find the first and last line to show, so that the total of
else if(strcmp(argv[i], "-f") == 0) {
check_opt(argc, argv, i, 1, "<input filename>");
strncpy(input_filename, argv[i+1], buffer_size);
else if(strcmp(argv[i], "-f") == 0) {
check_opt(argc, argv, i, 1, "<input filename>");
strncpy(input_filename, argv[i+1], buffer_size);
<< " -e start in regexp mode" << endl
<< " -a case sensitive" << endl
<< " -m monochrome mode" << endl
<< " -e start in regexp mode" << endl
<< " -a case sensitive" << endl
<< " -m monochrome mode" << endl
if(input_filename[0]) {
read_file(input_filename,
nb_lines_max, &nb_lines, lines,
if(input_filename[0]) {
read_file(input_filename,
nb_lines_max, &nb_lines, lines,
if(color_fg_modeline < 0 || color_fg_modeline >= COLORS ||
color_bg_modeline < 0 || color_bg_modeline >= COLORS ||
color_fg_highlight < 0 || color_bg_highlight >= COLORS ||
color_bg_highlight < 0 || color_bg_highlight >= COLORS) {
echo();
if(color_fg_modeline < 0 || color_fg_modeline >= COLORS ||
color_bg_modeline < 0 || color_bg_modeline >= COLORS ||
color_fg_highlight < 0 || color_bg_highlight >= COLORS ||
color_bg_highlight < 0 || color_bg_highlight >= COLORS) {
echo();
- init_pair(1, color_fg_modeline, color_bg_modeline);
- init_pair(2, color_fg_highlight, color_bg_highlight);
- init_pair(3, color_bg_modeline, color_fg_modeline);
+
+ init_pair(COLOR_MODELINE, color_fg_modeline, color_bg_modeline);
+ init_pair(COLOR_HIGHLIGHTED_LINE, color_fg_highlight, color_bg_highlight);
+