Romain Vimont
3bc1c51b91
Always use SDL_malloc() and SDL_free()
...
To avoid mixing SDL_malloc()/SDL_strdup() with free(), or malloc() with
SDL_free(), always use the SDL version.
7 years ago
Romain Vimont
dfed1b250e
Replace SDL types by C99 standard types
...
Scrcpy is a C11 project. Use the C99 standard types instead of the
SDL-specific types:
SDL_bool -> bool
SintXX -> intXX_t
UintXX -> uintXX_t
7 years ago
Romain Vimont
aeda583a2c
Update code style
...
Limit source code to 80 chars, and declare functions return type and
modifiers on a separate line.
This allows to avoid very long lines, and all function names are
aligned.
(We do this on VLC, and I like it.)
7 years ago
Romain Vimont
477c0a2cab
Create process with wide chars on Windows
...
Windows does not support UTF-8, so pushing a file with non-ASCII
characters failed.
Convert the UTF-8 command line to a wide characters string and call
CreateProcessW().
Fixes <https://github.com/Genymobile/scrcpy/issues/422 >
7 years ago
Romain Vimont
c20245630e
Factorize Windows command building
...
Extract command line building to a separate method.
7 years ago
yuchenlin
27bed948d4
Use specific error for missing binary on Windows
...
Signed-off-by: yuchenlin <npes87184@gmail.com>
Signed-off-by: Romain Vimont <rom@rom1v.com>
7 years ago
Romain Vimont
55d33ddd5f
Do not handle system-specific values in command.c
...
The common command.c handled process errors from system-specific int
values (errno).
Rather, expose a new enum process_result to handle error cause in a
generic way.
7 years ago
yuchenlin
6d2d803003
Notify adb missing
...
There are many user who encounters missing adb.
To stop things happens again, we check it and show
sexy response to user.
Signed-off-by: yuchenlin <npes87184@gmail.com>
7 years ago
Romain Vimont
536b31829a
Separate multi-words filenames by '_'
...
Rename foobar.ext to foo_bar.ext.
<https://github.com/Genymobile/scrcpy/pull/226#discussion_r209454865 >
7 years ago
Romain Vimont
a63dd47f2d
Make CreateProcess() flags depend on "noconsole"
...
On Windows, display the output of external commands (adb) when a console
is available.
8 years ago
Romain Vimont
f5cf6c1b2c
Include source root directory
...
All headers and sources are in src/. To avoid using relative includes
from subdirectories ("../../"), include the source root directory.
8 years ago
Romain Vimont
518d6d5dcd
Prevent new window opening with CreateProcess()
...
Executing commands (like "adb push") created a new terminal window on
Windows. Avoid it.
8 years ago
Romain Vimont
3ed80a1fac
Define macros wrappers for logs
...
Use macros to wrap SDL_Log* functions with the "application" category.
8 years ago
Romain Vimont
ad41bacb48
Fix "terminate process" on Windows
...
CloseHandle() does not terminate the process. TerminateProcess() does.
8 years ago
Romain Vimont
66b7a99db6
Fix includes windows-specific source
...
The header strutil.h is two levels above sys/win/command.c, and
SDL_log.h was missing.
8 years ago
Romain Vimont
95591d2938
Move platform specific to sys/
...
Move unix/ and win/ to sys/, so that we can use android/ for android
headers without confusion.
8 years ago