home *** CD-ROM | disk | FTP | other *** search
- /*
- ** vbcc-Amiga-PowerPC version of tmpnam.c
- **
- ** v0.1 04.10.97 phx
- */
-
- #include <stdio.h>
- #include <powerup/gcclib/powerup_protos.h>
-
- char *tmpnam(char s[L_tmpnam])
- {
- static char lastname[L_tmpnam];
- static int lastnum=0;
- BPTR fh=0;
-
- do{
- lastnum++;
- sprintf(lastname,"T:vc_%d",lastnum);
- fh = PPCOpen(lastname,MODE_OLDFILE);
- if(fh) PPCClose(fh);
- }while(fh&&lastnum>0);
- if(lastnum<=0) return(0);
- if(s) strcpy(s,lastname);
- return(lastname);
- }
-