Clib Howto v13
Clib Howto v13
IPC@CHIP CLIB
How to integrate the CLIB into Borland C++ 5.02 and Paradigm C/C++ Beck IPC Edition
Page 1 of 11
Table of Contents
1 INTRODUCTION ................................................................................................................................ 3 2 HOW TO INTEGRATE THE CLIB BINARIES AND CLIB/RTOS DOCUMENTATION INTO PARADIGM C/C++ BECK IPC EDITION .......................................................................................... 4 2.1 STEP 1 CALL THE SETUP ............................................................................................................ 4
3 HOW TO INTEGRATE THE CLIB IN A BORLAND C 5.02 PROJECT ............................................ 4 3.1 3.2 3.3 3.4 3.5 3.6 STEP 1 - INSTALL THE CLIB........................................................................................................... 4 STEP 2 - CREATE YOUR PROGRAM DIRECTORY ............................................................................... 4 STEP 3 - CREATE THE BORLAND C 5.02 PROJECT .......................................................................... 5 STEP 4 - ADJUST THE PROJECT SETTINGS ...................................................................................... 7 STEP 5 - ADD THE CLIB TO THE PROJECT ...................................................................................... 9 STEP 6 - WRITE YOUR PROGRAM ................................................................................................. 10
Page 2 of 11
Introduction
The libraries provide an easy access to the IPC@CHIPs operating system using the programming language C. In addition to the binary library files, documentation in HTML format is also provided. The CLIB software package comes in two versions: The setup UpdateDocuxxxxxx_CLIBxxx.exe integrates the CLIB binaries and complete RTOS and CLIB documentation into the Paradigm C/C++ Beck Edition compiler, if the Paradigm compiler is installed. If you are a Borland user, the setup will ask for the installation paths of the library and the documentation. The archive CLIBVxxxSRC.ZIP holds the source code of the CLIB libraries.
This document describes how to: Integrate the CLIB into your Paradigm C/C++ Beck IPC Edition compiler Integrate the CLIB into your Borland C 5.02 project Use the CLIB and @CHIP-RTOS API documentation
The library is available in 5 different models. One model for every compiler memory model: CLIBxxxH.lib Huge CLIBxxxL.lib Large CLIBxxxM.lib Medium CLIBxxxC.lib Compact CLIBxxxS.lib Small Note: For inexperienced users, we advise to use compiler memory model Large. There is NO correlation between the names of the compiler memory models (Small, Compact, Medium, Large, Huge) and those of the available SC1x @CHIP-RTOS variants (Tiny, Small, Medium, Medium_PPP, Large, Large_PPP)!
Page 3 of 11
How to integrate the CLIB binaries and CLIB/RTOS documentation into Paradigm C/C++ Beck IPC Edition
Step 1 Call the Setup
2.1
Call the setup UpdateDocuxxxxxx_CLIBxxx.exe. The setup installs/updates the CLIB binaries and the CLIB and RTOS documentation in the Paradigm installation path provided that the compiler is installed. To use the CLIB in your Paradigm projects, include the header file clib.h into your C files. The library should NOT be manually added to the project (like on the Borland compiler). The Paradigm compiler automatically integrates the CLIB library file, according to the selected memory model.
3
3.1
First you have to call the setup UpdateDocuxxxxxx_CLIBxxx.exe. Choose a path where the CLIB should be copied, e.g. C:\Projects\Clib.
You should now have a directory, e.g. C:\Projects\Clib with the CLIB contents.
3.2
Make a directory inside your project directory for storing your program files. For example, you now have a directory C:\Projects\Hello which is empty.
Page 4 of 11
3.3
In the field "Project Path and Name" choose the new directory, which you have created for the program followed by the project name, e.g. C:\Projects\hello\hello.ide Make the correct project settings. Target Type: Application [.exe] Platform: DOS (Standard) Target Model: Large Frameworks: Deselect Class Library Math Support: None Libraries: No Exceptions
Page 5 of 11
Click now the "Advanced" button and choose the *.c node type.
Close the "Advanced Options" dialog and the "New Target" dialog with "OK".
Page 6 of 11
3.4
Select "Directories" and change the include path and the library path to: Include: $env(bcroot)\include;..\clib 1 Library: $env(bcroot}\lib
The expression "$env(bcroot)" is translated to the installation directory of the Borland 5.02 compiler
Page 7 of 11
Now select "16-bit Compiler" and choose the 80186 instruction set for compiling.
Page 8 of 11
3.5
Go to the project window. Use the right mouse button to click on the project node. Choose "Add node" from the popup menu.
Select the file extension type *.lib or *.* from the lower listbox. Open the CLIB with the name CLIBxxxL.LIB for the Large memory model library.
Page 9 of 11
3.6
Include the header file CLIB.H in your C files. After this you can use all CLIB functions inside your code.
Page 10 of 11
The UpdateDocuxxxxxx_CLIBxxx.exe setup already includes the complete CLIB and RTOS documentation. Paradigm users: The documentation can be accessed from the Paradigm Help menu or by pressing the F1 key when the cursor is over a CLIB function. Borland users: The documentation is copied to a user defined path during the setup. The Windows start menu will contain a link to the documentation index page. At the @CHIP-RTOS API index page is a link to the CLIB index page.
Each documented CLIB function has an HTML link to the invoked RTOS API software interrupt, which is described in the @CHIP-RTOS HTML documentation.
Page 11 of 11