17.02.2015 Views

CCS C Compiler Manual PCB / PCM / PCH

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

PreProcessor<br />

#INCLUDE "filename"<br />

Elements:<br />

Purpose:<br />

Examples:<br />

Example Files:<br />

Also See:<br />

filename is a valid PC filename. It may include normal drive and path<br />

information. A file with the extension ".encrypted" is a valid PC file. The standard<br />

compiler #INCLUDE directive will accept files with this extension and decrypt<br />

them as they are read. This allows include files to be distributed without<br />

releasing the source code.<br />

Text from the specified file is used at this point of the compilation. If a full path is<br />

not specified the compiler will use the list of directories specified for the project to<br />

search for the file. If the filename is in "" then the directory with the main source<br />

file is searched first. If the filename is in then the directory with the main<br />

source file is searched last.<br />

#include <br />

#include <br />

ex_sqw.c<br />

None<br />

#inline<br />

Syntax:<br />

Elements:<br />

Purpose:<br />

Examples:<br />

#INLINE<br />

None<br />

Tells the compiler that the function immediately following the directive is to be<br />

implemented INLINE. This will cause a duplicate copy of the code to be placed<br />

everywhere the function is called. This is useful to save stack space and to<br />

increase speed. Without this directive the compiler will decide when it is best to<br />

make procedures INLINE.<br />

#inline<br />

swapbyte(int &a, int &b) {<br />

int t;<br />

t=a;<br />

a=b;<br />

b=t;<br />

}<br />

Example Files:<br />

ex_cust.c<br />

Also See:<br />

#SEPARATE<br />

111

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!