mirror of
https://github.com/adtools/clib2.git
synced 2025-12-08 14:59:05 +00:00
- Added a simple test for sprintf() which does not use any of the
normal library startup code. git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14952 87f5fb63-7c3d-0410-a384-fd976d0f7a62
This commit is contained in:
95
test_programs/simple_sprintf.c
Normal file
95
test_programs/simple_sprintf.c
Normal file
@ -0,0 +1,95 @@
|
||||
/*
|
||||
* $Id: simple_sprintf.c,v 1.1 2005-05-17 19:15:32 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*/
|
||||
|
||||
#include <exec/execbase.h>
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#define __NOLIBBASE__
|
||||
#define __USE_INLINE__
|
||||
#define __NOGLOBALIFACE__
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#include <proto/exec.h>
|
||||
#include <proto/dos.h>
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include <dos.h>
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
struct Library * SysBase;
|
||||
struct Library * DOSBase;
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#if defined(__amigaos4__)
|
||||
|
||||
struct ExecIFace * IExec;
|
||||
struct DOSIFace * IDOS;
|
||||
|
||||
#endif /* __amigaos4__ */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
BOOL __check_abort_enabled = FALSE;
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
int _start(void);
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
int
|
||||
_start(void)
|
||||
{
|
||||
char string[80];
|
||||
|
||||
SysBase = *(struct Library **)4;
|
||||
|
||||
DOSBase = OpenLibrary("dos.library",37);
|
||||
if(DOSBase == NULL)
|
||||
goto out;
|
||||
|
||||
#if defined(__amigaos4__)
|
||||
{
|
||||
IExec = (struct ExecIFace *)((struct ExecBase *)SysBase)->MainInterface;
|
||||
|
||||
IDOS = (struct DOSIFace *)GetInterface(DOSBase, "main", 1, 0);
|
||||
if(IDOS == NULL)
|
||||
goto out;
|
||||
}
|
||||
#endif /* __amigaos4__ */
|
||||
|
||||
sprintf(string,"a %s c\n","b");
|
||||
|
||||
Write(Output(),string,strlen(string));
|
||||
|
||||
out:
|
||||
|
||||
#if defined(__amigaos4__)
|
||||
{
|
||||
if(IDOS != NULL)
|
||||
DropInterface((struct Interface *)IDOS);
|
||||
}
|
||||
#endif /* __amigaos4__ */
|
||||
|
||||
if(DOSBase != NULL)
|
||||
CloseLibrary(DOSBase);
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
void
|
||||
__check_abort(void)
|
||||
{
|
||||
}
|
||||
Reference in New Issue
Block a user