Re: External and mémory

Thierry 00bioarchimed at free.fr
Fri Sep 14 07:17:06 EDT 2007


Le 14 sept. 07 à 12:44, Jean-Pierre a écrit :

> Do I have to free retstring after calling an external ?
>

In principle, not.

Here is a code working fine, as long as i had understood everything :-)


void Rev_MyFunction( char *args[], int nargs, char **retstring, Bool  
*pass, Bool *error)
{
      *pass = False;
      if ( iRunning ) {
         *retstring = strdup( MyFunction( args[0] ) );
         *error = false;
      } else {
         *retstring = strdup("Not running !\n" ) ;
         *error = True ;
      }
}


> Is there something wrong in this code. Memory grow up slowly ...
>
> XRev_codphone(char* args[],int nargs,char ** retstring,bool  
> *Pass,bool *Error){
>
> 	*pass=False ; *Error=False ; *retstring=(char *)malloc (100);
>
> 	if (nargs==1){
>
> 		sprintf (*retstring,"%s %s",codePhone(args[0]),phoneComment);
>
> 	}    else  strcpy(*retstring,"Rev_codePhone : Erreur nombre  
> d'argument incorrect");
>
>
> }
>
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your  
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
>




More information about the use-livecode mailing list