Changeset 8742840 for global.c


Ignore:
Timestamp:
Aug 15, 2009, 7:08:21 PM (12 years ago)
Author:
Anders Kaseorg <andersk@mit.edu>
Branches:
master, 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)
Message:
Add const qualifiers for owl_global *.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
File:
1 edited

Legend:

Unmodified
Added
Removed
  • global.c

    r9e5c9f3 r8742840  
    168168}
    169169                         
    170 int owl_global_get_lines(owl_global *g) {
     170int owl_global_get_lines(const owl_global *g) {
    171171  return(g->lines);
    172172}
    173173
    174 int owl_global_get_cols(owl_global *g) {
     174int owl_global_get_cols(const owl_global *g) {
    175175  return(g->cols);
    176176}
    177177
    178 int owl_global_get_recwin_lines(owl_global *g) {
     178int owl_global_get_recwin_lines(const owl_global *g) {
    179179  return(g->recwinlines);
    180180}
     
    182182/* curmsg */
    183183
    184 int owl_global_get_curmsg(owl_global *g) {
     184int owl_global_get_curmsg(const owl_global *g) {
    185185  return(g->curmsg);
    186186}
     
    195195/* topmsg */
    196196
    197 int owl_global_get_topmsg(owl_global *g) {
     197int owl_global_get_topmsg(const owl_global *g) {
    198198  return(g->topmsg);
    199199}
     
    205205/* markedmsgid */
    206206
    207 int owl_global_get_markedmsgid(owl_global *g) {
     207int owl_global_get_markedmsgid(const owl_global *g) {
    208208  return(g->markedmsgid);
    209209}
     
    245245/* curses windows */
    246246
    247 WINDOW *owl_global_get_curs_recwin(owl_global *g) {
     247WINDOW *owl_global_get_curs_recwin(const owl_global *g) {
    248248  return(g->recwin);
    249249}
    250250
    251 WINDOW *owl_global_get_curs_sepwin(owl_global *g) {
     251WINDOW *owl_global_get_curs_sepwin(const owl_global *g) {
    252252  return(g->sepwin);
    253253}
    254254
    255 WINDOW *owl_global_get_curs_msgwin(owl_global *g) {
     255WINDOW *owl_global_get_curs_msgwin(const owl_global *g) {
    256256  return(g->msgwin);
    257257}
    258258
    259 WINDOW *owl_global_get_curs_typwin(owl_global *g) {
     259WINDOW *owl_global_get_curs_typwin(const owl_global *g) {
    260260  return(g->typwin);
    261261}
     
    263263/* typwin */
    264264
    265 owl_editwin *owl_global_get_typwin(owl_global *g) {
     265owl_editwin *owl_global_get_typwin(const owl_global *g) {
    266266  return(g->tw);
    267267}
     
    273273}
    274274
    275 const char *owl_global_get_buffercommand(owl_global *g) {
     275const char *owl_global_get_buffercommand(const owl_global *g) {
    276276  return owl_editwin_get_command(owl_global_get_typwin(g));
    277277}
     
    281281}
    282282
    283 void (*owl_global_get_buffercallback(owl_global *g))(owl_editwin*) {
     283void (*owl_global_get_buffercallback(const owl_global *g))(owl_editwin*) {
    284284  return owl_editwin_get_callback(owl_global_get_typwin(g));
    285285}
     
    287287/* refresh */
    288288
    289 int owl_global_is_needrefresh(owl_global *g) {
     289int owl_global_is_needrefresh(const owl_global *g) {
    290290  if (g->needrefresh==1) return(1);
    291291  return(0);
     
    318318}
    319319
    320 int owl_global_get_rightshift(owl_global *g) {
     320int owl_global_get_rightshift(const owl_global *g) {
    321321  return(g->rightshift);
    322322}
     
    324324/* typwin */
    325325
    326 int owl_global_is_typwin_active(owl_global *g) {
     326int owl_global_is_typwin_active(const owl_global *g) {
    327327  if (g->typwinactive==1) return(1);
    328328  return(0);
     
    351351}
    352352
    353 const char *owl_global_get_homedir(owl_global *g) {
     353const char *owl_global_get_homedir(const owl_global *g) {
    354354  if (g->homedir) return(g->homedir);
    355355  return("/");
    356356}
    357357
    358 const char *owl_global_get_confdir(owl_global *g) {
     358const char *owl_global_get_confdir(const owl_global *g) {
    359359  if (g->confdir) return(g->confdir);
    360360  return("/");
     
    371371}
    372372
    373 const char *owl_global_get_startupfile(owl_global *g) {
     373const char *owl_global_get_startupfile(const owl_global *g) {
    374374  if(g->startupfile) return(g->startupfile);
    375375  return("/");
    376376}
    377377
    378 int owl_global_get_direction(owl_global *g) {
     378int owl_global_get_direction(const owl_global *g) {
    379379  return(g->direction);
    380380}
     
    394394}
    395395
    396 void *owl_global_get_perlinterp(owl_global *g) {
     396void *owl_global_get_perlinterp(const owl_global *g) {
    397397  return(g->perl);
    398398}
    399399
    400 int owl_global_is_config_format(owl_global *g) {
     400int owl_global_is_config_format(const owl_global *g) {
    401401  if (g->config_format) return(1);
    402402  return(0);
     
    498498/* debug */
    499499
    500 int owl_global_is_debug_fast(owl_global *g) {
     500int owl_global_is_debug_fast(const owl_global *g) {
    501501  if (g->debug) return(1);
    502502  return(0);
     
    505505/* starttime */
    506506
    507 time_t owl_global_get_starttime(owl_global *g) {
     507time_t owl_global_get_starttime(const owl_global *g) {
    508508  return(g->starttime);
    509509}
    510510
    511 time_t owl_global_get_runtime(owl_global *g) {
     511time_t owl_global_get_runtime(const owl_global *g) {
    512512  return(time(NULL)-g->starttime);
    513513}
    514514
    515 time_t owl_global_get_lastinputtime(owl_global *g) {
     515time_t owl_global_get_lastinputtime(const owl_global *g) {
    516516  return(g->lastinputtime);
    517517}
     
    521521}
    522522
    523 time_t owl_global_get_idletime(owl_global *g) {
     523time_t owl_global_get_idletime(const owl_global *g) {
    524524  return(time(NULL)-g->lastinputtime);
    525525}
    526526
    527 void owl_global_get_runtime_string(owl_global *g, char *buff) {
     527void owl_global_get_runtime_string(const owl_global *g, char *buff) {
    528528  time_t diff;
    529529
     
    534534}
    535535
    536 const char *owl_global_get_hostname(owl_global *g) {
     536const char *owl_global_get_hostname(const owl_global *g) {
    537537  if (g->thishost) return(g->thishost);
    538538  return("");
     
    549549}
    550550
    551 int owl_global_get_userclue(owl_global *g) {
     551int owl_global_get_userclue(const owl_global *g) {
    552552  return(g->userclue);
    553553}
    554554
    555 int owl_global_is_userclue(owl_global *g, int clue) {
     555int owl_global_is_userclue(const owl_global *g, int clue) {
    556556  if (g->userclue & clue) return(1);
    557557  return(0);
     
    567567/* vert offset */
    568568
    569 int owl_global_get_curmsg_vert_offset(owl_global *g) {
     569int owl_global_get_curmsg_vert_offset(const owl_global *g) {
    570570  return(g->curmsg_vert_offset);
    571571}
     
    595595}
    596596
    597 const char *owl_global_get_startupargs(owl_global *g) {
     597const char *owl_global_get_startupargs(const owl_global *g) {
    598598  if (g->startupargs) return(g->startupargs);
    599599  return("");
     
    616616}
    617617
    618 owl_filter *owl_global_get_filter(owl_global *g, const char *name) {
     618owl_filter *owl_global_get_filter(const owl_global *g, const char *name) {
    619619  int i, j;
    620620  owl_filter *f;
     
    663663/* has colors */
    664664
    665 int owl_global_get_hascolors(owl_global *g) {
     665int owl_global_get_hascolors(const owl_global *g) {
    666666  if (g->hascolors) return(1);
    667667  return(0);
     
    670670/* color pairs */
    671671
    672 int owl_global_get_colorpairs(owl_global *g) {
     672int owl_global_get_colorpairs(const owl_global *g) {
    673673  return(g->colorpairs);
    674674}
     
    707707}
    708708
    709 int owl_global_is_search_active(owl_global *g) {
     709int owl_global_is_search_active(const owl_global *g) {
    710710  if (owl_regex_is_set(&g->search_re)) return(1);
    711711  return(0);
     
    721721}
    722722
    723 const owl_regex *owl_global_get_search_re(owl_global *g) {
     723const owl_regex *owl_global_get_search_re(const owl_global *g) {
    724724  return &g->search_re;
    725725}
     
    729729}
    730730
    731 int owl_global_get_newmsgproc_pid(owl_global *g) {
     731int owl_global_get_newmsgproc_pid(const owl_global *g) {
    732732  return(g->newmsgproc_pid);
    733733}
     
    735735/* AIM stuff */
    736736
    737 int owl_global_is_aimloggedin(owl_global *g)
     737int owl_global_is_aimloggedin(const owl_global *g)
    738738{
    739739  if (g->aim_loggedin) return(1);
     
    741741}
    742742
    743 const char *owl_global_get_aim_screenname(owl_global *g)
     743const char *owl_global_get_aim_screenname(const owl_global *g)
    744744{
    745745  if (owl_global_is_aimloggedin(g)) {
     
    749749}
    750750
    751 const char *owl_global_get_aim_screenname_for_filters(owl_global *g)
     751const char *owl_global_get_aim_screenname_for_filters(const owl_global *g)
    752752{
    753753  if (owl_global_is_aimloggedin(g)) {
     
    776776}
    777777
    778 int owl_global_is_doaimevents(owl_global *g)
     778int owl_global_is_doaimevents(const owl_global *g)
    779779{
    780780  if (g->aim_doprocessing) return(1);
     
    843843/* Return the style with name 'name'.  If it does not exist return
    844844 * NULL */
    845 const owl_style *owl_global_get_style_by_name(owl_global *g, const char *name)
     845const owl_style *owl_global_get_style_by_name(const owl_global *g, const char *name)
    846846{
    847847  return owl_dict_find_element(&(g->styledict), name);
     
    850850/* creates a list and fills it in with keys.  duplicates the keys,
    851851 * so they will need to be freed by the caller. */
    852 int owl_global_get_style_names(owl_global *g, owl_list *l) {
     852int owl_global_get_style_names(const owl_global *g, owl_list *l) {
    853853  return owl_dict_get_keys(&(g->styledict), l);
    854854}
     
    873873}
    874874
    875 int owl_global_is_haveaim(owl_global *g)
     875int owl_global_is_haveaim(const owl_global *g)
    876876{
    877877  if (g->haveaim) return(1);
     
    889889}
    890890
    891 int owl_global_is_ignore_aimlogin(owl_global *g)
     891int owl_global_is_ignore_aimlogin(const owl_global *g)
    892892{
    893893    return g->ignoreaimlogin;
     
    899899}
    900900
    901 int owl_global_is_havezephyr(owl_global *g)
     901int owl_global_is_havezephyr(const owl_global *g)
    902902{
    903903  if (g->havezephyr) return(1);
     
    957957}
    958958
    959 int owl_global_is_interrupted(owl_global *g) {
     959int owl_global_is_interrupted(const owl_global *g) {
    960960  return g->interrupted;
    961961}
Note: See TracChangeset for help on using the changeset viewer.