Changeset 8742840
- Timestamp:
- Aug 15, 2009, 7:08:21 PM (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:
- 369a7f0
- Parents:
- 6249e137
- git-author:
- Anders Kaseorg <andersk@mit.edu> (08/04/09 02:38:16)
- git-committer:
- Anders Kaseorg <andersk@mit.edu> (08/15/09 19:08:21)
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
global.c
r9e5c9f3 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 } … … 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 } … … 273 273 } 274 274 275 const char *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 const char *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 const char *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("/"); … … 371 371 } 372 372 373 const char *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 const char *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 } … … 595 595 } 596 596 597 const char *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, const 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; … … 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 } … … 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); … … 721 721 } 722 722 723 const 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 const char *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 const char *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)) { … … 776 776 } 777 777 778 int owl_global_is_doaimevents( owl_global *g)778 int owl_global_is_doaimevents(const owl_global *g) 779 779 { 780 780 if (g->aim_doprocessing) return(1); … … 843 843 /* Return the style with name 'name'. If it does not exist return 844 844 * NULL */ 845 const owl_style *owl_global_get_style_by_name( owl_global *g, const char *name)845 const owl_style *owl_global_get_style_by_name(const owl_global *g, const char *name) 846 846 { 847 847 return owl_dict_find_element(&(g->styledict), name); … … 850 850 /* creates a list and fills it in with keys. duplicates the keys, 851 851 * so they will need to be freed by the caller. */ 852 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) { 853 853 return owl_dict_get_keys(&(g->styledict), l); 854 854 } … … 873 873 } 874 874 875 int owl_global_is_haveaim( owl_global *g)875 int owl_global_is_haveaim(const owl_global *g) 876 876 { 877 877 if (g->haveaim) return(1); … … 889 889 } 890 890 891 int owl_global_is_ignore_aimlogin( owl_global *g)891 int owl_global_is_ignore_aimlogin(const owl_global *g) 892 892 { 893 893 return g->ignoreaimlogin; … … 899 899 } 900 900 901 int owl_global_is_havezephyr( owl_global *g)901 int owl_global_is_havezephyr(const owl_global *g) 902 902 { 903 903 if (g->havezephyr) return(1); … … 957 957 } 958 958 959 int owl_global_is_interrupted( owl_global *g) {959 int owl_global_is_interrupted(const owl_global *g) { 960 960 return g->interrupted; 961 961 } -
stubgen.pl
re19eb97 r8742840 25 25 print "void owl_global_set_${altvarname}_off(owl_global *g) {\n"; 26 26 print " owl_variable_set_bool_off(&g->vars, \"$varname\");\n}\n"; 27 print "int owl_global_is_$altvarname( owl_global *g) {\n";27 print "int owl_global_is_$altvarname(const owl_global *g) {\n"; 28 28 print " return owl_variable_get_bool(&g->vars, \"$varname\");\n}\n"; 29 29 } elsif ($vartype =~ /^PATH/ or $vartype =~ /^STRING/) { 30 30 print "void owl_global_set_$altvarname(owl_global *g, const char *text) {\n"; 31 31 print " owl_variable_set_string(&g->vars, \"$varname\", text);\n}\n"; 32 print "const char *owl_global_get_$altvarname( owl_global *g) {\n";32 print "const char *owl_global_get_$altvarname(const owl_global *g) {\n"; 33 33 print " return owl_variable_get_string(&g->vars, \"$varname\");\n}\n"; 34 34 } elsif ($vartype =~ /^INT/ or $vartype =~ /^ENUM/) { 35 35 print "void owl_global_set_$altvarname(owl_global *g, int n) {\n"; 36 36 print " owl_variable_set_int(&g->vars, \"$varname\", n);\n}\n"; 37 print "int owl_global_get_$altvarname( owl_global *g) {\n";37 print "int owl_global_get_$altvarname(const owl_global *g) {\n"; 38 38 print " return owl_variable_get_int(&g->vars, \"$varname\");\n}\n"; 39 39 }
Note: See TracChangeset
for help on using the changeset viewer.