| iMatix home page
| Libero home page | Libero documentation
| << | < | > | >>
Libero Libero
Version 2.32

Source Code For Phone.c

When I take the above dialog (called phone.l), and give it to Libero, this is what happens:

 C:\CTOOLS\LIBERO>lr phone
 LIBERO v2.11 (c) 1991-96 by Pieter A. Hintjens
 lr I: processing 'phone.l'...
 lr I: creating skeleton program phone.c...
 lr I: building phone.d...
 lr I: building phone.i...
 lr I: Building stub for have dialed digit
 lr I: Building stub for reset dialed number
 lr I: Building stub for send outgoing release
 lr I: Building stub for send outgoing request
 lr I: Building stub for start busy tone
 lr I: Building stub for start dial tone
 lr I: Building stub for start released tone
 lr I: Building stub for start ringing local
 lr I: Building stub for start ringing remote
 lr I: Building stub for stop local tones
 lr I: Building stub for stop ringing local
 lr I: Building stub for stop ringing remote
 lr I: Building stub for wait for incoming message
 C:\CTOOLS\LIBERO>

Libero assumes that I want to make a program called phone.c. Since this file does not exist, it creates a skeleton program for me. This only happens the first time. Once the program is created, Libero will add missing pieces to it, at the end, but will never change it again otherwise.

I get two other files as well, phone.d and phone.i. These are the data and interpreter for my dialog. I need these files to compile phone.c. Each time I run Libero, it recreates these two files. If I was working in another language, I would get different files, with different extensions. The default language is C. Here is the skeleton program that Libero gave me, more or less:

/*=========================================================================*
 *                                                                         *
 *  phone.c     description...                                             *
 *                                                                         *
 *  Written:    95/07/29    Your Name                                      *
 *  Revised:    95/07/29                                                   *
 *                                                                         *
 *  Skeleton generated by LIBERO 2.10 on 29 Jul, 1995, 11:50.              *
 *                                                                         *
 *=========================================================================*/

#include "prelude.h"                    /*  Public definitions             */
#include "phone.d"                      /*  Include dialog data            */

/*- Function prototypes ---------------------------------------------------*/

/*- Global variables used in this source file only ------------------------*/

static int
    feedback;                           /*  Feedback for calling program   */

static char
    *some_param;                        /*  Example of parameter           */

/********************************   M A I N   ******************************/

int my_funct (char *p_some_param)
{
    feedback = 0;                       /*  No errors so far               */
    some_param = p_some_param;          /*  Local copy of parameters       */

#   include "phone.i"                   /*  Include dialog interpreter     */
}

/************************   INITIALISE THE PROGRAM   ***********************/

MODULE initialise_the_program (void)
{
    the_next_event = ok_event;
}

/**************************   GET EXTERNAL EVENT   *************************/

MODULE get_external_event (void)
{
}

/************************   TERMINATE THE PROGRAM   ***********************/

MODULE terminate_the_program (void)
{
    the_next_event = terminate_event;
}

/**************************   HAVE DIALED DIGIT   **************************/

MODULE have_dialed_digit (void)
{
}

/************************   RESET DIALED NUMBER   ************************/

MODULE reset_dialed_number (void)
{
}
 ... etc.

I discuss the details of Libero+C programming elsewhere. Some rules apply whatever language you use:

The basic C program consists of a number of standard pieces:


| << | < | > | >>
| Introduction to Libero | The Coke Machine Example | Example of Using a Telephone | Example of Controlling a Telephone | Source Code For Phone.c | Example of a C/C++ Comment Stripper | Example of Parsing An Arithmetic Expression | Dialogs For Dummies | Frequently Asked Questions
iMatix
Copyright © 1996-97 iMatix