commit 2af18e3d6bdc4a22c5695aa4ef54c55c38b87f58
parent 50b674a0cf199226abebe238a2ce582d7d7b96bb
Author: Kyle Milz <kmilz@ucalgary.ca>
Date: Fri, 19 Oct 2012 22:40:53 -0600
utilities: remove old unused functions
Diffstat:
2 files changed, 0 insertions(+), 200 deletions(-)
diff --git a/src/utilities.c b/src/utilities.c
@@ -20,9 +20,6 @@
void parse(const char *buf);
-void add_modkeys(char key);
-int get_modkey(char key);
-void strdown(char *str);
char *strdup_printf(const char *fmt, ...)
{
@@ -38,47 +35,6 @@ char *strdup_printf(const char *fmt, ...)
return buf;
}
-void strdown(char *str)
-{
- int i;
-
- for (i = 0; str[i]; i++) {
- str[i] = tolower(str[i]);
- }
-}
-
-char *
-search_word(int whichword)
-{
- int k = 0;
- static char word[240];
- char *c = my_pair.line;
-
- while (isspace(*c) && *c)
- c++;
-
- switch (whichword) {
- case 0:
- while (*c && !isspace (*c) && *c != '=' && k < 240) {
- word[k++] = *c;
- c++;
- }
- word[k] = '\0';
- strncpy(my_pair.what, word, 20);
- break;
- case 1:
- while (*c && k < 240) {
- word[k++] = *c;
- c++;
- }
- word[k] = '\0';
- strncpy(my_pair.value, word, 240);
- break;
- }
-
- return c;
-}
-
void save_command_history(Eina_Stringshare *line, Window_Data *wd)
{
const char *c = line;
@@ -209,151 +165,6 @@ give_feedback(const char *feedback, void *data)
free(a.s);
}
-#if 0
-Listelement *
-complete_list(const char *searchfor, const int mode, Listelement *elementlist, void *data)
-{
- FILE *f;
- char *filename;
- Listelement *candidatelist = NULL, *candidatepointer = NULL;
- char s[255] = "", readelement[MAXTAGSIZE + 1] = "";
- int i, t, n = 0;
- App_Data *ad = data;
-
- if (mode == 2) {
- /* open in history file */
- filename = strdup_printf(HISTORY_STORAGE_FILENAME);
- } else {
- /* open in bookmark file (for tags and bookmarks) */
- filename = strdup_printf(BOOKMARKS_STORAGE_FILENAME);
- }
- f = fopen(filename, "r");
- if (f == NULL) {
- free(filename);
- return (elementlist);
- }
-
- while (fgets(s, 254, f)) {
- if (mode == 1) {
- /* just tags (could be more than one per line) */
- i = 0;
- while (s[i] && i < 254) {
- while (s[i] != '[' && s[i])
- i++;
- if (s[i] != '[')
- continue;
- i++;
- t = 0;
- while (s[i] != ']' && s[i] && t < MAXTAGSIZE)
- readelement[t++] = s[i++];
- readelement[t] = '\0';
- candidatelist = add_list(readelement, candidatelist);
- i++;
- }
- } else {
- /* complete string (bookmarks & history) */
- candidatelist = add_list(s, candidatelist);
- }
- candidatepointer = candidatelist;
- while (candidatepointer != NULL) {
- strncpy(s, candidatepointer->element, sizeof(s));
- if (!complete_case_sensitive) {
- strdown(s);
- }
- if (!strlen(searchfor) || strstr(s, searchfor) != NULL) {
- /* only use string up to the first space */
- memset(readelement, 0, MAXTAGSIZE + 1);
- if (strchr(candidatepointer->element, ' ') != NULL) {
- i = strcspn(candidatepointer->element, " ");
- if (i > MAXTAGSIZE)
- i = MAXTAGSIZE;
- strncpy(readelement, candidatepointer->element, i);
- } else {
- strncpy(readelement, candidatepointer->element, MAXTAGSIZE);
- }
- /* in the case of URLs without title, remove the line break */
- if (readelement[strlen(readelement) - 1] == '\n') {
- readelement[strlen(readelement) - 1] = '\0';
- }
- elementlist = add_list(readelement, elementlist);
- n = count_list(elementlist);
- }
- if (n >= MAX_LIST_SIZE)
- break;
- candidatepointer = candidatepointer->next;
- }
- free_list(candidatelist);
- candidatelist = NULL;
- if (n >= MAX_LIST_SIZE)
- break;
- }
- free(filename);
- return (elementlist);
-}
-#endif
-
-Listelement *
-add_list(const char *element, Listelement *elementlist)
-{
- int n, i = 0;
- Listelement *newelement, *elementpointer, *lastelement;
-
- if (elementlist == NULL) { /* first element */
- newelement = malloc(sizeof(Listelement));
- if (newelement == NULL)
- return (elementlist);
- strncpy(newelement->element, element, 254);
- newelement->next = NULL;
- return newelement;
- }
- elementpointer = elementlist;
- n = strlen(element);
-
- /* check if element is already in list */
- while (elementpointer != NULL) {
- if (strlen(elementpointer->element) == n &&
- strncmp(elementpointer->element, element, n) == 0)
- return (elementlist);
- lastelement = elementpointer;
- elementpointer = elementpointer->next;
- i++;
- }
- /* add to list */
- newelement = malloc(sizeof(Listelement));
- if (newelement == NULL)
- return (elementlist);
- lastelement->next = newelement;
- strncpy(newelement->element, element, 254);
- newelement->next = NULL;
- return elementlist;
-}
-
-void
-free_list(Listelement *elementlist)
-{
- Listelement *elementpointer;
-
- while (elementlist != NULL) {
- elementpointer = elementlist->next;
- free(elementlist);
- elementlist = elementpointer;
- }
-}
-
-int
-count_list(Listelement *elementlist)
-{
- Listelement *elementpointer = elementlist;
- int n = 0;
-
- while (elementpointer != NULL) {
- n++;
- elementpointer = elementpointer->next;
- }
-
- return n;
-}
-
Eina_Bool
process_line(const char *line, Window_Data *wd)
{
diff --git a/src/utilities.h b/src/utilities.h
@@ -19,22 +19,11 @@ Eina_Bool process_line(const char *line, Window_Data*);
Eina_Bool process_line_arg(const Arg *, void *);
void set_error(const char *error, void *);
void give_feedback(const char *feedback, void *);
-Listelement* complete_list(const char *, const int, Listelement *, void *);
-Listelement* add_list(const char *element, Listelement *elementlist);
-int count_list(Listelement *elementlist);
-void free_list(Listelement *elementlist);
-char * search_word(int whichword);
void userscript_hooks_start(const char*);
void userscript_hooks_end(const char*);
void setup_modkeys(void *data);
Eina_Bool echo(const Arg *arg, void *);
void update_state(Window_Data*);
-// Eina_Bool enable_proxy(Buffer_Data *bd);
-Evas_Object* make_url_with_icon(const char*, Buffer_Data*);
-void received_favicon_cb(const char *url, Evas_Object *icon, void *data);
-
-char *find_uri_for_searchengine(const char *handle);
-void make_searchengines_list(Searchengine *searchengines, int length);
void make_buffer_number(Evas_Object *label, Buffer_Data *bd);
void make_favicon(Evas_Object *icon, Buffer_Data *bd);