Codice PHP:
#include <stdio.h>

#include <string.h>

void get_name(char *name,char path[3000])
{
    
char temp[1000];
    
char carattere;
    
char *p;
    
int lunghezzaij=0;

    
strcpy(temppath);
    
printf("temp: %s\n"temp);
    
lunghezza strlen(temp);    
    
printf("lunghezza :%i\n"lunghezza);
    for (
i=0lunghezzai++)
    {
        
carattere temp[i];
        if (
carattere=='/')
        {    
            
j++;
        }
    }
    
printf("numero di /: %i\n",j);

    
strtok(temp,"/");    
    
printf("p: %s\n",p);
    
printf("temp: %s\n"temp); 
     
    for (
i=0i<ji++)
    {
        
strcpy(tempp);
        
strtok(NULL"/");
        
printf("%s\n"temp); 
    }
    
j=0;
    
/****************************
* qui devo mettere temp in name
*********************/

    
strcpy(name,temp);


    
printf("nome file dentro: %s\n"name);
}

/********************
* MAIN
********************/
main()
{
    
char *name=NULL;
    
    
get_name(name,"/home/prova/ciao.png");
    
printf("nome file fuori: %s\n"name);
         

Ho spezzato il nome del file tramite / e arrivo ad avere in temp il nome del file dal percorso.

come faccio a metterlo in name?

la variabile stringa che ho nel main?
la strcpy mi da segmentation fault.