| 1 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> |
| 2 | <html> |
| 3 | <head> |
| 4 | <title>Making programs against the TiCables library</title> |
| 5 | |
| 6 | <style type="TEXT/CSS"> |
| 7 | <!-- |
| 8 | BODY {FONT-FAMILY: Verdana,Arial,Helvetica,Sans-Serif; BACKGROUND-COLOR: #FFFFFF; FONT-SIZE: 10pt} |
| 9 | TD {FONT-SIZE: 10pt} |
| 10 | H1 {FONT-SIZE: 18pt} |
| 11 | H3 {FONT-SIZE: 13pt} |
| 12 | PRE {FONT-FAMILY: Courier New; FONT-SIZE: 9pt} |
| 13 | CODE {FONT-FAMILY: Courier New; FONT-SIZE: 9pt} |
| 14 | --> |
| 15 | </style> |
| 16 | </head> |
| 17 | <body bgcolor="#ffffff" text="#000000" alink="#ff0000" vlink="#0000ff"> |
| 18 | |
| 19 | <h1> How to make a program against the tifiles library </h1> |
| 20 | |
| 21 | <hr> |
| 22 | <pre> <em> </em></pre> |
| 23 | You will find in the <i>test</i> folder of the libary source archive a |
| 24 | test/example program which uses this library.<br> |
| 25 | Below is listed a light version (error management has been removed) of |
| 26 | this program to make it clearer: |
| 27 | <pre>#include <tifiles.h> |
| 28 | |
| 29 | int main(int argc, char **argv) |
| 30 | { |
| 31 | FlashContent content; |
| 32 | |
| 33 | tifiles_library_init(); |
| 34 | |
| 35 | tifiles_file_read_flash("ticabfra.89k", &content); |
| 36 | tifiles_file_display_flash(&content); |
| 37 | |
| 38 | return 0; |
| 39 | }</pre> |
| 40 | That's all !<br><br> |
| 41 | <strong>NOTE</strong>: for this example to work, you probably have to add compiler options related to the include path and library path, e.g. |
| 42 | <pre>gcc -I/usr/include/tilp2 -Os -g -Wall -W <...>.c -o <...> -ltifiles2</pre> |
| 43 | or better |
| 44 | <pre>gcc -Os -g -Wall -W `pkg-config --cflags --libs tifiles2` tifiles.c -o tifiles</pre> |
| 45 | <h3><a href="index.html">Return to the main index</a> </h3> |
| 46 | </body> |
| 47 | </html> |