**Main Program**
Code:
...
#include <dirent.h>
void executeExternally(char* []);
void changeDir(char const * const);
void show_file(char const * const);
#define MAXSIZE 256
#define BUFSIZE 4096
#define MAXLINESIZE 256
int nread;
int lnOption;
int gotoOption;
char lwString[MAXLINESIZE] = "";
**Dynamic Library**
Code:
...
#define MAXLINESIZE 256
int linesInScreen;
int readbkSet;
char screen[SCREENSIZE];
extern int lnOption;
extern int gotoOption;
...
if(nread){ // something in buffer
bufferNum_ecp = 1;
offset_ecp = 0;
}
int rv;
char msg[256];
rv=sprintf(msg,"%d\n",gotoOption);
write(1,msg, rv);
if(gotoOption)
linesShown = gotoOption;
else
linesShown = 20;
...