At 09:34 PM 1/7/00 +0530, you wrote:
>what exactly meant by the same source.does it mean that if there r
>two different apps on  Palm which has two different functions of the same
>name then it will cauuse conflict.if yes then how does it happen

No by the time we have apps, the names of static functions are long gone.
What source means is the same .c (or .cpp if you insist on that sort of
thing) file.  For example, let's say you have two source files that provide
form event handlers - Main.c and Detail.c.  And let's say we want to
provide a *private* function for handling the form open event.  In *each*
file (that is in Main.c and Detail.c) I would declare and implement this
function:

/* In Main.c */
static Err PrvFormOpen (FormP formP);

// Lot's of code occurs.

Err PrvFormOpen (FormP formP)
{
// Do some form handling stuff.

// Return result.
   return 0;
}

/* In Detail.c */
static Err PrvFormOpen (FormP formP);

// Lot's of code occurs.

Err PrvFormOpen (FormP formP)
{
// Do some form handling stuff.

// Return result.
   return 0;
}

This is legal *only* because I declared them as "static" - this means
private to main.c and detail.c respectively.  If they were not declared as
"static", I would get a duplicate function error at link time.

Basically, the declaration of a function as "static" is used to communicate
a design decision that the function should only be used inside of a
particular .c(pp) file.

Hope this helps.

Greg


Greg Winton
Bachmann Software and Services, LLC
http://www.bachmannsoftware.com
Software for Handheld & Wireless Computing
Authors of "Palm Programming", published by Macmillan/Sams
Home of Bachmann Print Manager, the only graphical printing solution for
the Palm
Computing Platform

Reply via email to