Category : C Source Code
Archive   : CSRC2.ZIP
Filename : FXEJEC.C

 
Output of file : FXEJEC.C contained in archive : CSRC2.ZIP
/*
* f x e j e c . c
*/

/*)LIBRARY
*/

#ifdef DOCUMENTATION

title fxeject Eject (Delete) an Item From a Flex
index Eject (delete) an item from a flex

synopsis

#ifdef vms
#include "c:flex.h"
#else
#include
#endif

FLEX *
fxeject(fx,n)
FLEX *fx;
unsigned n;

description

fxeject(fx,n) removes item n from the flex fx, moving all later items
in to fill in the gap. The space allocated for the flex is not
changed, however.

fxeject() returns fx if all went well, NULL if n was not a legal item
number or fx was damaged.

bugs

author

Jerry Leichter

#endif

/*
* )EDITLEVEL=06
* Edit history
* 0.0 7-May-81 JSL Invention
* 0.1 23-Jun-81 JSL Conversion to the new documentation convention
*/

#ifdef vms
#include "c:flex.h"
#else
#include
#endif
#define NULL 0

FLEX *
fxeject(fx,n)
FLEX *fx;
unsigned n;
{ register unsigned isz;
register char *p, *end;

if ((p = fxitem(fx,n)) == NULL)
return(NULL);
isz = fx->fxisz;
end = fx->fxdata + isz*fx->fxused;
while (p < end)
{ p[0] = p[isz];
p++;
}
--fx->fxused;
return(fx);
}


  3 Responses to “Category : C Source Code
Archive   : CSRC2.ZIP
Filename : FXEJEC.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/