Porting from Linux

Login to reply to this topic.
Wed, 2006-04-26 12:10
Joined: 2006-04-26
Forum posts: 4
Hi

I m porting C code from Linux to symbian. Can somebody advise me how should i handle CHAR and INT's.

Im getting below errors:
expression syntax error Char or Int
undefined identifier Char ot Int

Char example code:

  char *publickeybuf = NULL;
  long publickeylength = 0;
 
  x = CM_writePublicKeyString(key, &publickeybuf, &publickeylength);

Int Example:

int row_count = aa_dbResultSetGetRowCount(&rs);
 
  if (row_count > 0)
  {
    char **ca_list;
   
    if ((ca_list = (char **)malloc(row_count * sizeof(char *))) == NULL)
    {
      SESSI_LOG("%s \n", "Memory allocation failed" );
      return AA_ERR_MEMORY_ALLOCATION_FAILED;
    }
   
    int i;
    for (i = 0; i < row_count; i++)

Thanks
Capr

Wed, 2006-04-26 12:45
Joined: 2006-04-26
Forum posts: 4
Re: Porting from Linux
I have added <stdlib.h>, <stddef.h> and 0... still the same problem.
Lines and actual errors:

/*<<< validate the certificate using issuer */
/* Get the public Key */

char *publickeybuf = NULL ------ expression syntax error
long publickeylength = 0; ---- expression syntax error
x = CM_writePublicKeyString(key, &publickeybuf, &publickeylength); --- undefined identifier 'publickeybuf'
Thu, 2006-04-27 12:46
Joined: 2006-01-09
Forum posts: 105
Re: Porting from Linux
Hi:

Symbian OS has its own method of storing strings..known as Descriptors..it doesn't use char*, char [] and the like...however you can convert from char* to symbian style Descriptors...

first have a look what the Descriptors are??

you should understand the basic traits of Symbian OS in order to port robustly and nicely...

Cheers!!
CodePupil 

Thanks and Regards
CodePupil
__________________________
You are I and I am he .. !!

Thu, 2006-04-27 14:30
Joined: 2006-04-26
Forum posts: 4
Re: Porting from Linux
Yes, I knew Descriptors one option.
I have much C code to change...im wondering, is there any other way?
Thu, 2006-04-27 17:39
Guest (not verified)
Forum posts: 2043
Re: Porting from Linux
Its possible to use char, long etc. in a standard Symbian program (that's what the Symbian types are defined as anyway, see e32def.h).

Its also possible to use standard C code.

Your compilation errors are therefore not because char and int aren't supported but for some other reason.
  • Login to reply to this topic.