summaryrefslogtreecommitdiff
path: root/data/mods/default/textures/default_ladder.png
blob: 11056359df244d768e3aa827f5de09feed10aabe (plain)
ofshex dumpascii
0000 89 50 4e 47 0d 0a 1a 0a 00 00 00 0d 49 48 44 52 00 00 00 10 00 00 00 10 08 06 00 00 00 1f f3 ff .PNG........IHDR................
0020 61 00 00 00 01 73 52 47 42 00 ae ce 1c e9 00 00 01 45 49 44 41 54 38 cb c5 92 c1 4a 02 51 14 86 a....sRGB........EIDAT8....J.Q..
0040 bf 7b 67 1c 9d 06 92 20 69 51 48 4b 77 51 bb 5e c4 97 08 0c da b9 6c d5 26 02 37 41 3e 42 10 d5 .{g.....iQHKwQ.^......l.&.7A>B..
0060 33 b4 af 75 04 a1 65 34 96 a8 39 4e ce e8 bd 73 db 44 54 c2 48 b4 f0 df 1d f8 f8 f8 cf e1 c0 67 3..u..e4..9N...s.DT.H..........g
0080 ea 95 92 a9 96 8b 86 19 a9 96 8b a6 5e 29 7d 71 f6 6f a0 b6 b3 61 3c d7 26 67 4b 12 03 8e 23 19 ............^)}q.o...a<.&gK...#.
00a0 8e 14 4a 1b ba 83 98 20 08 7e f0 53 02 ff b5 cf eb 60 c2 92 97 41 4a 98 28 83 4e 40 4a c8 7b 53 ..J......~.S.....`...AJ.(.N@J.{S
00c0 f8 b4 e0 e0 b4 29 66 ad f0 7d 96 fc 33 53 0d 4e f6 b6 8c 52 09 ab 05 17 4b 08 fc 5e cc a2 6b 13 .....)f..}..3S.N...R....K..^..k.
00e0 8d 35 7e 2f a2 ff 36 48 17 dc 35 3b 84 a3 84 fb 96 85 10 60 4b 88 27 86 b1 4a b0 a4 c0 cb 89 74 .5~/..6H..5;.......`K.'..J.....t
0100 c1 e1 d9 c3 9c 6f 70 bc bb 69 5c 47 32 8c 34 59 47 b2 b6 ec d2 f0 43 9c 8c 64 f8 ae 69 77 7a e9 .....op..i\G2.4YG.....C..d..iwz.
0120 82 db 46 07 db 92 8c c6 1a 4b c0 b3 ef 10 c6 1a a5 0c 09 e0 3a 33 1a d4 2e 1f e7 7c 83 f3 fd 6d ..F......K..........:3.....|...m
0140 13 46 9a 78 a2 e9 06 63 d6 57 3c 94 36 bc f4 23 6c 29 68 b5 bb e9 82 ab 9b 27 72 59 c9 28 4e 58 .F.x...c.W<.6..#l)h......'rY.(NX
0160 c8 4a ae 7b 01 61 a4 11 42 10 46 9a 42 de 4a 17 1c 5d fc ed 0f 3e 00 07 08 90 11 69 6a 6b 93 00 .J.{.a..B.F.B.J..]...>.....ijk..
0180 00 00 00 49 45 4e 44 ae 42 60 82 ...IEND.B`.
' href='#n117'>117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313
/*
Minetest-c55
Copyright (C) 2010 celeron55, Perttu Ahola <celeron55@gmail.com>

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/

#include "filesys.h"
#include "strfnd.h"
#include <iostream>
#include <string.h>

namespace fs
{

#ifdef _WIN32 // WINDOWS

#define _WIN32_WINNT 0x0501
#include <Windows.h>
#include <stdio.h>
#include <malloc.h>
#include <tchar.h> 
#include <wchar.h> 
#include <stdio.h>

#define BUFSIZE MAX_PATH

std::vector<DirListNode> GetDirListing(std::string pathstring)
{
	std::vector<DirListNode> listing;

	WIN32_FIND_DATA FindFileData;
	HANDLE hFind = INVALID_HANDLE_VALUE;
	DWORD dwError;
	LPTSTR DirSpec;
	INT retval;

	DirSpec = (LPTSTR) malloc (BUFSIZE);

	if( DirSpec == NULL )
	{
	  printf( "Insufficient memory available\n" );
	  retval = 1;
	  goto Cleanup;
	}

	// Check that the input is not larger than allowed.
	if (pathstring.size() > (BUFSIZE - 2))
	{
	  _tprintf(TEXT("Input directory is too large.\n"));
	  retval = 3;
	  goto Cleanup;
	}

	//_tprintf (TEXT("Target directory is %s.\n"), pathstring.c_str());

	sprintf(DirSpec, "%s", (pathstring + "\\*").c_str());

	// Find the first file in the directory.
	hFind = FindFirstFile(DirSpec, &FindFileData);

	if (hFind == INVALID_HANDLE_VALUE) 
	{
	  _tprintf (TEXT("Invalid file handle. Error is %u.\n"), 
				GetLastError());
	  retval = (-1);
	} 
	else 
	{
		// NOTE:
		// Be very sure to not include '..' in the results, it will
		// result in an epic failure when deleting stuff.

		DirListNode node;
		node.name = FindFileData.cFileName;
		node.dir = FindFileData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY;
		if(node.name != "." && node.name != "..")
			listing.push_back(node);

		// List all the other files in the directory.
		while (FindNextFile(hFind, &FindFileData) != 0) 
		{
			DirListNode node;
			node.name = FindFileData.cFileName;
			node.dir = FindFileData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY;
			if(node.name != "." && node.name != "..")
				listing.push_back(node);
		}

		dwError = GetLastError();
		FindClose(hFind);
		if (dwError != ERROR_NO_MORE_FILES) 
		{
		 _tprintf (TEXT("FindNextFile error. Error is %u.\n"), 
				   dwError);
		retval = (-1);
		goto Cleanup;
		}
	}
	retval  = 0;

Cleanup:
	free(DirSpec);

	if(retval != 0) listing.clear();

	//for(unsigned int i=0; i<listing.size(); i++){
	//	std::cout<<listing[i].name<<(listing[i].dir?" (dir)":" (file)")<<std::endl;
	//}