Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • global.c

    r41c9a96 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}
     
    212212  g->markedmsgid=i;
    213213  /* i; index of message in the current view.
    214   owl_message *m;
     214  const owl_message *m;
    215215  owl_view *v;
    216216
     
    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}
     
    269269/* buffercommand */
    270270
    271 void owl_global_set_buffercommand(owl_global *g, char *command) {
     271void owl_global_set_buffercommand(owl_global *g, const char *command) {
    272272  owl_editwin_set_command(owl_global_get_typwin(g), command);
    273273}
    274274
    275 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 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 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("/");
     
    364364 * Setting this also sets startupfile to confdir/startup
    365365 */
    366 void owl_global_set_confdir(owl_global *g, char *cd) {
     366void owl_global_set_confdir(owl_global *g, const char *cd) {
    367367  free(g->confdir);
    368368  g->confdir = owl_strdup(cd);
     
    371371}
    372372
    373 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 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}
     
    577577/* startup args */
    578578
    579 void owl_global_set_startupargs(owl_global *g, int argc, char **argv) {
     579void owl_global_set_startupargs(owl_global *g, int argc, const char *const *argv) {
    580580  int i, len;
    581581
     
    595595}
    596596
    597 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, char *name) {
     618owl_filter *owl_global_get_filter(const owl_global *g, const char *name) {
    619619  int i, j;
    620620  owl_filter *f;
     
    634634}
    635635
    636 void owl_global_remove_filter(owl_global *g, char *name) {
     636void owl_global_remove_filter(owl_global *g, const char *name) {
    637637  int i, j;
    638638  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}
     
    684684}
    685685
    686 int owl_global_message_is_puntable(owl_global *g, owl_message *m) {
    687   owl_list *pl;
     686int owl_global_message_is_puntable(owl_global *g, const owl_message *m) {
     687  const owl_list *pl;
    688688  int i, j;
    689689
     
    697697
    698698int owl_global_should_followlast(owl_global *g) {
    699   owl_view *v;
     699  const owl_view *v;
    700700 
    701701  if (!owl_global_is__followlast(g)) return(0);
     
    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);
    712712}
    713713
    714 void owl_global_set_search_re(owl_global *g, owl_regex *re) {
     714void owl_global_set_search_re(owl_global *g, const owl_regex *re) {
    715715  if (owl_regex_is_set(&g->search_re)) {
    716716    owl_regex_free(&g->search_re);
     
    721721}
    722722
    723 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 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 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)) {
     
    757757}
    758758
    759 void owl_global_set_aimloggedin(owl_global *g, char *screenname)
    760 {
    761   char *sn_escaped, *quote;
     759void owl_global_set_aimloggedin(owl_global *g, const char *screenname)
     760{
     761  char *sn_escaped;
     762  const char *quote;
    762763  g->aim_loggedin=1;
    763764  if (g->aim_screenname) owl_free(g->aim_screenname);
     
    775776}
    776777
    777 int owl_global_is_doaimevents(owl_global *g)
     778int owl_global_is_doaimevents(const owl_global *g)
    778779{
    779780  if (g->aim_doprocessing) return(1);
     
    842843/* Return the style with name 'name'.  If it does not exist return
    843844 * NULL */
    844 owl_style *owl_global_get_style_by_name(owl_global *g, char *name)
     845const owl_style *owl_global_get_style_by_name(const owl_global *g, const char *name)
    845846{
    846847  return owl_dict_find_element(&(g->styledict), name);
     
    849850/* creates a list and fills it in with keys.  duplicates the keys,
    850851 * so they will need to be freed by the caller. */
    851 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) {
    852853  return owl_dict_get_keys(&(g->styledict), l);
    853854}
     
    872873}
    873874
    874 int owl_global_is_haveaim(owl_global *g)
     875int owl_global_is_haveaim(const owl_global *g)
    875876{
    876877  if (g->haveaim) return(1);
     
    888889}
    889890
    890 int owl_global_is_ignore_aimlogin(owl_global *g)
     891int owl_global_is_ignore_aimlogin(const owl_global *g)
    891892{
    892893    return g->ignoreaimlogin;
     
    898899}
    899900
    900 int owl_global_is_havezephyr(owl_global *g)
     901int owl_global_is_havezephyr(const owl_global *g)
    901902{
    902903  if (g->havezephyr) return(1);
     
    941942}
    942943
    943 char * owl_global_intern(owl_global *g, char * string)
     944const char * owl_global_intern(owl_global *g, const char * string)
    944945{
    945946  return owl_obarray_insert(&(g->obarray), string);
     
    956957}
    957958
    958 int owl_global_is_interrupted(owl_global *g) {
     959int owl_global_is_interrupted(const owl_global *g) {
    959960  return g->interrupted;
    960961}
Note: See TracChangeset for help on using the changeset viewer.