BBOOL rtplatform_gfirst(PSMBDSTAT dirobj, char RTSMB_FAR * name_in) { char slashstar [] = {'\\', '*', '\0'}; char dotstar [] = {'.', '*', '\0'}; char name [SMBF_FILENAMESIZE + 1]; rtsmb_size len; int rv; void * rtp_dirobj; /* translate "*" to "*.*" becaues some file systems don't like "*" */ len = (rtsmb_size) tc_strlen (name_in); tc_strcpy (name, name_in); if (len > 1 && len < SMBF_FILENAMESIZE - 2 && tc_strcmp (&name[len - 2], slashstar) == 0) { tc_strcat (name, dotstar); } rv = rtp_file_gfirst(&rtp_dirobj, name); if (rv < 0) { dirobj->rtp_dirobj = (void*)0; return FALSE; } rtp_file_get_name(rtp_dirobj, dirobj->filename, SMBF_FILENAMESIZE); dirobj->filename[SMBF_FILENAMESIZE] = '\0'; /*translate rtplatform dstat to smb dstat */ rtplatform_translate_dstat (dirobj, rtp_dirobj); dirobj->unicode = 0; return TRUE; }
/*----------------------------------------------------------------------* rtp_wfile_get_name *----------------------------------------------------------------------*/ int rtp_wfile_get_name (void * dirobj, unsigned short * name, int size) { unsigned char realName[32]; if (rtp_file_get_name (dirobj, realName, size) == -1) { return (-1); } map_ascii_to_unicode((unsigned char *)name, (unsigned char *)realName); return(0); }
BBOOL rtplatform_gnext(PSMBDSTAT dirobj) { int rv; rv = rtp_file_gnext(dirobj->rtp_dirobj); if (rv < 0) { return (0); } rtp_file_get_name(dirobj->rtp_dirobj, dirobj->filename, SMBF_FILENAMESIZE); dirobj->filename[SMBF_FILENAMESIZE] = '\0'; /* translate rtplatform dstat to smb dstat */ rtplatform_translate_dstat(dirobj, dirobj->rtp_dirobj); dirobj->unicode = 0; return TRUE; }