Dear Lionscribe,
The following is the message i wrote and you replied as fallowed.


".............
Dear Lionscribe,
Thanks for your help.
I gone through your code and i compiled both Library and Application.
Every thing is fine.
Now I have little doubt.
I am creating a library to work on  PALM OS. 
In my Library i have around 500 *.c and 500 *.h files are there.
So Do i need to move all my function declararions to common.h FunctionTable?
Because In README file of library it is specified like that.
Are is there any other way is there?

Thanks in advance,

Regards,
Harsha

  

Lionscribe <[EMAIL PROTECTED]> wrote:You  have to put in only the header of 
functions which are used across  segments. If a function is used only in it's 
own segment, it can be  accessed directly, and does not need an External 
Function Pointer.
The easiest way to figure this out I believe, is to use preprocessor defines, 
so add to each header file a

#ifdef SEGMENTNUMBER????
********
#endif

and in each code file add a
#define SEGMENTNUMBER????
#include 

// change the ???? to whichever segment the file belongs to

Now  when you will compile each segment, you will know which external  
functions it is calling, for it will fail with an error (since it is  not 
declared, due to the defines). So then change every error call to  
ExternalFunction(FunctionName), add that function to the function table  in 
common.h, and add initialization to that segments InitFunctionTable  function, 
to init the function pointer you just added.

Do this for all the segments, and you will eventually have it.

Good Luck,
LionScribe

-- 
For  information on using the PalmSource Developer Forums, or to  unsubscribe, 
please see http://www.palmos.com/dev/support/forums/
.....................................
  
  And i tried the same way.
  For just to test i created the 
  
  TestSeg2.h
  with the following things
  
  /*********  TestSeg2.h    **********/
  
  
  #ifdef SEGMENTNUMBER2
  
  int ShLibADD(int a,int b,int c );
  int ShLibSUB(int a,int b);
  int ShLibMUL(int a,int b);
  float ShLibDIV(int a,int b);
  
  #endif
  
  
  and TestSeg2.c
  with the following contents.
  
  #define SEGMENTNUMBER2 
  #include "TestSeg.h"
  
  
  int ShLibADD(int a,int b,int c )
  {
  
    return (a+b+c);
  
  }
  
  int ShLibSUB(int a,int b)
  {
  
   return (a-b);
  }
  
  int ShLibMUL(int a,int b)
  {
   
   return (a*b);
  
  }
  
  float ShLibDIV(int a,int b)
  {
  
   return (a/b);
  
  }
  
  
  And  
  
  And i included these 
  TestSeg.c  TestSeg.h  
  by using addfiles ->
  for  Debug_Segnet2  ,Release,CodeSegment2
  
  But when i make for Debug_Segment2  it is giving error as
  
  The file TestSeg.h  cannot be opened.
  
  If i want to add files to segment1  then  i think i need to  include to 
Debug_Segment1 and Release and  Codesegment1.Am i  currect?
  
  And is it possible for me to have  32K segment1 and 32K segment2 
.....Segment-n
  Because when i tryed to do so when all the code segments size increases more 
than 32K it is giving No memory error.
  
  Can you kindly help me in this regard.
  
  Thanks for your help.
  
  Regards,
  Harsha
  
  
  
  
  
  
  
  
  
  
  
  
   
  
  
  
  
  
  
  
  
  
  

 Send free SMS to your Friends on Mobile from your Yahoo! Messenger. Download 
Now! http://messenger.yahoo.com/download.php
-- 
For information on using the PalmSource Developer Forums, or to unsubscribe, 
please see http://www.palmos.com/dev/support/forums/

Reply via email to