Category : C Source Code
Archive   : JAZLIB.ZIP
Filename : JZPSHDIR.C

 
Output of file : JZPSHDIR.C contained in archive : JAZLIB.ZIP
#include

/*
ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
³jzpshdir.c ³
³Push the current subdirectory and drive. ³
³Synopsis ³
³ TSTKHEAD whead; ³
³ ³
³ jzpshdir(&whead); ( current sub directory and drive saved now ) ³
³ chdir("\\test"); ³
³ ³
ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
*/

jzpshdir(fhead)
TSTKHEAD *fhead; /* head of stack structure */
{
TSTACK *wtemp;
char wpath[65];
int wdrive;

jzgetdr(wpath); /* return path string */

/**
** We will save the drive in the first
** byte of the buffer, and the path
** in the remaining bytes!
**/

wtemp = (TSTACK *) malloc(sizeof(TSTACK)); /* get pointer to struct */
wtemp->pointer = (char *) malloc(strlen(wpath)+1); /* space for path */

strcpy(wtemp->pointer,wpath); /* copy the path */
wtemp->wint = jzgetdrv(); /* get default drive in size variable */

if (fhead->last == 0) { /* empty stack */
wtemp->prev = 0;
fhead->last = wtemp; /* set last item (top of stack) */
fhead->first = wtemp; /* set first item */
fhead->numitems = 1; /* set number of items */
}
else {
wtemp->prev = fhead->last; /* set link to stack top */
fhead->last = wtemp; /* set new top of stack */
fhead->numitems++; /* increment stack pointer */
}
}




  3 Responses to “Category : C Source Code
Archive   : JAZLIB.ZIP
Filename : JZPSHDIR.C

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/