home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
World of A1200
/
World_Of_A1200.iso
/
programs
/
compress
/
misc
/
xfh
/
source.lha
/
src
/
lib
/
bcpl.c
< prev
next >
Wrap
C/C++ Source or Header
|
1991-07-25
|
497b
|
30 lines
/* bcpl.c - ugly BCPL conversion stuff. */
#include <exec/types.h>
#include <dossupport.h>
#include <string.h>
BSTR cstr2b(char *cstr, UBYTE *buf){
register UBYTE len;
*buf = len = strlen(cstr);
strncpy(buf+1,cstr,len);
return (BSTR)( (ULONG)buf >> 2 );
}
char *bstr2c(BSTR bstr, UBYTE *buf){
register UBYTE len;
register char *p;
p = (char *)(bstr << 2);
len = *p++;
strncpy(buf, p, len);
buf[len] = '\0';
return (char *)buf;
}
/* End of bcpl.c */