Changes in global.c [41c9a96:8742840]
Legend:
- Unmodified
- Added
- Removed
-
global.c
r41c9a96 r8742840 168 168 } 169 169 170 int owl_global_get_lines( owl_global *g) {170 int owl_global_get_lines(const owl_global *g) { 171 171 return(g->lines); 172 172 } 173 173 174 int owl_global_get_cols( owl_global *g) {174 int owl_global_get_cols(const owl_global *g) { 175 175 return(g->cols); 176 176 } 177 177 178 int owl_global_get_recwin_lines( owl_global *g) {178 int owl_global_get_recwin_lines(const owl_global *g) { 179 179 return(g->recwinlines); 180 180 } … … 182 182 /* curmsg */ 183 183 184 int owl_global_get_curmsg( owl_global *g) {184 int owl_global_get_curmsg(const owl_global *g) { 185 185 return(g->curmsg); 186 186 } … … 195 195 /* topmsg */ 196 196 197 int owl_global_get_topmsg( owl_global *g) {197 int owl_global_get_topmsg(const owl_global *g) { 198 198 return(g->topmsg); 199 199 } … … 205 205 /* markedmsgid */ 206 206 207 int owl_global_get_markedmsgid( owl_global *g) {207 int owl_global_get_markedmsgid(const owl_global *g) { 208 208 return(g->markedmsgid); 209 209 } … … 212 212 g->markedmsgid=i; 213 213 /* i; index of message in the current view. 214 owl_message *m;214 const owl_message *m; 215 215 owl_view *v; 216 216 … … 245 245 /* curses windows */ 246 246 247 WINDOW *owl_global_get_curs_recwin( owl_global *g) {247 WINDOW *owl_global_get_curs_recwin(const owl_global *g) { 248 248 return(g->recwin); 249 249 } 250 250 251 WINDOW *owl_global_get_curs_sepwin( owl_global *g) {251 WINDOW *owl_global_get_curs_sepwin(const owl_global *g) { 252 252 return(g->sepwin); 253 253 } 254 254 255 WINDOW *owl_global_get_curs_msgwin( owl_global *g) {255 WINDOW *owl_global_get_curs_msgwin(const owl_global *g) { 256 256 return(g->msgwin); 257 257 } 258 258 259 WINDOW *owl_global_get_curs_typwin( owl_global *g) {259 WINDOW *owl_global_get_curs_typwin(const owl_global *g) { 260 260 return(g->typwin); 261 261 } … … 263 263 /* typwin */ 264 264 265 owl_editwin *owl_global_get_typwin( owl_global *g) {265 owl_editwin *owl_global_get_typwin(const owl_global *g) { 266 266 return(g->tw); 267 267 } … … 269 269 /* buffercommand */ 270 270 271 void owl_global_set_buffercommand(owl_global *g, c har *command) {271 void owl_global_set_buffercommand(owl_global *g, const char *command) { 272 272 owl_editwin_set_command(owl_global_get_typwin(g), command); 273 273 } 274 274 275 c har *owl_global_get_buffercommand(owl_global *g) {275 const char *owl_global_get_buffercommand(const owl_global *g) { 276 276 return owl_editwin_get_command(owl_global_get_typwin(g)); 277 277 } … … 281 281 } 282 282 283 void (*owl_global_get_buffercallback( owl_global *g))(owl_editwin*) {283 void (*owl_global_get_buffercallback(const owl_global *g))(owl_editwin*) { 284 284 return owl_editwin_get_callback(owl_global_get_typwin(g)); 285 285 } … … 287 287 /* refresh */ 288 288 289 int owl_global_is_needrefresh( owl_global *g) {289 int owl_global_is_needrefresh(const owl_global *g) { 290 290 if (g->needrefresh==1) return(1); 291 291 return(0); … … 318 318 } 319 319 320 int owl_global_get_rightshift( owl_global *g) {320 int owl_global_get_rightshift(const owl_global *g) { 321 321 return(g->rightshift); 322 322 } … … 324 324 /* typwin */ 325 325 326 int owl_global_is_typwin_active( owl_global *g) {326 int owl_global_is_typwin_active(const owl_global *g) { 327 327 if (g->typwinactive==1) return(1); 328 328 return(0); … … 351 351 } 352 352 353 c har *owl_global_get_homedir(owl_global *g) {353 const char *owl_global_get_homedir(const owl_global *g) { 354 354 if (g->homedir) return(g->homedir); 355 355 return("/"); 356 356 } 357 357 358 c har *owl_global_get_confdir(owl_global *g) {358 const char *owl_global_get_confdir(const owl_global *g) { 359 359 if (g->confdir) return(g->confdir); 360 360 return("/"); … … 364 364 * Setting this also sets startupfile to confdir/startup 365 365 */ 366 void owl_global_set_confdir(owl_global *g, c har *cd) {366 void owl_global_set_confdir(owl_global *g, const char *cd) { 367 367 free(g->confdir); 368 368 g->confdir = owl_strdup(cd); … … 371 371 } 372 372 373 c har *owl_global_get_startupfile(owl_global *g) {373 const char *owl_global_get_startupfile(const owl_global *g) { 374 374 if(g->startupfile) return(g->startupfile); 375 375 return("/"); 376 376 } 377 377 378 int owl_global_get_direction( owl_global *g) {378 int owl_global_get_direction(const owl_global *g) { 379 379 return(g->direction); 380 380 } … … 394 394 } 395 395 396 void *owl_global_get_perlinterp( owl_global *g) {396 void *owl_global_get_perlinterp(const owl_global *g) { 397 397 return(g->perl); 398 398 } 399 399 400 int owl_global_is_config_format( owl_global *g) {400 int owl_global_is_config_format(const owl_global *g) { 401 401 if (g->config_format) return(1); 402 402 return(0); … … 498 498 /* debug */ 499 499 500 int owl_global_is_debug_fast( owl_global *g) {500 int owl_global_is_debug_fast(const owl_global *g) { 501 501 if (g->debug) return(1); 502 502 return(0); … … 505 505 /* starttime */ 506 506 507 time_t owl_global_get_starttime( owl_global *g) {507 time_t owl_global_get_starttime(const owl_global *g) { 508 508 return(g->starttime); 509 509 } 510 510 511 time_t owl_global_get_runtime( owl_global *g) {511 time_t owl_global_get_runtime(const owl_global *g) { 512 512 return(time(NULL)-g->starttime); 513 513 } 514 514 515 time_t owl_global_get_lastinputtime( owl_global *g) {515 time_t owl_global_get_lastinputtime(const owl_global *g) { 516 516 return(g->lastinputtime); 517 517 } … … 521 521 } 522 522 523 time_t owl_global_get_idletime( owl_global *g) {523 time_t owl_global_get_idletime(const owl_global *g) { 524 524 return(time(NULL)-g->lastinputtime); 525 525 } 526 526 527 void owl_global_get_runtime_string( owl_global *g, char *buff) {527 void owl_global_get_runtime_string(const owl_global *g, char *buff) { 528 528 time_t diff; 529 529 … … 534 534 } 535 535 536 c har *owl_global_get_hostname(owl_global *g) {536 const char *owl_global_get_hostname(const owl_global *g) { 537 537 if (g->thishost) return(g->thishost); 538 538 return(""); … … 549 549 } 550 550 551 int owl_global_get_userclue( owl_global *g) {551 int owl_global_get_userclue(const owl_global *g) { 552 552 return(g->userclue); 553 553 } 554 554 555 int owl_global_is_userclue( owl_global *g, int clue) {555 int owl_global_is_userclue(const owl_global *g, int clue) { 556 556 if (g->userclue & clue) return(1); 557 557 return(0); … … 567 567 /* vert offset */ 568 568 569 int owl_global_get_curmsg_vert_offset( owl_global *g) {569 int owl_global_get_curmsg_vert_offset(const owl_global *g) { 570 570 return(g->curmsg_vert_offset); 571 571 } … … 577 577 /* startup args */ 578 578 579 void owl_global_set_startupargs(owl_global *g, int argc, c har **argv) {579 void owl_global_set_startupargs(owl_global *g, int argc, const char *const *argv) { 580 580 int i, len; 581 581 … … 595 595 } 596 596 597 c har *owl_global_get_startupargs(owl_global *g) {597 const char *owl_global_get_startupargs(const owl_global *g) { 598 598 if (g->startupargs) return(g->startupargs); 599 599 return(""); … … 616 616 } 617 617 618 owl_filter *owl_global_get_filter( owl_global *g,char *name) {618 owl_filter *owl_global_get_filter(const owl_global *g, const char *name) { 619 619 int i, j; 620 620 owl_filter *f; … … 634 634 } 635 635 636 void owl_global_remove_filter(owl_global *g, c har *name) {636 void owl_global_remove_filter(owl_global *g, const char *name) { 637 637 int i, j; 638 638 owl_filter *f; … … 663 663 /* has colors */ 664 664 665 int owl_global_get_hascolors( owl_global *g) {665 int owl_global_get_hascolors(const owl_global *g) { 666 666 if (g->hascolors) return(1); 667 667 return(0); … … 670 670 /* color pairs */ 671 671 672 int owl_global_get_colorpairs( owl_global *g) {672 int owl_global_get_colorpairs(const owl_global *g) { 673 673 return(g->colorpairs); 674 674 } … … 684 684 } 685 685 686 int owl_global_message_is_puntable(owl_global *g, owl_message *m) {687 owl_list *pl;686 int owl_global_message_is_puntable(owl_global *g, const owl_message *m) { 687 const owl_list *pl; 688 688 int i, j; 689 689 … … 697 697 698 698 int owl_global_should_followlast(owl_global *g) { 699 owl_view *v;699 const owl_view *v; 700 700 701 701 if (!owl_global_is__followlast(g)) return(0); … … 707 707 } 708 708 709 int owl_global_is_search_active( owl_global *g) {709 int owl_global_is_search_active(const owl_global *g) { 710 710 if (owl_regex_is_set(&g->search_re)) return(1); 711 711 return(0); 712 712 } 713 713 714 void owl_global_set_search_re(owl_global *g, owl_regex *re) {714 void owl_global_set_search_re(owl_global *g, const owl_regex *re) { 715 715 if (owl_regex_is_set(&g->search_re)) { 716 716 owl_regex_free(&g->search_re); … … 721 721 } 722 722 723 owl_regex *owl_global_get_search_re(owl_global *g) {723 const owl_regex *owl_global_get_search_re(const owl_global *g) { 724 724 return &g->search_re; 725 725 } … … 729 729 } 730 730 731 int owl_global_get_newmsgproc_pid( owl_global *g) {731 int owl_global_get_newmsgproc_pid(const owl_global *g) { 732 732 return(g->newmsgproc_pid); 733 733 } … … 735 735 /* AIM stuff */ 736 736 737 int owl_global_is_aimloggedin( owl_global *g)737 int owl_global_is_aimloggedin(const owl_global *g) 738 738 { 739 739 if (g->aim_loggedin) return(1); … … 741 741 } 742 742 743 c har *owl_global_get_aim_screenname(owl_global *g)743 const char *owl_global_get_aim_screenname(const owl_global *g) 744 744 { 745 745 if (owl_global_is_aimloggedin(g)) { … … 749 749 } 750 750 751 c har *owl_global_get_aim_screenname_for_filters(owl_global *g)751 const char *owl_global_get_aim_screenname_for_filters(const owl_global *g) 752 752 { 753 753 if (owl_global_is_aimloggedin(g)) { … … 757 757 } 758 758 759 void owl_global_set_aimloggedin(owl_global *g, char *screenname) 760 { 761 char *sn_escaped, *quote; 759 void owl_global_set_aimloggedin(owl_global *g, const char *screenname) 760 { 761 char *sn_escaped; 762 const char *quote; 762 763 g->aim_loggedin=1; 763 764 if (g->aim_screenname) owl_free(g->aim_screenname); … … 775 776 } 776 777 777 int owl_global_is_doaimevents( owl_global *g)778 int owl_global_is_doaimevents(const owl_global *g) 778 779 { 779 780 if (g->aim_doprocessing) return(1); … … 842 843 /* Return the style with name 'name'. If it does not exist return 843 844 * NULL */ 844 owl_style *owl_global_get_style_by_name(owl_global *g,char *name)845 const owl_style *owl_global_get_style_by_name(const owl_global *g, const char *name) 845 846 { 846 847 return owl_dict_find_element(&(g->styledict), name); … … 849 850 /* creates a list and fills it in with keys. duplicates the keys, 850 851 * so they will need to be freed by the caller. */ 851 int owl_global_get_style_names( owl_global *g, owl_list *l) {852 int owl_global_get_style_names(const owl_global *g, owl_list *l) { 852 853 return owl_dict_get_keys(&(g->styledict), l); 853 854 } … … 872 873 } 873 874 874 int owl_global_is_haveaim( owl_global *g)875 int owl_global_is_haveaim(const owl_global *g) 875 876 { 876 877 if (g->haveaim) return(1); … … 888 889 } 889 890 890 int owl_global_is_ignore_aimlogin( owl_global *g)891 int owl_global_is_ignore_aimlogin(const owl_global *g) 891 892 { 892 893 return g->ignoreaimlogin; … … 898 899 } 899 900 900 int owl_global_is_havezephyr( owl_global *g)901 int owl_global_is_havezephyr(const owl_global *g) 901 902 { 902 903 if (g->havezephyr) return(1); … … 941 942 } 942 943 943 c har * owl_global_intern(owl_global *g,char * string)944 const char * owl_global_intern(owl_global *g, const char * string) 944 945 { 945 946 return owl_obarray_insert(&(g->obarray), string); … … 956 957 } 957 958 958 int owl_global_is_interrupted( owl_global *g) {959 int owl_global_is_interrupted(const owl_global *g) { 959 960 return g->interrupted; 960 961 }
Note: See TracChangeset
for help on using the changeset viewer.