Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API Reference #27

Open
cxong opened this issue Mar 15, 2016 · 4 comments
Open

API Reference #27

cxong opened this issue Mar 15, 2016 · 4 comments

Comments

@cxong
Copy link
Owner

cxong commented Mar 15, 2016

A document that describes the public functions, parameters, return values etc.

@lautis0503
Copy link
Collaborator

lautis0503 commented Sep 7, 2016

For widechar:

Define UNICODE and _UNICODE and then include tinydir.h.
Use _tinydir_char_t instead of char for path string. (wchar_t for Windows and char for Linux)
Use TINYDIR_STRING("path") instead of "path". (L"path" for Windows)
Use _tinydir_str[len/cpy/cat/cmp/...] instead of str[len/cpy/cat/cmp]. (Same as _tcs macros)

@lautis0503
Copy link
Collaborator

I'm reading the code, while summarizing the usage.
Predefined limitations:
_TINYDIR_PATH_MAX use OS-related predefined macros or 4096.
But some of them, especially MAX_PATH in Windows, are not the actual limit.

_TINYDIR_FILENAME_MAX 256.
We need to verify if this number is appropriate for all of the OSes.

We also need to verify if the two numbers can be equal to, with or without the ending \0.

@lautis0503
Copy link
Collaborator

struct tinydir_file

  • variable: path, type: _tinydir_char_t[], length limit: 0(NULL), 1 to _TINYDIR_PATH_MAX.
  • variable: name, type: _tinydir_char_t[], length limit: 0(NULL), 1 to _TINYDIR_FILENAME_MAX.
  • variable: extension, type: _tinydir_char_t*.
  • variable: is_dir, type: int, meaning: boolean if this is a directory.
  • variable: is_reg, type: int, meaning: boolean if this is a regular file.
  • variable: is_link, type: int, meaning: boolean if this is a link file. NOT APPLICABLE NOW!

struct tinydir_dir

  • variable: path, type: _tinydir_char_t[], length limit: 0(NULL), 1 to _TINYDIR_PATH_MAX.
  • variable: has_next, type: int, meaning: boolean if there's another file.
  • variable: n_files, type: size_t, meaning: counts of files in the directory.
  • variable: _files, type: tinydir_file*, meaning: pointers to files in the directory.

@lautis0503
Copy link
Collaborator

Supported Operating System (not fully tested):

  • Windows 95+. (Ansi only)
  • Windows 2000+. (Unicode supported)
  • Linux kernel version 2.4.0+. (older version unknown)
  • FreeBSD/OpenBSD/NetBSD. (version unknown)
  • Debian GNU/Hurd. (version unknown)
  • Haiku OS. (version unknown)

Supported Compiler (not fully tested):

  • GCC 2.96+. (older version unknown)
  • Visual Studio 2003+. (older version unknown)
  • Clang & LLVM. (version unknown)
  • MSYS & MinGW. (version unknown)
  • MSYS2 & MinGW-w64. (version unknown)
  • Cygwin & GCC. (version unknown)

Notes:

  • Please use reasonable combination of operating system and compiler.
  • Versions older than above may also be applicable.
  • Although some of the above show version unknown, their latest version should be applicable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants