- Timestamp:
- Jul 24, 2009, 12:59:23 AM (15 years ago)
- Branches:
- master, release-1.10, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
- Children:
- 64c9165
- Parents:
- ab225e0
- git-author:
- Anders Kaseorg <andersk@mit.edu> (07/24/09 00:51:10)
- git-committer:
- Anders Kaseorg <andersk@mit.edu> (07/24/09 00:59:23)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
global.c
r898eb15 r41c9a96 65 65 owl_fmtext_init_colorpair_mgr(&(g->cpmgr)); 66 66 g->debug=OWL_DEBUG; 67 g->searchstring=NULL;67 owl_regex_init(&g->search_re); 68 68 g->starttime=time(NULL); /* assumes we call init only a start time */ 69 69 g->lastinputtime=g->starttime; … … 708 708 709 709 int owl_global_is_search_active(owl_global *g) { 710 if (g->searchstring != NULL) return(1); 711 return(0); 712 } 713 714 void owl_global_set_search_string(owl_global *g, char *string) { 715 if (g->searchstring != NULL) owl_free(g->searchstring); 716 g->searchstring = string ? owl_strdup(string) : NULL; 717 } 718 719 char *owl_global_get_search_string(owl_global *g) { 720 if (g->searchstring==NULL) return(""); 721 return(g->searchstring); 710 if (owl_regex_is_set(&g->search_re)) return(1); 711 return(0); 712 } 713 714 void owl_global_set_search_re(owl_global *g, owl_regex *re) { 715 if (owl_regex_is_set(&g->search_re)) { 716 owl_regex_free(&g->search_re); 717 owl_regex_init(&g->search_re); 718 } 719 if (re != NULL) 720 owl_regex_copy(re, &g->search_re); 721 } 722 723 owl_regex *owl_global_get_search_re(owl_global *g) { 724 return &g->search_re; 722 725 } 723 726
Note: See TracChangeset
for help on using the changeset viewer.