/*
  <auto-generated/>
  C# bindings for Simple DirectMedia Layer.
  Original copyright notice of input files:

  Simple DirectMedia Layer
  Copyright (C) 1997-2024 Sam Lantinga <slouken@libsdl.org>

  This software is provided 'as-is', without any express or implied
  warranty.  In no event will the authors be held liable for any damages
  arising from the use of this software.

  Permission is granted to anyone to use this software for any purpose,
  including commercial applications, and to alter it and redistribute it
  freely, subject to the following restrictions:

  1. The origin of this software must not be misrepresented; you must not
     claim that you wrote the original software. If you use this software
     in a product, an acknowledgment in the product documentation would be
     appreciated but is not required.
  2. Altered source versions must be plainly marked as such, and must not be
     misrepresented as being the original software.
  3. This notice may not be removed or altered from any source distribution.
*/

using System;
using System.Runtime.InteropServices;

namespace SDL
{
    public partial struct SDL_Process
    {
    }

    public enum SDL_ProcessIO
    {
        SDL_PROCESS_STDIO_INHERITED,
        SDL_PROCESS_STDIO_NULL,
        SDL_PROCESS_STDIO_APP,
        SDL_PROCESS_STDIO_REDIRECT,
    }

    public static unsafe partial class SDL3
    {
        [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
        public static extern SDL_Process* SDL_CreateProcess([NativeTypeName("const char *const *")] byte** args, [NativeTypeName("bool")] SDLBool pipe_stdio);

        [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
        public static extern SDL_Process* SDL_CreateProcessWithProperties(SDL_PropertiesID props);

        [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
        public static extern SDL_PropertiesID SDL_GetProcessProperties(SDL_Process* process);

        [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
        [return: NativeTypeName("void*")]
        public static extern IntPtr SDL_ReadProcess(SDL_Process* process, [NativeTypeName("size_t *")] nuint* datasize, int* exitcode);

        [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
        public static extern SDL_IOStream* SDL_GetProcessInput(SDL_Process* process);

        [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
        public static extern SDL_IOStream* SDL_GetProcessOutput(SDL_Process* process);

        [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
        [return: NativeTypeName("bool")]
        public static extern SDLBool SDL_KillProcess(SDL_Process* process, [NativeTypeName("bool")] SDLBool force);

        [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
        [return: NativeTypeName("bool")]
        public static extern SDLBool SDL_WaitProcess(SDL_Process* process, [NativeTypeName("bool")] SDLBool block, int* exitcode);

        [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
        public static extern void SDL_DestroyProcess(SDL_Process* process);

        [NativeTypeName("#define SDL_PROP_PROCESS_CREATE_ARGS_POINTER \"SDL.process.create.args\"")]
        public static ReadOnlySpan<byte> SDL_PROP_PROCESS_CREATE_ARGS_POINTER => "SDL.process.create.args"u8;

        [NativeTypeName("#define SDL_PROP_PROCESS_CREATE_ENVIRONMENT_POINTER \"SDL.process.create.environment\"")]
        public static ReadOnlySpan<byte> SDL_PROP_PROCESS_CREATE_ENVIRONMENT_POINTER => "SDL.process.create.environment"u8;

        [NativeTypeName("#define SDL_PROP_PROCESS_CREATE_WORKING_DIRECTORY_STRING \"SDL.process.create.working_directory\"")]
        public static ReadOnlySpan<byte> SDL_PROP_PROCESS_CREATE_WORKING_DIRECTORY_STRING => "SDL.process.create.working_directory"u8;

        [NativeTypeName("#define SDL_PROP_PROCESS_CREATE_STDIN_NUMBER \"SDL.process.create.stdin_option\"")]
        public static ReadOnlySpan<byte> SDL_PROP_PROCESS_CREATE_STDIN_NUMBER => "SDL.process.create.stdin_option"u8;

        [NativeTypeName("#define SDL_PROP_PROCESS_CREATE_STDIN_POINTER \"SDL.process.create.stdin_source\"")]
        public static ReadOnlySpan<byte> SDL_PROP_PROCESS_CREATE_STDIN_POINTER => "SDL.process.create.stdin_source"u8;

        [NativeTypeName("#define SDL_PROP_PROCESS_CREATE_STDOUT_NUMBER \"SDL.process.create.stdout_option\"")]
        public static ReadOnlySpan<byte> SDL_PROP_PROCESS_CREATE_STDOUT_NUMBER => "SDL.process.create.stdout_option"u8;

        [NativeTypeName("#define SDL_PROP_PROCESS_CREATE_STDOUT_POINTER \"SDL.process.create.stdout_source\"")]
        public static ReadOnlySpan<byte> SDL_PROP_PROCESS_CREATE_STDOUT_POINTER => "SDL.process.create.stdout_source"u8;

        [NativeTypeName("#define SDL_PROP_PROCESS_CREATE_STDERR_NUMBER \"SDL.process.create.stderr_option\"")]
        public static ReadOnlySpan<byte> SDL_PROP_PROCESS_CREATE_STDERR_NUMBER => "SDL.process.create.stderr_option"u8;

        [NativeTypeName("#define SDL_PROP_PROCESS_CREATE_STDERR_POINTER \"SDL.process.create.stderr_source\"")]
        public static ReadOnlySpan<byte> SDL_PROP_PROCESS_CREATE_STDERR_POINTER => "SDL.process.create.stderr_source"u8;

        [NativeTypeName("#define SDL_PROP_PROCESS_CREATE_STDERR_TO_STDOUT_BOOLEAN \"SDL.process.create.stderr_to_stdout\"")]
        public static ReadOnlySpan<byte> SDL_PROP_PROCESS_CREATE_STDERR_TO_STDOUT_BOOLEAN => "SDL.process.create.stderr_to_stdout"u8;

        [NativeTypeName("#define SDL_PROP_PROCESS_CREATE_BACKGROUND_BOOLEAN \"SDL.process.create.background\"")]
        public static ReadOnlySpan<byte> SDL_PROP_PROCESS_CREATE_BACKGROUND_BOOLEAN => "SDL.process.create.background"u8;

        [NativeTypeName("#define SDL_PROP_PROCESS_CREATE_CMDLINE_STRING \"SDL.process.create.cmdline\"")]
        public static ReadOnlySpan<byte> SDL_PROP_PROCESS_CREATE_CMDLINE_STRING => "SDL.process.create.cmdline"u8;

        [NativeTypeName("#define SDL_PROP_PROCESS_PID_NUMBER \"SDL.process.pid\"")]
        public static ReadOnlySpan<byte> SDL_PROP_PROCESS_PID_NUMBER => "SDL.process.pid"u8;

        [NativeTypeName("#define SDL_PROP_PROCESS_STDIN_POINTER \"SDL.process.stdin\"")]
        public static ReadOnlySpan<byte> SDL_PROP_PROCESS_STDIN_POINTER => "SDL.process.stdin"u8;

        [NativeTypeName("#define SDL_PROP_PROCESS_STDOUT_POINTER \"SDL.process.stdout\"")]
        public static ReadOnlySpan<byte> SDL_PROP_PROCESS_STDOUT_POINTER => "SDL.process.stdout"u8;

        [NativeTypeName("#define SDL_PROP_PROCESS_STDERR_POINTER \"SDL.process.stderr\"")]
        public static ReadOnlySpan<byte> SDL_PROP_PROCESS_STDERR_POINTER => "SDL.process.stderr"u8;

        [NativeTypeName("#define SDL_PROP_PROCESS_BACKGROUND_BOOLEAN \"SDL.process.background\"")]
        public static ReadOnlySpan<byte> SDL_PROP_PROCESS_BACKGROUND_BOOLEAN => "SDL.process.background"u8;
    }
}
