static int ReadDribbleCallback( Environment *theEnv, const char *logicalName, void *context) { int rv; /*===========================================*/ /* Deactivate the dribble router and get the */ /* character from another active router. */ /*===========================================*/ DeactivateRouter(theEnv,"dribble"); rv = ReadRouter(theEnv,logicalName); ActivateRouter(theEnv,"dribble"); /*==========================================*/ /* Put the character retrieved from another */ /* router into the dribble buffer. */ /*==========================================*/ PutcDribbleBuffer(theEnv,rv); /*=======================*/ /* Return the character. */ /*=======================*/ return(rv); }
static int GetcDribble( void *theEnv, char *logicalName) { int rv; /*===========================================*/ /* Deactivate the dribble router and get the */ /* character from another active router. */ /*===========================================*/ EnvDeactivateRouter(theEnv,"dribble"); rv = EnvGetcRouter(theEnv,logicalName); EnvActivateRouter(theEnv,"dribble"); /*==========================================*/ /* Put the character retrieved from another */ /* router into the dribble buffer. */ /*==========================================*/ PutcDribbleBuffer(theEnv,rv); /*=======================*/ /* Return the character. */ /*=======================*/ return(rv); }
static int PrintDribble( void *theEnv, char *logicalName, char *str) { int i; /*======================================*/ /* Send the output to the dribble file. */ /*======================================*/ for (i = 0 ; str[i] != EOS ; i++) { PutcDribbleBuffer(theEnv,str[i]); } /*===========================================================*/ /* Send the output to any routers interested in printing it. */ /*===========================================================*/ EnvDeactivateRouter(theEnv,(char*)"dribble"); EnvPrintRouter(theEnv,logicalName,str); EnvActivateRouter(theEnv,(char*)"dribble"); return(1); }
void AppendDribble( Environment *theEnv, const char *str) { int i; if (! DribbleActive(theEnv)) return; for (i = 0 ; str[i] != EOS ; i++) { PutcDribbleBuffer(theEnv,str[i]); } }
static void WriteDribbleCallback( Environment *theEnv, const char *logicalName, const char *str, void *context) { int i; /*======================================*/ /* Send the output to the dribble file. */ /*======================================*/ for (i = 0 ; str[i] != EOS ; i++) { PutcDribbleBuffer(theEnv,str[i]); } /*===========================================================*/ /* Send the output to any routers interested in printing it. */ /*===========================================================*/ DeactivateRouter(theEnv,"dribble"); WriteString(theEnv,logicalName,str); ActivateRouter(theEnv,"dribble"); }