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

Missing direct.h contents #466

Open
JayFoxRox opened this issue Apr 21, 2021 · 1 comment · May be fixed by #636
Open

Missing direct.h contents #466

JayFoxRox opened this issue Apr 21, 2021 · 1 comment · May be fixed by #636

Comments

@JayFoxRox
Copy link
Member

We do have a direct.h already, but it's empty.

I currently use this hack:

echo "#pragma once // Generated" > $NXDK_DIR/lib/xboxrt/libc_extensions/direct.h
echo "int _chdir(const char *dirname) { return 0; }" >> $NXDK_DIR/lib/xboxrt/libc_extensions/direct.h
echo "int _mkdir(const char *dirname) { return 0; }" >> $NXDK_DIR/lib/xboxrt/libc_extensions/direct.h

I hope that someone will implement this properly.

There's more functionality in this, but this is enough for my current projects

@ExoSkye
Copy link

ExoSkye commented Jun 10, 2023

I was working on this and I noticed something:
All the sources I can find on what is contained within direct.h contradict each other-
Which is annoying

ie. www.digitalmars.com/rtl/direct.html says that it contains fnmerge and fnsplit whereas wikipedia lists that these should have an underscore in front of them, ie _fnmerge and _fnsplit

On top of this, a lot of the functions simply can't be implemented, ie _searchpath, _chdir, _getwd, _getdrive, _getcwd, _chdrive

Currently I have the _chxxxx ones simply return 0 since they can't really do anything else, other than that, _getcwd, _getdrive, _getwd and _searchpath all return error values (either a pointer to NULL, or, 0 in the case of _getdrive)

@ExoSkye ExoSkye linked a pull request Jun 10, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

2 participants