struct dirent *readdir(DIR * dir) { struct __dirent *direntry; register struct dirent *buf; if (dir == NULL) { errno = EFAULT; return NULL; } do { direntry = dnext(dir); if (direntry == NULL) return NULL; } while (direntry->d_name[0] == 0); buf = &dir->_priv.de; buf->d_ino = direntry->d_ino; buf->d_off = -1; /* FIXME */ buf->d_reclen = 31; dir->dd_loc += (buf->d_reclen + 1); strncpy(buf->d_name, (char *) direntry->d_name, 31); buf->d_name[30] = 0; return buf; }
struct dirent *readdir(DIR * dirp) { struct _dir *dir = (struct _dir *)dirp; struct __dirent *direntry; register struct dirent *buf; int len; if (dir == NULL || dir->d.dd_fd == -1) { errno = EFAULT; return NULL; } do { direntry = dnext(dir); if (direntry == NULL) return NULL; } while (direntry->d_name[0] == 0); buf = &dir->de; buf->d_ino = direntry->d_ino; buf->d_off = -1; /* FIXME */ buf->d_reclen = 33; strncpy(buf->d_name, (char *) direntry->d_name, 31); buf->d_name[30] = 0; return buf; }
EPNODE * dfirst(void) /* return pointer to first definition */ { htndx = 0; htpos = NULL; ochpos = outchan; return(dnext()); }
int getsoundlist(char *ps) { char temp[500]; struct FILEINFO info; strcpy(ps,"\0"); strcpy(temp,path.sound); strcat(temp,"*.WAV"); if(strlen(temp)){ if(!dfind(&info,temp,0)) do{ strcat(ps,info.name);strcat(ps," "); } while (!dnext(&info)); } return 1; }
/* Count and remember the number of email messages in the Root mail directory */ long get_mail(void) { struct FILEINFO info; int found=0,index; char temp[80]; if (!dfind(&info,"mail*.txt",0)) { do { index = get_mail_index( info.name ); email[index]='T'; found++; } while (!dnext(&info)); } sprintf( temp, "[0][You have %d Mail messages][OK]", found ); form_alert( 1, temp ); return(found); }