Changeset b2b0773


Ignore:
Timestamp:
Jun 9, 2003, 10:54:18 AM (21 years ago)
Author:
James M. Kretchmar <kretch@mit.edu>
Branches:
master, barnowl_perlaim, debian, owl, release-1.10, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
Children:
6bf73ce
Parents:
d559df9
Message:
Changes to help build on OSX
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • ChangeLog

    rdafd919 rb2b0773  
    44        Don't ring the terminal bell on mail messages.
    55        Nuke <FONT>
     6        Make the build work a little better on OSX
    67       
    782.0.2
  • aim.c

    rd559df9 rb2b0773  
    295295
    296296  aim_send_login(sess, fr->conn, priv->screenname, priv->password, &info, key);
    297 
     297 
    298298  return 1;
    299299}
     
    466466  if (!priv->screenname || !priv->password) {
    467467    /* printf("need SN and password\n"); */
    468     return -1;
     468    return(-1);
    469469  }
    470470
     
    479479    }
    480480    aim_conn_kill(sess, &authconn);
    481 
    482     return (-1);
     481    return(-1);
    483482  }
    484483
     
    492491
    493492  /* printf("login request sent\n"); */
    494 
    495493  return(0);
    496494}
  • buddylist.c

    rd559df9 rb2b0773  
    3737  }
    3838}
    39    
    40 
    4139
    4240/* Deal with an "offgoing" message.  This means recognizing the user
     
    7270}
    7371
     72/* return the number of logged in buddies */
    7473int owl_buddylist_get_size(owl_buddylist *b)
    7574{
     
    7776}
    7877
     78/* get buddy number 'n' */
    7979char *owl_buddylist_get_buddy(owl_buddylist *b, int n)
    8080{
     
    8282}
    8383
     84/* remove all buddies from the list */
    8485void owl_buddylist_clear(owl_buddylist *b) {
    8586  owl_list_free_all(&(b->buddies), owl_free);
  • fmtext.c

    rd559df9 rb2b0773  
    55static const char fileIdent[] = "$Id$";
    66
     7/* initialize an fmtext with no data */
    78void owl_fmtext_init_null(owl_fmtext *f)
    89{
     
    1516}
    1617
    17 
     18/* Internal function.  Set the attribute 'attr' from index 'first' to
     19 * index 'last'
     20 */
    1821void _owl_fmtext_set_attr(owl_fmtext *f, int attr, int first, int last)
    1922{
     
    2427}
    2528
     29/* Internal function.  Add the attribute 'attr' to the existing
     30 * attributes from index 'first' to index 'last'
     31 */
    2632void _owl_fmtext_add_attr(owl_fmtext *f, int attr, int first, int last)
    2733{
     
    3238}
    3339
     40/* Internal function.  Set the color to be 'color' from index 'first'
     41 * to index 'last
     42 */
    3443void _owl_fmtext_set_color(owl_fmtext *f, int color, int first, int last)
    3544{
     
    4049}
    4150
    42 
     51/* append text to the end of 'f' with attribute 'attr' and color
     52 * 'color'
     53 */
    4354void owl_fmtext_append_attr(owl_fmtext *f, char *text, int attr, int color)
    4455{
     
    5667}
    5768
    58 
     69/* Append normal, uncolored text 'text' to 'f' */
    5970void owl_fmtext_append_normal(owl_fmtext *f, char *text)
    6071{
     
    6273}
    6374
     75/* Append normal text 'text' to 'f' with color 'color' */
    6476void owl_fmtext_append_normal_color(owl_fmtext *f, char *text, int color)
    6577{
     
    6779}
    6880
    69 
     81/* Append bold text 'text' to 'f' */
    7082void owl_fmtext_append_bold(owl_fmtext *f, char *text)
    7183{
     
    7385}
    7486
    75 
     87/* Append reverse video text 'text' to 'f' */
    7688void owl_fmtext_append_reverse(owl_fmtext *f, char *text)
    7789{
     
    7991}
    8092
    81 
     93/* Append reversed and bold, uncolored text 'text' to 'f' */
    8294void owl_fmtext_append_reversebold(owl_fmtext *f, char *text)
    8395{
     
    8597}
    8698
    87 
     99/* Add the attribute 'attr' to all text in 'f' */
    88100void owl_fmtext_addattr(owl_fmtext *f, int attr)
    89101{
     
    97109}
    98110
     111/* Anywhere the color is NOT ALREDY SET, set the color to 'color'.
     112 * Other colors are left unchanged
     113 */
    99114void owl_fmtext_colorize(owl_fmtext *f, int color)
    100115{
     
    108123}
    109124
    110 
     125/* Append the text 'text' to 'f' and interpret the zephyr style
     126 * formatting syntax to set appropriate attributes.
     127 */
    111128void owl_fmtext_append_ztext(owl_fmtext *f, char *text)
    112129{
     
    293310    }
    294311  }
    295 
    296 }
    297 
    298 /* This is used internally to fmtext.  Use owl_fmtext_append_fmtext()
    299  * (no initial underscore) externally */
     312}
     313
     314/* Internal function.  Append text from 'in' between index 'start' and
     315 * 'stop' to the end of 'f'
     316 */
    300317void _owl_fmtext_append_fmtext(owl_fmtext *f, owl_fmtext *in, int start, int stop)
    301318{
     
    316333}
    317334
     335/* append fmtext 'in' to 'f' */
    318336void owl_fmtext_append_fmtext(owl_fmtext *f, owl_fmtext *in)
    319337{
     
    322340}
    323341
     342/* Append 'nspaces' number of spaces to the end of 'f' */
    324343void owl_fmtext_append_spaces(owl_fmtext *f, int nspaces)
    325344{
     
    358377}
    359378
    360 
    361 /* caller is responsible for freeing */
     379/* Return a plain version of the fmtext.  Caller is responsible for
     380 * freeing the return
     381 */
    362382char *owl_fmtext_print_plain(owl_fmtext *f)
    363383{
    364   return owl_strdup(f->textbuff);
    365 }
    366 
    367 
     384  return(owl_strdup(f->textbuff));
     385}
     386
     387/* add the formatted text to the curses window 'w'.  The window 'w'
     388 * must already be initiatlized with curses
     389 */
    368390void owl_fmtext_curs_waddstr(owl_fmtext *f, WINDOW *w)
    369391{
     
    422444
    423445
     446/* start with line 'aline' (where the first line is 0) and print
     447 * 'lines' number of lines into 'out'
     448 */
    424449int owl_fmtext_truncate_lines(owl_fmtext *in, int aline, int lines, owl_fmtext *out)
    425450{
    426   /* start with line aline (where the first line is 0) and print
    427    *  'lines' lines
    428    */
    429451  char *ptr1, *ptr2;
    430452  int i, offset;
     
    445467
    446468  for (i=0; i<lines; i++) {
    447     ptr2=strchr(ptr1, '\n');
    448469    offset=ptr1-in->textbuff;
     470    ptr2=strchr(ptr1, '\n'); /* this is a valgrind suspicious line */
    449471    if (!ptr2) {
    450       _owl_fmtext_append_fmtext(out, in, offset, in->textlen-1);
     472      _owl_fmtext_append_fmtext(out, in, offset, (in->textlen)-1);
    451473      return(-1);
    452474    }
     
    457479}
    458480
    459  
    460 /* the first column is column 0 */
    461 /* the message is expected to end in a new line for now */
     481/* Truncate the message so that each line begins at column 'acol' and
     482 * ends at 'bcol' or sooner.  The first column is number 0.  The new
     483 * message is placed in 'out'.  The message is * expected to end in a
     484 * new line for now
     485 */
    462486void owl_fmtext_truncate_cols(owl_fmtext *in, int acol, int bcol, owl_fmtext *out)
    463487{
     
    504528}
    505529
    506 
     530/* Return the number of lines in 'f' */
    507531int owl_fmtext_num_lines(owl_fmtext *f)
    508532{
     
    522546}
    523547
    524 
    525548char *owl_fmtext_get_text(owl_fmtext *f)
    526549{
     
    536559}
    537560
     561/* Free all memory allocated by the object */
    538562void owl_fmtext_free(owl_fmtext *f)
    539563{
     
    543567}
    544568
    545 
     569/* Make a copy of the fmtext 'src' into 'dst' */
    546570void owl_fmtext_copy(owl_fmtext *dst, owl_fmtext *src)
    547571{
     572  int mallocsize;
     573
     574  if (src->textlen==0) {
     575    mallocsize=5;
     576  } else {
     577    mallocsize=src->textlen+2;
     578  }
    548579  dst->textlen=src->textlen;
    549   dst->textbuff=owl_malloc(src->textlen+5);
    550   dst->fmbuff=owl_malloc(src->textlen+5);
    551   dst->colorbuff=owl_malloc(src->textlen+5);
     580  dst->textbuff=owl_malloc(mallocsize); /* valgrind suspcious line */
     581  dst->fmbuff=owl_malloc(mallocsize);
     582  dst->colorbuff=owl_malloc(mallocsize);
    552583  memcpy(dst->textbuff, src->textbuff, src->textlen);
    553584  memcpy(dst->fmbuff, src->fmbuff, src->textlen);
     
    555586}
    556587
    557 
    558588/* highlight all instance of "string".  Return the number of
    559  * instances found.  This is case insensitive.
     589 * instances found.  This is a case insensitive search.
    560590 */
    561591int owl_fmtext_search_and_highlight(owl_fmtext *f, char *string)
     
    582612}
    583613
    584 /* return 1 if the string is found, 0 if not.  This is case
    585  *  insensitive
     614/* return 1 if the string is found, 0 if not.  This is a case
     615 *  insensitive search.
    586616 */
    587617int owl_fmtext_search(owl_fmtext *f, char *string)
  • owl.c

    rdafd919 rb2b0773  
    2626
    2727static const char fileIdent[] = "$Id$";
     28
     29owl_global g;
    2830
    2931int main(int argc, char **argv, char **env) {
  • owl.h

    rdafd919 rb2b0773  
    422422
    423423/* globals */
    424 owl_global g;
     424extern owl_global g;
    425425
    426426#include "owl_prototypes.h"
  • popwin.c

    r1aee7d9 rb2b0773  
    33static const char fileIdent[] = "$Id$";
    44
    5 int owl_popwin_init(owl_popwin *pw) {
     5int owl_popwin_init(owl_popwin *pw)
     6{
    67  pw->active=0;
    78  pw->needsfirstrefresh=0;
     
    1112}
    1213
    13 int owl_popwin_up(owl_popwin *pw) {
     14int owl_popwin_up(owl_popwin *pw)
     15{
    1416  int glines, gcols, startcol, startline;
    1517
     
    5052}
    5153
    52 int owl_popwin_display_text(owl_popwin *pw, char *text) {
     54int owl_popwin_display_text(owl_popwin *pw, char *text)
     55{
    5356  waddstr(pw->popwin, text);
    5457  wnoutrefresh(pw->popwin);
     
    5962}             
    6063
    61 int owl_popwin_close(owl_popwin *pw) {
     64int owl_popwin_close(owl_popwin *pw)
     65{
    6266  delwin(pw->popwin);
    6367  delwin(pw->borderwin);
     
    6973}
    7074
    71 int owl_popwin_is_active(owl_popwin *pw) {
     75int owl_popwin_is_active(owl_popwin *pw)
     76{
    7277  if (pw->active==1) return(1);
    7378  return(0);
    7479}
    7580
    76 int owl_popwin_refresh(owl_popwin *pw) {
    77   /* this will refresh the border as well as the text area */
     81/* this will refresh the border as well as the text area */
     82int owl_popwin_refresh(owl_popwin *pw)
     83{
    7884  touchwin(pw->borderwin);
    7985  touchwin(pw->popwin);
     
    8591}
    8692
    87 void owl_popwin_set_handler(owl_popwin *pw, void (*func)(int ch)) {
     93void owl_popwin_set_handler(owl_popwin *pw, void (*func)(int ch))
     94{
    8895  pw->handler=func;
    8996}
    9097
    91 void owl_popwin_unset_handler(owl_popwin *pw) {
     98void owl_popwin_unset_handler(owl_popwin *pw)
     99{
    92100  pw->handler=NULL;
    93101}
    94102
    95 WINDOW *owl_popwin_get_curswin(owl_popwin *pw) {
     103WINDOW *owl_popwin_get_curswin(owl_popwin *pw)
     104{
    96105  return(pw->popwin);
    97106}
    98107
    99 int owl_popwin_get_lines(owl_popwin *pw) {
     108int owl_popwin_get_lines(owl_popwin *pw)
     109{
    100110  return(pw->lines-2);
    101111}
    102112
    103 int owl_popwin_get_cols(owl_popwin *pw) {
     113int owl_popwin_get_cols(owl_popwin *pw)
     114{
    104115  return(pw->cols-2);
    105116}
    106117
    107 int owl_popwin_needs_first_refresh(owl_popwin *pw) {
     118int owl_popwin_needs_first_refresh(owl_popwin *pw)
     119{
    108120  if (pw->needsfirstrefresh) return(1);
    109121  return(0);
    110122}
    111123
    112 void owl_popwin_no_needs_first_refresh(owl_popwin *pw) {
     124void owl_popwin_no_needs_first_refresh(owl_popwin *pw)
     125{
    113126  pw->needsfirstrefresh=0;
    114127}
  • tester.c

    re1c4636 rb2b0773  
    44
    55static const char fileIdent[] = "$Id$";
     6
     7owl_global g;
    68
    79void screeninit() {
  • util.c

    r378fa14 rb2b0773  
    33#include <string.h>
    44#include <unistd.h>
    5 #include <malloc.h>
    65#include <unistd.h>
    76#include <ctype.h>
  • viewwin.c

    r3a2daac rb2b0773  
    66#define BOTTOM_OFFSET 1
    77
    8 void owl_viewwin_init_text(owl_viewwin *v, WINDOW *win, int winlines, int wincols, char *text) {
    9   /* initialize the viewwin e.
    10    * 'win' is an already initialzed curses window that will be used by viewwin
    11    */
    12 
     8/* initialize the viewwin e.  'win' is an already initialzed curses
     9 * window that will be used by viewwin
     10 */
     11void owl_viewwin_init_text(owl_viewwin *v, WINDOW *win, int winlines, int wincols, char *text)
     12{
    1313  owl_fmtext_init_null(&(v->fmtext));
    1414  if (text) {
     
    2626}
    2727
    28 void owl_viewwin_init_fmtext(owl_viewwin *v, WINDOW *win, int winlines, int wincols, owl_fmtext *fmtext) {
    29   /* initialize the viewwin e.
    30    * 'win' is an already initialzed curses window that will be used by viewwin
    31    */
    32 
     28/* initialize the viewwin e.  'win' is an already initialzed curses
     29 * window that will be used by viewwin
     30 */
     31void owl_viewwin_init_fmtext(owl_viewwin *v, WINDOW *win, int winlines, int wincols, owl_fmtext *fmtext)
     32{
    3333  owl_fmtext_copy(&(v->fmtext), fmtext);
    3434  v->textlines=owl_fmtext_num_lines(&(v->fmtext));
     
    4040}
    4141
    42 void owl_viewwin_set_curswin(owl_viewwin *v, WINDOW *w, int winlines, int wincols) {
     42void owl_viewwin_set_curswin(owl_viewwin *v, WINDOW *w, int winlines, int wincols)
     43{
    4344  v->curswin=w;
    4445  v->winlines=winlines;
     
    4647}
    4748
    48 void owl_viewwin_redisplay(owl_viewwin *v, int update) {
    49   /* regenerate text on the curses window. */
    50   /* if update == 1 then do a doupdate() */
    51 
     49/* regenerate text on the curses window. */
     50/* if update == 1 then do a doupdate() */
     51void owl_viewwin_redisplay(owl_viewwin *v, int update)
     52{
    5253  owl_fmtext fm1, fm2;
    5354 
     
    8283}
    8384
    84 void owl_viewwin_pagedown(owl_viewwin *v) {
     85void owl_viewwin_pagedown(owl_viewwin *v)
     86{
    8587  v->topline+=v->winlines - BOTTOM_OFFSET;
    8688  if ( (v->topline+v->winlines-BOTTOM_OFFSET) > v->textlines) {
     
    8991}
    9092
    91 void owl_viewwin_linedown(owl_viewwin *v) {
     93void owl_viewwin_linedown(owl_viewwin *v)
     94{
    9295  v->topline++;
    9396  if ( (v->topline+v->winlines-BOTTOM_OFFSET) > v->textlines) {
     
    9699}
    97100
    98 void owl_viewwin_pageup(owl_viewwin *v) {
     101void owl_viewwin_pageup(owl_viewwin *v)
     102{
    99103  v->topline-=v->winlines;
    100104  if (v->topline<0) v->topline=0;
    101105}
    102106
    103 void owl_viewwin_lineup(owl_viewwin *v) {
     107void owl_viewwin_lineup(owl_viewwin *v)
     108{
    104109  v->topline--;
    105110  if (v->topline<0) v->topline=0;
    106111}
    107112
    108 void owl_viewwin_right(owl_viewwin *v, int n) {
     113void owl_viewwin_right(owl_viewwin *v, int n)
     114{
    109115  v->rightshift+=n;
    110116}
    111117
    112 void owl_viewwin_left(owl_viewwin *v, int n) {
     118void owl_viewwin_left(owl_viewwin *v, int n)
     119{
    113120  v->rightshift-=n;
    114121  if (v->rightshift<0) v->rightshift=0;
    115122}
    116123
    117 void owl_viewwin_top(owl_viewwin *v) {
     124void owl_viewwin_top(owl_viewwin *v)
     125{
    118126  v->topline=0;
    119127  v->rightshift=0;
    120128}
    121129
    122 void owl_viewwin_bottom(owl_viewwin *v) {
     130void owl_viewwin_bottom(owl_viewwin *v)
     131{
    123132  v->topline = v->textlines - v->winlines + BOTTOM_OFFSET;
    124133}
    125134
    126 void owl_viewwin_free(owl_viewwin *v) {
     135void owl_viewwin_free(owl_viewwin *v)
     136{
    127137  owl_fmtext_free(&(v->fmtext));
    128138}
Note: See TracChangeset for help on using the changeset viewer.