Changeset afbf668 for functions.c


Ignore:
Timestamp:
Mar 1, 2004, 12:42:56 PM (17 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:
948b942
Parents:
c61918e
Message:
	pexec will now incrimentally display data as it is output
	  by the child process.  Additionally, commands running under
	  pexec may now be killed by quitting out of the popless window.
	Added muxevents select loop dispatcher.  File descriptors may
	  be registered with muxevents and handlers will be dispatched
	  to when data is available for non-blocking read/write/except.
	Switched the stderr_redir stuff to use muxevents.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • functions.c

    rdebb15d rafbf668  
    22412241  strcat(newbuff, redirect);
    22422242
    2243   p=popen(newbuff, "r");
    2244   out=owl_malloc(1024);
    2245   size=1024;
    2246   strcpy(out, "");
    2247   while (fgets(buff2, 1024, p)!=NULL) {
    2248     size+=1024;
    2249     out=owl_realloc(out, size);
    2250     strcat(out, buff2);
    2251   }
    2252   pclose(p);
    2253 
    2254   if (type==1) {
    2255     owl_function_popless_text(out);
    2256   } else if (type==0) {
    2257     return out;
    2258   } else if (type==2) {
    2259     owl_function_adminmsg(buff, out);
     2243  if (type == 1) {
     2244    owl_popexec_new(newbuff);
    22602245  } else {
    2261     owl_function_popless_text(out);
    2262   }
    2263   owl_free(out);
     2246    p=popen(newbuff, "r");
     2247    out=owl_malloc(1024);
     2248    size=1024;
     2249    strcpy(out, "");
     2250    while (fgets(buff2, 1024, p)!=NULL) {
     2251      size+=1024;
     2252      out=owl_realloc(out, size);
     2253      strcat(out, buff2);
     2254    }
     2255    pclose(p);
     2256   
     2257    if (type==1) {
     2258      owl_function_popless_text(out);
     2259    } else if (type==0) {
     2260      return out;
     2261    } else if (type==2) {
     2262      owl_function_adminmsg(buff, out);
     2263    } else {
     2264      owl_function_popless_text(out);
     2265    }
     2266    owl_free(out);
     2267  }
    22642268  return NULL;
    22652269}
Note: See TracChangeset for help on using the changeset viewer.