next up previous contents index
Next: 2.2 UDI Data Structure Up: 2. The C Interface Previous: 2. The C Interface

2.1 Getting Started

C files calling UDI functions must include  the header  file:

#include <udi.h>
This header defines various things that are needed to call the UDI routines. You may also need to add the option -I/usr/local/include/udi-2.0" to your SPMquotcc" command line so that the compiler can find all the UDI specific header files.

Before you make any calls to UDI, you need to call the initialization routine begin_udi(0)" . Similarly, before your programs exits it should call SPMquotend_udi()" .

Each time you call a UDI function, several tests are made to make sure that you haven't made an error. This adds a bit of overhead, especially since most DSP applications loop through the same operations over and over. There exist, therefore, two sets of UDI libraries, one with tests, and one without. During the debugging  phase of your application, you should link to the library  which includes the test code by adding -ludi+ -ludifun+" to the SPMquotcc" command line, and defining the C preprocessor variable ``TEST''. After you are reasonably sure that your application is working, you can increase processing performance  and reduce the size of the executable by linking  to the libraries without the test code with SPMquot-ludi -ludifun". Depending on your compiler and where these libraries are installed, you might also need to add -L/usr/local/lib" to the cc" command line as well. See Figure 2.1 for a makefile" skeleton for compiling a UDI application.  

 
Figure 2.1: Skeleton makefile for compiling UDI applications.
\begin{figure}\hrule
\begin{tex2html_preform}\begin{verbatim}CC = cc
CFLAGS = -I...
...-o app app.c $(LIBS) -lm\end{verbatim}\end{tex2html_preform}\hrule\end{figure}


next up previous contents index
Next: 2.2 UDI Data Structure Up: 2. The C Interface Previous: 2. The C Interface
Diemo Schwarz
1999-03-04