Changeset 7869e48 for functions.c


Ignore:
Timestamp:
Jan 12, 2013, 1:43:13 PM (12 years ago)
Author:
Jason Gross <jgross@mit.edu>
Children:
e3a0d71, 4485285
Parents:
4626016
git-author:
Jason Gross <jgross@mit.edu> (01/12/13 13:13:18)
git-committer:
Jason Gross <jgross@mit.edu> (01/12/13 13:43:13)
Message:
Remove trailing whitespace

This commit was made with the command sequence

    for i in $(git ls-files | tr '\n' ' ');
    do
      echo $i; sed -i s'/\s\+$//g' "$(readlink -f $i)";
    done
File:
1 edited

Legend:

Unmodified
Added
Removed
  • functions.c

    r06470d7 r7869e48  
    88{
    99  owl_function_debugmsg("executing command: %s", cmdbuff);
    10   return owl_cmddict_execute(owl_global_get_cmddict(&g), 
     10  return owl_cmddict_execute(owl_global_get_cmddict(&g),
    1111                             owl_global_get_context(&g), cmdbuff);
    1212}
     
    198198  m=g_new(owl_message, 1);
    199199  owl_message_create_admin(m, header, body);
    200  
     200
    201201  /* add it to the global list and current view */
    202202  owl_messagelist_append_element(owl_global_get_msglist(&g), m);
     
    250250  /* error if we're not logged into aim */
    251251  if (!owl_global_is_aimloggedin(&g)) return(NULL);
    252  
     252
    253253  m=g_new(owl_message, 1);
    254254  owl_message_create_aim(m,
     
    455455  if (unwrap)
    456456    owl_text_wordunwrap(format_msg);
    457  
     457
    458458  /* send the message */
    459459  ret=owl_aim_send_im(to, format_msg);
     
    485485  format_msg=g_strdup(msg);
    486486  owl_text_wordunwrap(format_msg);
    487  
     487
    488488  /* send the message */
    489489  ret=owl_aim_send_awaymsg(to, format_msg);
     
    534534
    535535/* If filter is non-null, looks for the next message matching
    536  * that filter.  If skip_deleted, skips any deleted messages. 
     536 * that filter.  If skip_deleted, skips any deleted messages.
    537537 * If last_if_none, will stop at the last message in the view
    538538 * if no matching messages are found.  */
     
    707707
    708708  if (move_after) {
    709     /* move the poiner in the appropriate direction 
     709    /* move the poiner in the appropriate direction
    710710     * to the next undeleted msg */
    711711    if (owl_global_get_direction(&g)==OWL_DIRECTION_UPWARDS) {
     
    723723
    724724  v=owl_global_get_current_view(&g);
    725  
     725
    726726  if (owl_view_get_size(v) < 1) {
    727727    owl_function_error("No current message to undelete");
     
    801801
    802802  owl_function_redisplay_to_nearest(lastmsgid, v);
    803  
     803
    804804  owl_function_makemsg("Messages expunged");
    805805}
     
    820820  v=owl_global_get_current_view(&g);
    821821  oldcurmsg=owl_global_get_curmsg(&g);
    822   curmsg=owl_view_get_size(v)-1; 
     822  curmsg=owl_view_get_size(v)-1;
    823823  if (curmsg<0) curmsg=0;
    824824  owl_global_set_curmsg(&g, curmsg);
     
    830830    owl_global_set_topmsg(&g, curmsg+1);
    831831    owl_global_set_curmsg(&g, curmsg+1);
    832   } 
     832  }
    833833  owl_mainwin_redisplay(owl_global_get_mainwin(&g));
    834834  owl_global_set_direction_downwards(&g);
     
    995995{
    996996  char *ret;
    997  
     997
    998998  /* zlog out if we need to */
    999999  if (owl_global_is_havezephyr(&g) &&
     
    10101010    kill(owl_global_get_newmsgproc_pid(&g), SIGHUP);
    10111011  }
    1012  
     1012
    10131013  /* Quit AIM */
    10141014  if (owl_global_is_aimloggedin(&g)) {
     
    10601060}
    10611061
    1062 /* Returns what the new topmsg should be. 
    1063  * Passed the last direction of movement, 
     1062/* Returns what the new topmsg should be.
     1063 * Passed the last direction of movement,
    10641064 * the current view,
    10651065 * the current message number in the view,
     
    10741074int owl_function_calculate_topmsg_neartop(int direction, const owl_view *v, int curmsg, int topmsg, int recwinlines)
    10751075{
    1076   if (curmsg>0 
     1076  if (curmsg>0
    10771077      && (owl_message_get_numlines(owl_view_get_element(v, curmsg-1))
    10781078          <  recwinlines/2)) {
     
    10821082  }
    10831083}
    1084  
     1084
    10851085int owl_function_calculate_topmsg_center(int direction, const owl_view *v, int curmsg, int topmsg, int recwinlines)
    10861086{
     
    10961096  return(last);
    10971097}
    1098  
     1098
    10991099int owl_function_calculate_topmsg_paged(int direction, const owl_view *v, int curmsg, int topmsg, int recwinlines, int center_on_page)
    11001100{
    11011101  int i, last, lines, savey;
    1102  
    1103   /* If we're off the top of the screen, scroll up such that the 
     1102
     1103  /* If we're off the top of the screen, scroll up such that the
    11041104   * curmsg is near the botton of the screen. */
    11051105  if (curmsg < topmsg) {
     
    11421142
    11431143  if (curmsg<0) return(topmsg);
    1144    
     1144
    11451145  /* If we're off the top of the screen then center */
    11461146  if (curmsg<topmsg) {
     
    11671167    direction=OWL_DIRECTION_UPWARDS;
    11681168  }
    1169  
     1169
    11701170  /* If our bottom line is less than 1/4 down the screen then scroll up */
    11711171  if (direction == OWL_DIRECTION_UPWARDS || direction == OWL_DIRECTION_NONE) {
     
    13861386
    13871387  owl_fmtext_init_null(&fm);
    1388  
     1388
    13891389  v=owl_global_get_current_view(&g);
    13901390  m=owl_view_get_element(v, owl_global_get_curmsg(&g));
     
    14221422  if (owl_message_is_type_zephyr(m)) {
    14231423    owl_fmtext_append_bold(&fm, "\nZephyr Specific Information:\n");
    1424    
     1424
    14251425    owl_fmtext_appendf_normal(&fm, "  Class     : %s\n", owl_message_get_class(m));
    14261426    owl_fmtext_appendf_normal(&fm, "  Instance  : %s\n", owl_message_get_instance(m));
     
    14931493  owl_message_attributes_tofmtext(m, &attrfm);
    14941494  owl_fmtext_append_fmtext(&fm, &attrfm);
    1495  
     1495
    14961496  owl_function_popless_fmtext(&fm);
    14971497  owl_fmtext_cleanup(&fm);
     
    15481548      return;
    15491549    }
    1550    
     1550
    15511551    /* Bail if we're not truncated */
    15521552    if (!owl_mainwin_is_curmsg_truncated(owl_global_get_mainwin(&g))) {
     
    15551555    }
    15561556  }
    1557  
    1558  
     1557
     1558
    15591559  /* don't scroll past the last line */
    15601560  if (step>0) {
     
    15741574    }
    15751575  }
    1576  
     1576
    15771577  /* redisplay */
    15781578  owl_mainwin_redisplay(owl_global_get_mainwin(&g));
     
    16171617    owl_function_popless_text("Error getting subscriptions");
    16181618  }
    1619            
     1619
    16201620  g_free(buff);
    16211621}
     
    16581658  const owl_variable *v;
    16591659  GPtrArray *varnames;
    1660   owl_fmtext fm; 
     1660  owl_fmtext fm;
    16611661  int i;
    16621662  const char *varname;
    16631663
    16641664  owl_fmtext_init_null(&fm);
    1665   owl_fmtext_append_bold(&fm, 
     1665  owl_fmtext_append_bold(&fm,
    16661666      "Variables: (use 'show variable <name>' for details)\n");
    16671667  varnames = owl_variable_dict_get_names(owl_global_get_vardict(&g));
     
    16811681{
    16821682  const owl_variable *v;
    1683   owl_fmtext fm; 
     1683  owl_fmtext fm;
    16841684
    16851685  owl_fmtext_init_null(&fm);
     
    18191819  owl_fmtext_append_normal(&fm, "no\n");
    18201820#endif
    1821  
     1821
    18221822
    18231823  owl_fmtext_append_normal(&fm, "\nAIM Status:\n");
     
    18721872  const owl_message *m;
    18731873  const owl_filter *f;
    1874  
     1874
    18751875  if (owl_view_get_size(owl_global_get_current_view(&g))==0) {
    18761876    owl_function_error("No message selected");
    18771877  } else {
    18781878    char *cmd;
    1879    
     1879
    18801880    m=owl_view_get_element(owl_global_get_current_view(&g), owl_global_get_curmsg(&g));
    18811881    if (!m) {
     
    20202020#if OWL_STDERR_REDIR
    20212021  redirect = " < /dev/null";
    2022 #endif 
     2022#endif
    20232023
    20242024  if (argc<2) {
     
    20362036    out = owl_slurp(p);
    20372037    pclose(p);
    2038    
     2038
    20392039    if (type == OWL_OUTPUT_RETURN) {
    20402040      g_free(newbuff);
     
    20672067
    20682068  perlout = owl_perlconfig_execute(buff);
    2069   if (perlout) { 
     2069  if (perlout) {
    20702070    if (type == OWL_OUTPUT_POPUP) {
    20712071      owl_function_popless_text(perlout);
     
    21142114  /* Figure out what to set the current message to.
    21152115   * - If the view we're leaving has messages in it, go to the closest message
    2116    *   to the last message pointed to in that view. 
     2116   *   to the last message pointed to in that view.
    21172117   * - If the view we're leaving is empty, try to restore the position
    21182118   *   from the last time we were in the new view.  */
     
    22272227
    22282228  owl_function_debugmsg("owl_function_create_negative_filter");
    2229  
     2229
    22302230  if (!strncmp(filtername, "not-", 4)) {
    22312231    newname=g_strdup(filtername+4);
     
    23162316 * If 'related' is nonzero, encompass unclasses and .d classes as well.
    23172317 */
    2318 CALLER_OWN char *owl_function_classinstfilt(const char *c, const char *i, int related) 
     2318CALLER_OWN char *owl_function_classinstfilt(const char *c, const char *i, int related)
    23192319{
    23202320  owl_filter *f;
     
    23502350    }
    23512351  }
    2352  
     2352
    23532353  /* if it already exists then go with it.  This lets users override */
    23542354  if (owl_global_get_filter(&g, filtname)) {
     
    25402540  owl_function_makemsg("%i messages marked for %sdeletion", j, flag?"":"un");
    25412541
    2542   owl_mainwin_redisplay(owl_global_get_mainwin(&g)); 
     2542  owl_mainwin_redisplay(owl_global_get_mainwin(&g));
    25432543}
    25442544
     
    25882588 * If the curmsg is a zephyr class message, instance foo, recip *,
    25892589 *    return a filter name to the class, inst.
    2590  * If the curmsg is a zephyr class message and type==0 then 
     2590 * If the curmsg is a zephyr class message and type==0 then
    25912591 *    return a filter name for just the class.
    2592  * If the curmsg is a zephyr class message and type==1 then 
     2592 * If the curmsg is a zephyr class message and type==1 then
    25932593 *    return a filter name for the class and instance.
    25942594 * If the curmsg is a personal AIM message returna  filter
    2595  *    name to the AIM conversation with that user 
     2595 *    name to the AIM conversation with that user
    25962596 */
    25972597CALLER_OWN char *owl_function_smartfilter(int type, int invert_related)
     
    26702670void owl_function_smartzpunt(int type)
    26712671{
    2672   /* Starts a zpunt command based on the current class,instance pair. 
     2672  /* Starts a zpunt command based on the current class,instance pair.
    26732673   * If type=0, uses just class.  If type=1, uses instance as well. */
    26742674  const owl_view *v;
     
    26762676  const char *mclass, *minst;
    26772677  GString *buf;
    2678  
     2678
    26792679  v=owl_global_get_current_view(&g);
    26802680  m=owl_view_get_element(v, owl_global_get_curmsg(&g));
     
    27592759  }
    27602760  owl_filter_set_fgcolor(f, owl_util_string_to_color(fgcolor));
    2761  
     2761
    27622762  owl_mainwin_redisplay(owl_global_get_mainwin(&g));
    27632763  return(0);
     
    27672767{
    27682768  owl_fmtext fm;
    2769   int i; 
    2770  
     2769  int i;
     2770
    27712771  owl_fmtext_init_null(&fm);
    27722772  owl_fmtext_append_normal(&fm,"default:  ");
     
    28052805     g_free(str2);
    28062806  }
    2807  
     2807
    28082808  owl_function_popless_fmtext(&fm);
    28092809  owl_fmtext_cleanup(&fm);
     
    29232923  }
    29242924  owl_fmtext_append_normal(&fm, "\n");
    2925  
     2925
    29262926  owl_function_popless_fmtext(&fm);
    29272927  owl_ptr_array_free(l, g_free);
     
    29312931CALLER_OWN char *owl_function_keymap_summary(const char *name)
    29322932{
    2933   const owl_keymap *km 
     2933  const owl_keymap *km
    29342934    = owl_keyhandler_get_keymap(owl_global_get_keyhandler(&g), name);
    29352935  if (km) return owl_keymap_summary(km);
     
    29492949  } else {
    29502950    owl_fmtext_append_normal(&fm, "No such keymap...\n");
    2951   } 
     2951  }
    29522952  owl_function_popless_fmtext(&fm);
    29532953  owl_fmtext_cleanup(&fm);
     
    29602960  owl_fmtext_init_null(&fm);
    29612961  owl_cmd_get_help(owl_global_get_cmddict(&g), cmdname, &fm);
    2962   owl_function_popless_fmtext(&fm); 
     2962  owl_function_popless_fmtext(&fm);
    29632963  owl_fmtext_cleanup(&fm);
    29642964}
     
    29932993  viewsize=owl_view_get_size(v);
    29942994  curmsg=owl_global_get_curmsg(&g);
    2995  
     2995
    29962996  if (viewsize==0) {
    29972997    owl_function_makemsg("No messages present");
     
    30413041}
    30423042
    3043 /* strips formatting from ztext and returns the unformatted text. 
     3043/* strips formatting from ztext and returns the unformatted text.
    30443044 * caller is responsible for freeing. */
    30453045CALLER_OWN char *owl_function_ztext_stylestrip(const char *zt)
     
    31673167
    31683168/* Dump messages in the current view to the file 'filename'. */
    3169 void owl_function_dump(const char *filename) 
     3169void owl_function_dump(const char *filename)
    31703170{
    31713171  int i, j;
     
    32213221      }
    32223222    }
    3223    
     3223
    32243224    /* if it exited, spawn a new one */
    32253225    if (owl_global_get_newmsgproc_pid(&g)==0) {
Note: See TracChangeset for help on using the changeset viewer.