Go to the documentation of this file.
25 signed int len,lp,lPath,lNameOnly,lName,lSuffix,lExt,slashPos,dotPos,prot;
39 while((slashPos>=0)&&(name[slashPos]!= '/'))
42 dotPos=(slashPos>0?slashPos:0);
43 while((dotPos<len)&&(name[dotPos]!= '.'))
50 while((!found)&&(prot<slashPos-1))
52 found=((name[prot]== ':')&&(name[prot+1]== '/')&&(name[prot+2]== '/'));
68 memcpy(fn-> path,&(name[prot]),(slashPos-prot)* sizeof( char));
82 lPath=lp+(slashPos-prot)+2;
84 Error( "Empty file path");
86 memcpy(fn-> path,p,lp* sizeof( char));
88 if ((slashPos-prot)>=0)
89 memcpy(&(fn-> path[lp+1]),&(name[prot]),(slashPos-prot)* sizeof( char));
93 if (fn-> path[lPath-2]!= '/')
95 fn-> path[lPath-1]= '/';
105 lSuffix=strlen(suffix);
106 lNameOnly=dotPos-slashPos-1;
107 lName=lNameOnly+lSuffix;
109 Error( "Empty file name");
111 memcpy(fn-> name,&(name[slashPos+1]),lNameOnly* sizeof( char));
113 memcpy(&(fn-> name[lNameOnly]),suffix,lSuffix* sizeof( char));
133 memcpy(fn-> ext,e,lExt* sizeof( char));
209 if (fn-> ext!=NULL) free(fn-> ext);
|
Follow us!