This is format.c in view mode; [Download] [Up]
/*-------------------------------------------------------------------------\
| This is free software and thus there is NO copyright
|
| Programmer: V. Kyriakides -- 1kyriaki@informatik.uni-hamburg.de
| File name: format.c
| Date: $Date: 1996/07/03 23:03:55 $
| Revision: $Revision: 1.1 $
| Purpose: These are *external* C routines which belong to a related
| Eiffel class FORMAT, see also the file ---> "format.e".
| This version is for the SmallEiffel v0.97 compiler!
|--------------------------------------------------------------------------
| IMPORTANT NOTE:
|
| format.c -- uses SmallEiffel's 'e2s' C function call to pass
| C strings back to SmallEiffel!
|
| Keep in mind that this is a dirty hack on how to pass
| C strings back to Eiffel. It's no real solution and
| might cause problems and errors. It's used herein only
| since by the time there seems to be no other way to get
| it done!
\--------------------------------------------------------------------------*/
#include <stdio.h>
#include <stdlib.h>
char* ext_i2s(format, value)
char *format;
int value;
{
char buf[1024];
sprintf (buf, (const char*) format, value);
return ((char*) e2s(buf));
}
char* ext_r2s(format, value)
char* format;
float value;
{
char buf[1024];
sprintf (buf, (const char*) format, value);
return ((char*) e2s(buf));
}
char* ext_d2s(format, value)
char* format;
double value;
{
char buf[1024];
sprintf (buf, (const char*) format, value);
return ((char*) e2s(buf));
}
char* ext_s2s(format, value)
char* format;
char* value;
{
char buf[1024];
sprintf (buf, (const char*) format, value);
return ((char*) e2s(buf));
}
These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.