aboutsummaryrefslogtreecommitdiffstats
path: root/core/macos.c
AgeCommit message (Collapse)Author
2020-04-09cloud-storage: simplify creation of git authorshipGravatar Dirk Hohndel
While having the local user information in the repo on Linux seemed clever when we implemented it, it's inconsistent with all the other platforms. Let's just not do that unless the user has indeed set a global name/email pair for git. Instead indicate if this was Subsurface or Subsurface-mobile. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-08-11Add missing header files to macos.cGravatar Doug Junkins
Missing header files were causing errors opening cloud storage on launch on Mac OSX. Signed-off-by: Doug Junkins <junkins@foghead.com>
2018-09-24macOS: always list 'FTDI' as a serial connectionGravatar Dirk Hohndel
We now link against the user space FTDI driver. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-08-27Make device enumeration use the device transport dataGravatar Linus Torvalds
This removes some special-case code for Uemis, replacing it with simply passing in the device transport information. This makes device enumeration work for the Garmin Descent (if it is listed by libdivecomputer as a USB storage device, that is). I don't actually do any of the libdivecomputer parsing yet, and only have a stub for the Garmin Descent, but now the directory selection works with that stub. The actual download obviously does not. [Dirk Hohndel: removed obsolete FIXME from code] Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-08-27Treat the "GARMIN" mount point exactly like the "UEMISSDA" oneGravatar Linus Torvalds
The logic for finding a mount point for the Garmin FIT devices is basically exactly the same as for the UEMISSDA, even if the rest of the sequence is not the same. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-05-24core: replace (void) with UNUSED(x) and include ssrf.hGravatar jan Iversen
Unused parameters in C are "silenced" by adding UNUSED(x) Signed-off-by: Jan Iversen <jani@apache.org>
2018-05-14Core: introduce new subsurface-string headerGravatar Dirk Hohndel
First small step to shrinking dive.h. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-02-17Coding-style: remove superfluous parenthesesGravatar Berthold Stoeger
Mostly replace "return (expression);" by "return expression;" and one case of "function((parameter))" by "function(parameter)". Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-01-11Introduce helper function empty_string()Gravatar Berthold Stoeger
There are ca. 50 constructs of the kind same_string(s, "") to test for empty or null strings. Replace them by the new helper function empty_string(). Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2017-11-22Clean up system_default_filename()Gravatar Berthold Stoeger
In the old implementation there were two static C-style strings, filename and path, which were initialized to NULL and filled on first call of the function (i.e. singletons). There is no sense in having two static variables indicating whether this function was called previously. Moreover, there is no point in remembering filename accross function calls, because it is not used once path is set to a non-NULL value. Therefore, make the filename variable non-static and calculate it only on first invocation (as indicated by a NULL path). Moreover, free() the filename variable after its use to fix a memory leak of the old code. The windows code is slightly different in that the temporary filename is not dynamically allocated. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2017-11-03win32: optimize the console and logging logicGravatar Lubomir I. Ivanov
Currently one has to explicitly use --win32console and/or --win32log to enable a dedicated console (a console window that opens next to the Subsurface window) or to enable file logging on Win32. This patch makes the following changes: - removes the --win32* command line arguments - removes the dedicated console window support - if the app starts from a shortcut and not from a console, always redirect stderr and stdout to _err & _out log files - if the app starts from a console redirect stderr and stdout to that console Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-04-29Add SPDX header to core C filesGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-02-24Add subsurface_stat for MacGravatar Dirk Hohndel
Which is also used on iOS. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-02-03Same typo, two more timesGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-02-03Win32: add the --win32log option to log stdout and stderr to filesGravatar Lubomir I. Ivanov
Adding --win32log as the first command line option on Windows will now log all stdout and stderr output to the files subsurface_err.log and subsurface_out.log in the working directory. This change required a new argument 'bool logfile' to be added to: subsurface_console_init() which is defined in all platform files (linux.c, macos.c, etc.) Example usage: subsurface.exe --win32log -v -v -v Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2016-04-04Move subsurface-core to core and qt-mobile to mobile-widgetsGravatar Dirk Hohndel
Having subsurface-core as a directory name really messes with autocomplete and is obviously redundant. Simmilarly, qt-mobile caused an autocomplete conflict and also was inconsistent with the desktop-widget name for the directory containing the "other" UI. And while cleaning up the resulting change in the path name for include files, I decided to clean up those even more to make them consistent overall. This could have been handled in more commits, but since this requires a make clean before the build, it seemed more sensible to do it all in one. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>