Changeset 7ba9e0de


Ignore:
Timestamp:
May 16, 2010, 1:15:15 AM (14 years ago)
Author:
David Benjamin <davidben@mit.edu>
Branches:
master, release-1.10, release-1.7, release-1.8, release-1.9
Children:
3687413
Parents:
700dc91
git-author:
David Benjamin <davidben@mit.edu> (05/14/10 17:40:48)
git-committer:
David Benjamin <davidben@mit.edu> (05/16/10 01:15:15)
Message:
Define constants for output switches

Remembering 0, 1, and 2 is really just awful.

Signed-off-by: David Benjamin <davidben@mit.edu>
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • commands.c

    r700dc91 r7ba9e0de  
    16081608char *owl_command_exec(int argc, const char *const *argv, const char *buff)
    16091609{
    1610   return owl_function_exec(argc, argv, buff, 0);
     1610  return owl_function_exec(argc, argv, buff, OWL_OUTPUT_RETURN);
    16111611}
    16121612
    16131613char *owl_command_pexec(int argc, const char *const *argv, const char *buff)
    16141614{
    1615   return owl_function_exec(argc, argv, buff, 1);
     1615  return owl_function_exec(argc, argv, buff, OWL_OUTPUT_POPUP);
    16161616}
    16171617
    16181618char *owl_command_aexec(int argc, const char *const *argv, const char *buff)
    16191619{
    1620   return owl_function_exec(argc, argv, buff, 2);
     1620  return owl_function_exec(argc, argv, buff, OWL_OUTPUT_ADMINMSG);
    16211621}
    16221622
    16231623char *owl_command_perl(int argc, const char *const *argv, const char *buff)
    16241624{
    1625   return owl_function_perl(argc, argv, buff, 0);
     1625  return owl_function_perl(argc, argv, buff, OWL_OUTPUT_RETURN);
    16261626}
    16271627
    16281628char *owl_command_pperl(int argc, const char *const *argv, const char *buff)
    16291629{
    1630   return owl_function_perl(argc, argv, buff, 1);
     1630  return owl_function_perl(argc, argv, buff, OWL_OUTPUT_POPUP);
    16311631}
    16321632
    16331633char *owl_command_aperl(int argc, const char *const *argv, const char *buff)
    16341634{
    1635   return owl_function_perl(argc, argv, buff, 2);
     1635  return owl_function_perl(argc, argv, buff, OWL_OUTPUT_ADMINMSG);
    16361636}
    16371637
  • functions.c

    rff426f9 r7ba9e0de  
    19921992  newbuff = owl_sprintf("%s%s", buff, redirect);
    19931993
    1994   if (type == 1) {
     1994  if (type == OWL_OUTPUT_POPUP) {
    19951995    owl_popexec_new(newbuff);
    19961996  } else {
     
    19991999    pclose(p);
    20002000   
    2001     if (type==1) {
     2001    if (type == OWL_OUTPUT_POPUP) {
    20022002      owl_function_popless_text(out);
    2003     } else if (type==0) {
     2003    } else if (type == OWL_OUTPUT_RETURN) {
    20042004      owl_free(newbuff);
    20052005      return out;
    2006     } else if (type==2) {
     2006    } else if (type == OWL_OUTPUT_ADMINMSG) {
    20072007      owl_function_adminmsg(buff, out);
    20082008    } else {
     
    20342034  perlout = owl_perlconfig_execute(buff);
    20352035  if (perlout) {
    2036     if (type==1) {
     2036    if (type == OWL_OUTPUT_POPUP) {
    20372037      owl_function_popless_text(perlout);
    2038     } else if (type==2) {
     2038    } else if (type == OWL_OUTPUT_ADMINMSG) {
    20392039      owl_function_adminmsg(buff, perlout);
    2040     } else if (type==0) {
     2040    } else if (type == OWL_OUTPUT_RETURN) {
    20412041      return perlout;
    20422042    } else {
  • owl.h

    r0881cdd r7ba9e0de  
    184184#define OWL_VARIABLE_BOOL       2
    185185#define OWL_VARIABLE_STRING     3
     186
     187#define OWL_OUTPUT_RETURN       0
     188#define OWL_OUTPUT_POPUP        1
     189#define OWL_OUTPUT_ADMINMSG     2
    186190
    187191#define OWL_FILTER_MAX_DEPTH    300
Note: See TracChangeset for help on using the changeset viewer.