26. Unix Emulation
Unix emulation is possible in Amiga OS with libraries such as ixemul.library and ixnet.library and support from compilers such as SAS/C and GCC to include them in programs. Unix emulation allows unix type programs to be easily migrated to Amiga OS with minimal changes. There is also support for X Windows via the Amiwin or DaggeX system for classic Amigas or AmiCygnix for AmigaOS 4 systems.
a) ixemul library SDK
To use ixemul.library you will need the library files installed to LIBS: on the AmigaOS system and then install the ixemul sdk files for your compiler. To avoid overwriting your AmigaOS include files, place the include files in a seperate subdirectory of your INCLUDE folder.
stdio.h - functions for input and output including to shell window (stdin, stdout) or to files e.g fopen(), fclose(), fgets(), fputs(), scanf(), printf() and so on.
stdlib.h - miscellaneous functions for memory allocation malloc(), free(). Enviorment variables with putenv(), setenv(). Sorting - heapsort(), mergesort(), radixsort(). Random numbers rand() and type conversions.
string.h - String functions such as strcpy(), strcmp(), strcar(), strncpy() etc.
math.h - Advanced math functions e.g. cos(), sing, tan(), exp(), pow(), sqrt().
sys/socket.h - Network socket library for internet communication e.g. accept(), bind(), connect(), recv(), send() etc.
b) Example code - binsplit
#include <stdio.h>
#include <stdlib.h>
int main (int argc, char **argv)
{
FILE *in,*out;
int size;
int bytes;
char buf[256];
char *ptr;
if (argc != 4)
{
return 0;
}
b) ixnet.library
The library support BSD library calls similar to bsdsocket.library. See Networks.