home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Micro R&D 1
/
MicroRD-CD-ROM-Vol1-1994.iso
/
disktools
/
misc
/
dd.lzh
/
dd
/
dossupport.c
< prev
next >
Wrap
C/C++ Source or Header
|
1991-11-30
|
831b
|
61 lines
/*
* dossupport.c - miscellaneous support functions for AmigaDOS 2.0
*
* Bruno Costa - 30 Nov 91 - 1 Dec 91
*/
#include <exec/types.h>
#include <dos/dos.h>
#include <clib/dos_protos.h>
#include <pragmas/dos_pragmas.h>
#include <string.h>
#include <stdarg.h>
#include "dossupport.h"
extern struct Library *DOSBase;
LONG Printf (char *format, ...)
{
LONG ret;
va_list args;
va_start (args, format);
ret = VPrintf (format, args);
va_end (args);
return ret;
}
BSTR bstr (char *str)
{
static char buf[256];
int len = strlen (str);
if (len > 255)
len = 255;
buf[0] = len;
strncpy (&buf[1], str, len);
return MKBADDR (buf);
}
char *cstr (BSTR bstr)
{
static char str[256];
char *src = BADDR (bstr);
char *dst = str;
int n;
for (n = *src++; n; n--)
*dst++ = *src++;
*dst = '\0';
return str;
}