Changeset e1c4636 for fmtext.c


Ignore:
Timestamp:
Jul 9, 2002, 12:04:35 AM (19 years ago)
Author:
Erik Nygren <nygren@mit.edu>
Branches:
master, barnowl_perlaim, debian, owl, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
Children:
2c8a07c
Parents:
10b866d
Message:
* Added owl::send_zwrite(command, message) to the perl glue
         to allow for the direct sending of multi-line messages.
         For example:  owl::send_zwrite("-c foo -i bar", "hello");
* Reverted attempted fix for the pagedown problem
         which just made things worse.
* Changed owl_fmtext_print_plain to return an alloc'd string to
         avoid buffer overrun risks.
* Added owl::ztext_stylestrip("...") function to perlglue
          which returns the ztext with formatting stripped out.
* Added colorztext variable which can be used to disable @color()
          strings arriving in messages after it is set.
          (Currently, changing its value won't reformat messages).
* Outgoing zephyr logging now obeys the logpath variable.
* The '~' character in logpath and classlogpath now gets
          replaced with the user's home directory.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • fmtext.c

    r1aee7d9 re1c4636  
    180180        /* if it's a color read the color, set the current color and
    181181           continue */
    182       } else if (!strcasecmp(buff, "@color") && owl_global_get_hascolors(&g)) {
     182      } else if (!strcasecmp(buff, "@color")
     183                 && owl_global_get_hascolors(&g)
     184                 && owl_global_is_colorztext(&g)) {
    183185        owl_free(buff);
    184186        txtptr+=7;
     
    325327
    326328
    327 void owl_fmtext_print_plain(owl_fmtext *f, char *buff) {
    328   strcpy(buff, f->textbuff);
     329/* caller is responsible for freeing */
     330char *owl_fmtext_print_plain(owl_fmtext *f) {
     331  return owl_strdup(f->textbuff);
     332}
     333
     334/* strips formatting from ztext and returns the unformatted text.
     335 * caller is responsible for freeing. */
     336char *owl_fmtext_ztext_stylestrip(char *zt) {
     337  owl_fmtext fm;
     338  char *plaintext;
     339
     340  owl_fmtext_init_null(&fm);
     341  owl_fmtext_append_ztext(&fm, zt);
     342  plaintext = owl_fmtext_print_plain(&fm);
     343  owl_fmtext_free(&fm);
     344  return(plaintext);
    329345}
    330346
Note: See TracChangeset for help on using the changeset viewer.