Polishing and optimizing includes which resolves #290.

This commit is contained in:
Martin Dvorak 2018-08-13 10:34:32 +02:00
parent 439d746c7a
commit 8ce60a877d
15 changed files with 25 additions and 71 deletions

View file

@ -17,7 +17,6 @@
*/
#include "include/hashset.h"
#include "include/hstr_utils.h"
unsigned int hashmap_hash(const char *str)
{

View file

@ -18,35 +18,6 @@
#define _GNU_SOURCE
#include <getopt.h>
#include <locale.h>
#ifdef __APPLE__
#include <curses.h>
#elif defined(__FreeBSD__)
#include <ncurses.h>
#else
#include <ncursesw/curses.h>
#endif
#include <readline/chardefs.h>
#include <regex.h>
#include <signal.h>
#include <stdbool.h>
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <termios.h>
#include <unistd.h>
#include <wchar.h>
#include "include/hashset.h"
#include "include/hstr_curses.h"
#include "include/hstr_blacklist.h"
#include "include/hstr_favorites.h"
#include "include/hstr_history.h"
#include "include/hstr_regexp.h"
#include "include/hstr_utils.h"
#include "include/hstr.h"
#define SELECTION_CURSOR_IN_PROMPT -1

View file

@ -16,12 +16,7 @@
limitations under the License.
*/
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include "include/hstr_blacklist.h"
#include "include/hstr_utils.h"
static const char *defaultCommandBlacklist[] = {
"ls", "pwd", "cd", "cd ..", "hh", "mc",

View file

@ -16,12 +16,7 @@
limitations under the License.
*/
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include "include/hstr_favorites.h"
#include "include/hstr_utils.h"
#define FAVORITE_SEGMENT_SIZE 10

View file

@ -16,12 +16,7 @@
limitations under the License.
*/
#include <ctype.h>
#include <stdio.h>
#include <limits.h>
#include <readline/history.h>
#include "include/hstr_history.h"
#include "include/hstr_regexp.h"
#define NDEBUG
#include <assert.h>

View file

@ -18,8 +18,6 @@
#include "include/hstr_regexp.h"
#include "include/hstr_utils.h"
#define REGEXP_MATCH_BUFFER_SIZE 1
void hstr_regexp_init(HstrRegexp *hstrRegexp)

View file

@ -18,8 +18,6 @@
#include "include/hstr_utils.h"
#include <ctype.h>
#define DEFAULT_COMMAND "pwd"
#define PROC_HOSTNAME "/proc/sys/kernel/hostname"
// TODO PID_BUFFER 20+ characters might be enough

View file

@ -19,10 +19,7 @@
#ifndef _HASHSET_H_
#define _HASHSET_H_
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <stdbool.h>
#include "hstr_utils.h"
#define HASH_MAP_SIZE 10007

View file

@ -19,6 +19,24 @@
#ifndef HSTR_H_
#define HSTR_H_
#include <getopt.h>
#include <locale.h>
#ifdef __APPLE__
#include <curses.h>
#elif defined(__FreeBSD__)
#include <ncurses.h>
#else
#include <ncursesw/curses.h>
#endif
#include <readline/chardefs.h>
#include <signal.h>
#include <termios.h>
#include <wchar.h>
#include "hstr_curses.h"
#include "hstr_blacklist.h"
#include "hstr_history.h"
int hstr_main(int argc, char* argv[]);
#endif

View file

@ -19,8 +19,6 @@
#ifndef HSTR_BLACKLIST_H_
#define HSTR_BLACKLIST_H_
#include <stdlib.h>
#include <stdbool.h>
#include "hashset.h"
#define ENV_VAR_USER "USER"

View file

@ -19,8 +19,6 @@
#ifndef _HSTR_FAVORITES_H_
#define _HSTR_FAVORITES_H_
#include <stdlib.h>
#include <stdbool.h>
#include "hashset.h"
#define ENV_VAR_USER "USER"

View file

@ -19,17 +19,13 @@
#ifndef _HSTR_HISTORY_H_
#define _HSTR_HISTORY_H_
#include <stdio.h>
#include <string.h>
#include <fcntl.h>
#include <stdlib.h>
#include <unistd.h>
#include <stdbool.h>
#include <limits.h>
#include <readline/history.h>
#include "hstr_favorites.h"
#include "hstr_utils.h"
#include "hashset.h"
#include "hstr_regexp.h"
#include "radixsort.h"
#include "hstr_favorites.h"
#define ENV_VAR_HISTFILE "HISTFILE"

View file

@ -20,8 +20,6 @@
#define _HSTR_REGEXP_H
#include <regex.h>
#include <stdio.h>
#include <stdbool.h>
#include "hashset.h"

View file

@ -19,6 +19,7 @@
#ifndef _HSTR_UTILS_H
#define _HSTR_UTILS_H
#include <ctype.h>
#include <sys/ioctl.h>
#include <sys/types.h>
#include <stdlib.h>

View file

@ -19,12 +19,9 @@
#ifndef RADIXSORT_H_
#define RADIXSORT_H_
#include <stdbool.h>
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include <string.h>
#include <stddef.h>
#include "hstr_utils.h"
#define RADIX_SLOT_SIZE 1000