Commit Graph

62 Commits

Author SHA1 Message Date
Liam
51fce6e4c3 usbcomms: add async API 2023-04-04 19:57:35 -04:00
yellows8
c09a21d87d
socket: Fix building without bsd-headers. 2023-03-10 12:30:55 -05:00
yellows8
f64d2059c4
ssl: Add support for the new 16.0.0 functionality. 2023-03-09 23:14:40 -05:00
yellows8
d33bb0ad6a
nifm/socket: Add nifmRequest sleep/register-socket cmds. 2022-05-31 20:09:26 -04:00
Michael Theall
16f8547f4c Add support for SGR 38 and 48
This supports the escape sequences used by fmtlib
2021-11-10 20:38:30 +01:00
fincs
f47e1d26ec
Remove obsolete reference to 3dmoo carried over from libctru 2021-05-21 23:03:54 +02:00
Tim Gates
8cbd1cf03c docs: fix simple typo, recieve -> receive
There is a small typo in nx/include/switch/runtime/devices/socket.h, nx/include/switch/services/bsd.h.

Should read `receive` rather than `recieve`.
2020-12-19 13:35:29 +01:00
HookedBehemoth
ac468913e4
add commands for accessing process storage (#485) 2020-06-06 15:13:23 +02:00
yellows8
3b2b3ebad4 socket-ssl: Updated docs. Check for output sockfd=-1 from the cmd with socketSslConnectionSetSocketDescriptor. 2020-04-24 16:39:22 -04:00
yellows8
41aefdc5ee ssl/socket: Added socketSslConnectionSetSocketDescriptor/socketSslConnectionGetSocketDescriptor wrappers, and updated ssl for this. 2020-04-24 16:39:22 -04:00
yellows8
c82c8b8760
fs/fs_dev: Added fsOpenReadOnlySaveDataFileSystem and fsOpen_SaveDataReadOnly/fsdevMountSaveDataReadOnly. Minor adjustments. 2020-04-03 19:58:40 -04:00
yellows8
fa52f9b046
fs/fs_dev: Added fsOpen_TemporaryStorage/fsOpen_CacheStorage and fsdevMountTemporaryStorage/fsdevMountCacheStorage. Minor adjustments. 2020-04-03 19:16:26 -04:00
yellows8
918fe2b4d6
fs/fs_dev: Added fsOpen_BcatSaveData/fsOpen_SystemBcatSaveData and fsdevMountBcatSaveData/fsdevMountSystemBcatSaveData. 2020-04-03 11:04:05 -04:00
yellows8
f0f21507db
fs/fsdev: Added fsdevMountDeviceSaveData/fsOpen_DeviceSaveData, and minor other adjustments. 2020-03-18 22:33:15 -04:00
Pablo Curiel
1719eda9fb Update documentation about fsdevMountDevice() to inform about trailing colons in device names. (#362) 2020-01-02 02:20:32 +01:00
yellows8
5182b57a1d
fs/fs_dev: Added FsFileSystemQueryId_IsValidSignedSystemPartitionOnSdCard, fsFsIsValidSignedSystemPartitionOnSdCard, and fsdevIsValidSignedSystemPartitionOnSdCard. Improved docs. 2019-11-28 18:51:52 -05:00
yellows8
8fe48e8eac
fs/fs_dev/romfs_dev: Updated various types to use s64. Removed the inval param from fsDirRead since it doesn't exist. Renamed fileSize in FsDirectoryEntry to file_size and updated the type. Renamed FsFileSystemQueryType to FsFileSystemQueryId, and renamed FsFileSystemQueryType_SetArchiveBit to FsFileSystemQueryId_SetConcatenationFileAttribute. Renamed fsFsSetArchiveBit to fsFsSetConcatenationFileAttribute. Renamed fsdevSetArchiveBit to fsdevSetConcatenationFileAttribute. Minor other changes. 2019-11-28 14:58:55 -05:00
yellows8
f181807215
fs/fs_dev: Updated names to match wiki. Updated param names. Renamed FS_SAVEDATA_CURRENT_PROGRAMID to FS_SAVEDATA_CURRENT_APPLICATIONID. Updated field names in FsSaveDataAttribute, FsSaveDataExtraData, FsSaveDataCreationInfo, and FsSaveDataInfo. Updated names for the enum values for FsSaveDataSpaceId, FsSaveDataType, FsSaveDataFlags, and FsGameCardAttribute. Added FsSaveDataSpaceId_SdUser and FsSaveDataSpaceId_SafeMode. Added FsSaveDataType_SystemBcat. Added FsSaveDataRank. Fixed the name for FsGameCardPartition and added FsGameCardPartition_Logo. Renamed FsBisStorageId to FsBisPartitionId, updated the enum value names for it, and added FsBisPartitionId_SignedSystemPartitionOnSafeMode. Improved docs / minor other changes. 2019-11-16 16:07:10 -05:00
yellows8
9888df18da
Moved most ncm types into ncm_types.h. Renamed FsStorageId to NcmStorageId, with updated names for some values (now located in ncm_types.h). Various improvements + improved docs. 2019-11-11 18:19:45 -05:00
yellows8
4ab50e3752
Use official naming instead of 'title(ID)'. Use 'uid(s)' instead of 'userID(s)'. Updated various struct field names. Improved docs + minor other improvements. 2019-10-30 10:38:05 -04:00
fincs
26f620dc0e
Split up socket.c + work in progress changes:
- DNS stuff moved to runtime/resolver.c & .h
- Address manipulation functions moved to runtime/util/inet_addr.c
- Removed sfdnsres/nifm handling in runtime/devices/socket.c
- Renamed socketGetLastBsdResult to socketGetLastResult
- Renamed socketGetLastSfdnsresResult to resolverGetLastResult
- gethostid now inits/deinits nifm as needed
- sfdnsres related configuration gone from SocketInitConfig
- Fixed bug in addrinfo deserialization
- getaddrinfo rewritten, hints can now be NULL
- TODO: add back a way to control service discovery/cancel handle
2019-10-28 12:36:29 +01:00
fincs
5340c7d7dc
Add multithreaded BSD/socket support; revise BSD service type handling so that bsd:u is the default (since it has 22 worker threads as opposed to bsd:s's 11) 2019-10-26 17:26:04 +02:00
fincs
9e83f82a62
Enhance fsOpen_SystemSaveData/fsdevMountSystemSaveData 2019-10-21 21:15:40 +02:00
fincs
47b0403333
Pass plain AccountUid inputs by value instead of by non-const pointer 2019-10-21 16:57:01 +02:00
fincs
13fbde91b0
fsdev: Added fsdevMountSaveData/SystemSaveData wrappers 2019-10-21 12:38:18 +02:00
fincs
c77b88d868
Major cleanup and refactor of fsdev and romfsdev, see details:
fsdev:
- Removed fsdevGetDefaultFileSystem and default-fs handling
- Refactored CWD support to have (dynamically allocated) per-device CWDs
  (CWD support as a whole can be turned off with __nx_fsdev_support_cwd)
- Optimized calls by passing pointer to device through r->deviceData
- Use the per-thread path buffer directly as the argument to FS functions
- Removed redundant cross-device check in fsdev_rename
- Fixed string comparison logic in fsdevFindDevice
- fsdev_fixpath now accepts an input device in order to skip device
  lookup (extensively used along with r->deviceData)
- Mounting a filesystem now automatically sets the default device
  if there wasn't any previous default device (or if it's stdnull)
- fsdevMountSdmc no longer sets cwd to the folder containing the
  executable - this logic was moved to a new internal function
  called on startup by default (and it is now disabled for NSOs)
- Other miscellaneous optimizations

romfsdev:
- Cleaned up romfsMount* functions, removed unused/unnecessary logic
- Changed romfsMount* functions to return real result codes
- Renamed romfsMount to romfsMountSelf and improved documentation
- Removed romfsInitFromFile and romfsInitFromStorage (use Mount instead)
- Added documentation for romfsInit and romfsExit
2019-10-20 22:22:04 +02:00
fincs
3c610fb2cb
fsdev: Allow directory entry cache size to be configured dynamically 2019-10-18 21:23:11 +02:00
fincs
77888f8b1f
fs: Use new IPC interface + fixes, see details:
- Argument types corrected to better reflect their actual types
  (mostly several incorrect instances of size_t were changed to u64)
- Const correctness fixes
- fsEventNotifierGetEventHandle changed to output an Event (with
  user configurable autoclear) instead of a raw Handle
2019-09-21 16:27:15 +02:00
Michael Scire
ac9d76f373 fs: fix file/storage API, add fsdevCreateFile, add fsOpenFileSystemWithPatch. 2019-06-03 14:48:45 -04:00
yellows8
90620daf05
Added romfsMountFromCurrentProcess(). 2019-05-17 11:15:43 -04:00
SciresM
e114a361be fsdev: add way of getting last returned result. (#276)
Adds fsdevGetLastResult, which returns a thread local Result updated by every call to fsdev_translate_error.

Also changes fsdev_translate_error to return EIO instead of raw results, when not translatable.
2019-05-08 16:44:17 +02:00
yellows8
e359010e75
Improved fs_dev docs. 2019-05-05 17:17:08 -04:00
Adubbz
1d3e208807 Added fsdevDeleteDirectoryRecursively 2019-05-05 18:26:08 +02:00
yellows8
fd9e02b271
Added romfsMountFromFsdev and fsdevTranslatePath. Internal romfs_dev improvements. 2019-03-29 19:49:08 -04:00
Michael Scire
1bea504732 Added fsOpenDataStorageByDataId and romfsMountFromDataArchive 2019-03-25 00:02:18 +01:00
Michael Scire
43128b613b romfs: refactor to allow specifying mount name 2019-03-25 00:02:18 +01:00
SciresM
e19765445d fs: Add fsFsQueryEntry (and fsFsSetArchiveBit helper) (#202)
* fs: Add fsFsSetArchiveBit

* Add fsdevSetArchiveBit wrapper
2018-11-09 22:03:47 -05:00
yellows8
cfbc3e9278 Added usbCommsSetErrorHandling, don't throw fatalSimple for usbComms by default. 2018-10-19 12:34:17 -04:00
yellows8
52686826d1 Added fsdevGetDeviceFileSystem(). 2018-10-12 22:13:14 -04:00
SciresM
347e3b3156 Refactor usb:ds, add 5.0.0+ support to usbComms. (#181)
* Refactor usb:ds, add support for 5.0.0+. Closes #109.
2018-10-11 15:35:22 -04:00
fincs
1563df3921 Refactor console device, see details:
- Added ConsoleRenderer interface, which abstracts all relevant
  operations needed to set up and write characters to a text mode display
- ConsoleFont now has tileWidth/tileHeight parameters
- PrintConsole now holds a pointer to a ConsoleRenderer
- Added consoleExit for deinitializing the console
- Added consoleUpdate for updating the display every frame
- Corrected lots of obsolete/outdated comments
- Separated console software renderer into its own file (console_sw.c)
- Added getDefaultConsoleRenderer weak function, for selecting the
  default console renderer when none (NULL) is specified in PrintConsole
- Software renderer now takes care of gfxInitDefault/gfxExit
- All these changes are backwards compatible with older programs because:
  - gfxInitDefault has double-init protection
  - Old programs don't call consoleUpdate/Exit, but their implementation
    in the software renderer is identical to what old programs were
    already doing anyway
2018-10-06 16:48:03 +02:00
yellows8
165932fbde Added a comment for fsdevCommitDevice(). 2018-05-12 11:56:04 -04:00
fincs
2818c99dea Revise fsdev initialization, see details:
- Removed fsdevInit/Exit
- Now automatically initializing fsdev state on first mount
- Added fsdevMountSdmc (replaces fsdevInit)
- Added fsdevUnmountAll (replaces fsdevExit)
2018-05-01 19:06:14 +02:00
yellows8
a3baa0eeb1 Allow using multiple interfaces with usbComms. Added usbComms Ex funcs. Use RwLock with usbComms. Various other usbComms changes. 2018-04-11 17:18:23 -04:00
yellows8
e9f07a314a Removed warning comment from romfs_dev.h, romfs example README mentions this. 2018-02-28 19:44:53 -05:00
TuxSH
d33b26016d Add documentation to bsd.h and sfdnsres.h, etc. 2018-02-27 19:14:44 +01:00
TuxSH
dcf3e56300 Implement netdb.h functions, fix bugs, etc. 2018-02-27 19:14:44 +01:00
TuxSH
0b92bb76b0 Add newlib wrapper for sockets...
... fix several bugs, etc.
2018-02-27 19:14:44 +01:00
Dave Murphy
0bbfbadc39 switch to 16x16 console font 2018-02-25 15:49:25 +01:00
yellows8
4c1b09d6b9 Check for invalid handle in fs*Close(). Added fsOpenDataStorageByCurrentProcess(), fsStorageRead(), and fsStorageClose(). Added fsdevGetDefaultFileSystem(). Imported nro.h from nx-hbmenu. Implemented proper RomFS support. 2018-02-23 22:29:43 -05:00