Subversion Repositories Kolibri OS

Rev

Rev 3440 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 3440 Rev 3444
Line 185... Line 185...
185
	}
185
	}
186
	free(rBuf);
186
	free(rBuf);
187
	return 0;
187
	return 0;
188
}
188
}
Line -... Line 189...
-
 
189
 
-
 
190
enum
-
 
191
{
-
 
192
	DIRS_ALL,
-
 
193
	DIRS_NOROOT,
-
 
194
	DIRS_ONLYREAL
189
 
195
};
190
:int GetDir(dword dir_buf, file_count, path)
196
:int GetDir(dword dir_buf, file_count, path, doptions)
191
{
197
{
192
	dword buf, fcount, error;
198
	dword buf, fcount, error;
193
	buf = malloc(32);
199
	buf = malloc(32);
194
	error = ReadDir(0, buf, path);
200
	error = ReadDir(0, buf, path);
195
	if (!error)
201
	if (!error)
196
	{
202
	{
197
		fcount = ESDWORD[buf+8];
203
		fcount = ESDWORD[buf+8];
198
		buf = realloc(buf, fcount+1*304+32);
204
		buf = realloc(buf, fcount+1*304+32);
199
		ReadDir(fcount, buf, path);
205
		ReadDir(fcount, buf, path);
-
 
206
		//fcount=EBX;
-
 
207
 
-
 
208
		if (doptions == DIRS_ONLYREAL)
200
		//fcount=EBX;
209
		{
201
		if (!strcmp(".",buf+72)) {fcount--; memmov(buf,buf+304,fcount*304);}
210
			if (!strcmp(".",buf+72)) {fcount--; memmov(buf,buf+304,fcount*304);}
-
 
211
			if (!strcmp("..",buf+72)) {fcount--; memmov(buf,buf+304,fcount*304);}
-
 
212
		}
-
 
213
		if (doptions == DIRS_NOROOT)
-
 
214
		{
-
 
215
			if (!strcmp(".",buf+72)) {fcount--; memmov(buf,buf+304,fcount*304);}
-
 
216
		}
202
		if (!strcmp("..",buf+72)) {fcount--; memmov(buf,buf+304,fcount*304);}
217
 
203
		ESDWORD[dir_buf] = buf;
218
		ESDWORD[dir_buf] = buf;
204
		ESDWORD[file_count] = fcount;
219
		ESDWORD[file_count] = fcount;
205
	}
220
	}
206
	else
221
	else