{
  "name": "scorpiox-scorpioplayer-remote-seek-stream",
  "version": "1.0.0",
  "notes": "const char* returns are IntPtr in C# (Linux .NET 9 marshaling bug); copy to managed string immediately via Marshal.PtrToStringAnsi. sprs_backend is passed by value; marshal as blittable struct.",
  "default_strategy": "LONG_LIVED",
  "my_buffered_stream": "NOT PORTED - Microsoft BCL copy",
  "exports": [
    {
      "name": "sprs_open",
      "return": "sprs_t*",
      "csharp_return": "IntPtr",
      "args": [
        {
          "name": "be",
          "type": "const sprs_backend*",
          "csharp_type": "IntPtr"
        },
        {
          "name": "url",
          "type": "const char*",
          "csharp_type": "string",
          "marshal": "UnmanagedType.LPUTF8Str"
        }
      ]
    },
    {
      "name": "sprs_open_with_headers",
      "return": "sprs_t*",
      "csharp_return": "IntPtr",
      "args": [
        {
          "name": "be",
          "type": "const sprs_backend*",
          "csharp_type": "IntPtr"
        },
        {
          "name": "url",
          "type": "const char*",
          "csharp_type": "string",
          "marshal": "UnmanagedType.LPUTF8Str"
        },
        {
          "name": "hdrs",
          "type": "const char *const*",
          "csharp_type": "IntPtr"
        },
        {
          "name": "n",
          "type": "int",
          "csharp_type": "int"
        }
      ]
    },
    {
      "name": "sprs_close",
      "return": "void",
      "csharp_return": "void",
      "args": [
        {
          "name": "s",
          "type": "sprs_t*",
          "csharp_type": "IntPtr"
        }
      ]
    },
    {
      "name": "sprs_length",
      "return": "int",
      "csharp_return": "int",
      "args": [
        {
          "name": "s",
          "type": "sprs_t*",
          "csharp_type": "IntPtr"
        },
        {
          "name": "out",
          "type": "int64_t*",
          "csharp_type": "out long"
        }
      ]
    },
    {
      "name": "sprs_position",
      "return": "int64_t",
      "csharp_return": "long",
      "args": [
        {
          "name": "s",
          "type": "const sprs_t*",
          "csharp_type": "IntPtr"
        }
      ]
    },
    {
      "name": "sprs_seek",
      "return": "int",
      "csharp_return": "int",
      "args": [
        {
          "name": "s",
          "type": "sprs_t*",
          "csharp_type": "IntPtr"
        },
        {
          "name": "offset",
          "type": "int64_t",
          "csharp_type": "long"
        },
        {
          "name": "whence",
          "type": "int",
          "csharp_type": "int"
        }
      ]
    },
    {
      "name": "sprs_read",
      "return": "int",
      "csharp_return": "int",
      "args": [
        {
          "name": "s",
          "type": "sprs_t*",
          "csharp_type": "IntPtr"
        },
        {
          "name": "dst",
          "type": "unsigned char*",
          "csharp_type": "byte[]"
        },
        {
          "name": "n",
          "type": "size_t",
          "csharp_type": "int"
        },
        {
          "name": "got",
          "type": "size_t*",
          "csharp_type": "out int"
        }
      ]
    },
    {
      "name": "sprs_read_at",
      "return": "int",
      "csharp_return": "int",
      "args": [
        {
          "name": "s",
          "type": "sprs_t*",
          "csharp_type": "IntPtr"
        },
        {
          "name": "off",
          "type": "int64_t",
          "csharp_type": "long"
        },
        {
          "name": "dst",
          "type": "unsigned char*",
          "csharp_type": "byte[]"
        },
        {
          "name": "n",
          "type": "size_t",
          "csharp_type": "int"
        },
        {
          "name": "got",
          "type": "size_t*",
          "csharp_type": "out int"
        }
      ]
    },
    {
      "name": "sprs_eof",
      "return": "int",
      "csharp_return": "int",
      "args": [
        {
          "name": "s",
          "type": "const sprs_t*",
          "csharp_type": "IntPtr"
        }
      ]
    },
    {
      "name": "sprs_set_cache_size",
      "return": "int",
      "csharp_return": "int",
      "args": [
        {
          "name": "s",
          "type": "sprs_t*",
          "csharp_type": "IntPtr"
        },
        {
          "name": "bytes",
          "type": "size_t",
          "csharp_type": "int"
        }
      ]
    },
    {
      "name": "sprs_set_seek_threshold",
      "return": "int",
      "csharp_return": "int",
      "args": [
        {
          "name": "s",
          "type": "sprs_t*",
          "csharp_type": "IntPtr"
        },
        {
          "name": "bytes",
          "type": "int64_t",
          "csharp_type": "long"
        }
      ]
    },
    {
      "name": "sprs_set_large_read_bypass",
      "return": "int",
      "csharp_return": "int",
      "args": [
        {
          "name": "s",
          "type": "sprs_t*",
          "csharp_type": "IntPtr"
        },
        {
          "name": "bytes",
          "type": "size_t",
          "csharp_type": "int"
        }
      ]
    },
    {
      "name": "sprs_set_strategy",
      "return": "int",
      "csharp_return": "int",
      "args": [
        {
          "name": "s",
          "type": "sprs_t*",
          "csharp_type": "IntPtr"
        },
        {
          "name": "strategy",
          "type": "int",
          "csharp_type": "int"
        }
      ]
    },
    {
      "name": "sprs_set_timeout_ms",
      "return": "int",
      "csharp_return": "int",
      "args": [
        {
          "name": "s",
          "type": "sprs_t*",
          "csharp_type": "IntPtr"
        },
        {
          "name": "ms",
          "type": "int",
          "csharp_type": "int"
        }
      ]
    },
    {
      "name": "sprs_set_max_retries",
      "return": "int",
      "csharp_return": "int",
      "args": [
        {
          "name": "s",
          "type": "sprs_t*",
          "csharp_type": "IntPtr"
        },
        {
          "name": "n",
          "type": "int",
          "csharp_type": "int"
        }
      ]
    },
    {
      "name": "sprs_set_require_accept_ranges",
      "return": "int",
      "csharp_return": "int",
      "args": [
        {
          "name": "s",
          "type": "sprs_t*",
          "csharp_type": "IntPtr"
        },
        {
          "name": "yes",
          "type": "int",
          "csharp_type": "int"
        }
      ]
    },
    {
      "name": "sprs_supports_ranges",
      "return": "int",
      "csharp_return": "int",
      "args": [
        {
          "name": "s",
          "type": "const sprs_t*",
          "csharp_type": "IntPtr"
        }
      ]
    },
    {
      "name": "sprs_server_accept_ranges",
      "return": "int",
      "csharp_return": "int",
      "args": [
        {
          "name": "s",
          "type": "const sprs_t*",
          "csharp_type": "IntPtr"
        }
      ]
    },
    {
      "name": "sprs_last_content_range",
      "return": "const char*",
      "csharp_return": "IntPtr",
      "args": [
        {
          "name": "s",
          "type": "const sprs_t*",
          "csharp_type": "IntPtr"
        }
      ]
    },
    {
      "name": "sprs_stat_requests",
      "return": "int64_t",
      "csharp_return": "long",
      "args": [
        {
          "name": "s",
          "type": "const sprs_t*",
          "csharp_type": "IntPtr"
        }
      ]
    },
    {
      "name": "sprs_stat_bytes_fetched",
      "return": "int64_t",
      "csharp_return": "long",
      "args": [
        {
          "name": "s",
          "type": "const sprs_t*",
          "csharp_type": "IntPtr"
        }
      ]
    },
    {
      "name": "sprs_stat_bytes_delivered",
      "return": "int64_t",
      "csharp_return": "long",
      "args": [
        {
          "name": "s",
          "type": "const sprs_t*",
          "csharp_type": "IntPtr"
        }
      ]
    },
    {
      "name": "sprs_stat_bytes_discarded",
      "return": "int64_t",
      "csharp_return": "long",
      "args": [
        {
          "name": "s",
          "type": "const sprs_t*",
          "csharp_type": "IntPtr"
        }
      ]
    },
    {
      "name": "sprs_stat_cache_hits",
      "return": "int64_t",
      "csharp_return": "long",
      "args": [
        {
          "name": "s",
          "type": "const sprs_t*",
          "csharp_type": "IntPtr"
        }
      ]
    },
    {
      "name": "sprs_stat_cache_misses",
      "return": "int64_t",
      "csharp_return": "long",
      "args": [
        {
          "name": "s",
          "type": "const sprs_t*",
          "csharp_type": "IntPtr"
        }
      ]
    },
    {
      "name": "sprs_stat_reopens",
      "return": "int64_t",
      "csharp_return": "long",
      "args": [
        {
          "name": "s",
          "type": "const sprs_t*",
          "csharp_type": "IntPtr"
        }
      ]
    },
    {
      "name": "sprs_stat_reset",
      "return": "void",
      "csharp_return": "void",
      "args": [
        {
          "name": "s",
          "type": "sprs_t*",
          "csharp_type": "IntPtr"
        }
      ]
    },
    {
      "name": "sprs_last_http_code",
      "return": "int",
      "csharp_return": "int",
      "args": [
        {
          "name": "s",
          "type": "const sprs_t*",
          "csharp_type": "IntPtr"
        }
      ]
    },
    {
      "name": "sprs_last_error",
      "return": "int",
      "csharp_return": "int",
      "args": [
        {
          "name": "s",
          "type": "const sprs_t*",
          "csharp_type": "IntPtr"
        }
      ]
    },
    {
      "name": "sprs_strerror",
      "return": "const char*",
      "csharp_return": "IntPtr",
      "args": [
        {
          "name": "err",
          "type": "int",
          "csharp_type": "int"
        }
      ]
    },
    {
      "name": "sprs_last_error_msg",
      "return": "const char*",
      "csharp_return": "IntPtr",
      "args": [
        {
          "name": "s",
          "type": "const sprs_t*",
          "csharp_type": "IntPtr"
        }
      ]
    },
    {
      "name": "sprs_result_json",
      "return": "const char*",
      "csharp_return": "IntPtr",
      "args": [
        {
          "name": "s",
          "type": "sprs_t*",
          "csharp_type": "IntPtr"
        }
      ]
    },
    {
      "name": "sprs_warning_count",
      "return": "int",
      "csharp_return": "int",
      "args": [
        {
          "name": "s",
          "type": "const sprs_t*",
          "csharp_type": "IntPtr"
        }
      ]
    },
    {
      "name": "sprs_warning",
      "return": "const char*",
      "csharp_return": "IntPtr",
      "args": [
        {
          "name": "s",
          "type": "const sprs_t*",
          "csharp_type": "IntPtr"
        },
        {
          "name": "i",
          "type": "int",
          "csharp_type": "int"
        }
      ]
    },
    {
      "name": "sprs_backend_fake",
      "return": "sprs_backend (by value)",
      "csharp_return": "sprsBackend",
      "args": [
        {
          "name": "data",
          "type": "const unsigned char*",
          "csharp_type": "byte[]"
        },
        {
          "name": "len",
          "type": "size_t",
          "csharp_type": "int"
        }
      ]
    },
    {
      "name": "sprs_backend_fake_mode",
      "return": "sprs_backend (by value)",
      "csharp_return": "sprsBackend",
      "args": [
        {
          "name": "data",
          "type": "const unsigned char*",
          "csharp_type": "byte[]"
        },
        {
          "name": "len",
          "type": "size_t",
          "csharp_type": "int"
        },
        {
          "name": "mode",
          "type": "int",
          "csharp_type": "int"
        }
      ]
    },
    {
      "name": "sprs_backend_fake_free",
      "return": "void",
      "csharp_return": "void",
      "args": [
        {
          "name": "be",
          "type": "sprs_backend*",
          "csharp_type": "ref sprsBackend"
        }
      ]
    }
  ]
}