Menu

GettingStarted

Daniel Mansfield

Getting Started With STALLioN

Installing STALLioN

There are two ways to install STALLioN; compiling it from source and downloading the pre-made archive.

Pre-made Archive

Downloading the pre-made archive is the simplest option for beginners, since it works out of the box for any compatible platform. Just download the tarball file from the files section of this project and extract the contents to a suitable directory.

Compiling From Source

Linux

To compile STALLioN from source on Linux you need to first download the source code. The source code for the latest release is available in the same location as the pre-made archive; the root directory of the file system on STALLioN's Sourceforge project page.
Once you have downloaded it extract it to a suitable directory and execute the following commands in the src directory to compile and link the files;
Note: The last two lines should be one line

gcc -c ikeypress.c -o ikeypress.o
gcc -c igetch.c -o igetch.o
gcc -c ioutils.c -o ioutils.o
gcc -c oclscr.c -o oclscr.o
gcc -c ocur.c -o ocur.o
gcc -c oflush.c -o oflush.o
gcc -c oinitdisplay.c -o oinitdisplay.o
gcc -c oprint.c -o oprint.o
gcc -c oputch.c -o oputch.o
gcc -c oputval.c -o oputval.o
gcc -c oscrl.c -o oscrl.o
ar rcs libSTALLioN.a ikeypress.o igetch.o ioutils.o oclscr.o ocur.o oflush.o 
oinitdisplay.o oprint.o oputch.o oputval.o oscrl.o
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Using STALLioN
---------------

Now that you have STALLioN correctly installed (hopefully) you need to set up your compiler to play nicely with it.

#### Compiling With STALLioN ####
To compile programs with STALLioN you need to include the relevant header file, include/iolib.h in your project before linking it with the relevant library for your platform; for Windows this is bin/Win/libSTALLioN.a and for Linux it is bin/Linux/libSTALLioN.a, or will be wherever you chose it to be if you compiled it yourself.
This is dependent on your compiler, build-environment and IDE, and won't be covered in depth here. Consult your compiler's documentation on how to link external static libraries.
Now you just need to write the code and compile your project.

#### An Example STALLioN Program ####

/ Include the STALLioN header file. /

include "iolib.h"

int main(void)
{
/ Create a display buffer. /
iodisplay display;

/* Initialise the display; white text on cyan background, no cursor,
   30 rows and 40 columns. */
ioinitdisplay(0x0, 0x5, 0, 1, 30, 40, &display);

/* Output some pretty text to the display buffer. */
ioprintf("Hello, World!", &display);

/* Flush the display to the actual screen. */
ioflush(&display);

/* Clean up. */
iodestroydisplay(&display);

return 0;

}

##### Compiling The Example Program On Linux #####
To compile the above example program on Linux, save it as "main.c" and use the following command:

gcc main.c -o helloworld -I/Path/to/STALLioN /Path/to/STALLioN/libSTALLioN.a
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Where "/Path/to/STALLioN" is a directory containg the necessary header files and libSTALLioN.a


Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.