{
  "name": "scorpiox-pdfrepair",
  "version": "1.0.2",
  "exports": [
    {
      "name": "pdfrepair_init",
      "return": "int",
      "csharp_return": "int",
      "args": []
    },
    {
      "name": "pdfrepair_cleanup",
      "return": "void",
      "csharp_return": "void",
      "args": []
    },
    {
      "name": "pdfrepair_fix",
      "return": "int",
      "csharp_return": "int",
      "args": [
        {
          "name": "input_path",
          "type": "const char*",
          "csharp_type": "string",
          "marshal": "UnmanagedType.LPUTF8Str"
        },
        {
          "name": "output_path",
          "type": "const char*",
          "csharp_type": "string",
          "marshal": "UnmanagedType.LPUTF8Str"
        }
      ]
    },
    {
      "name": "pdfrepair_check",
      "return": "const char*",
      "csharp_return": "IntPtr",
      "args": [
        {
          "name": "input_path",
          "type": "const char*",
          "csharp_type": "string",
          "marshal": "UnmanagedType.LPUTF8Str"
        }
      ],
      "note": "Returns JSON from a static buffer, valid until the next call. On C# marshal as IntPtr + Marshal.PtrToStringAnsi \u2014 do NOT declare the P/Invoke return as string (Linux .NET 9 aborts: free(): invalid pointer)."
    },
    {
      "name": "pdfrepair_rebuild_xref",
      "return": "int",
      "csharp_return": "int",
      "args": [
        {
          "name": "input_path",
          "type": "const char*",
          "csharp_type": "string",
          "marshal": "UnmanagedType.LPUTF8Str"
        },
        {
          "name": "output_path",
          "type": "const char*",
          "csharp_type": "string",
          "marshal": "UnmanagedType.LPUTF8Str"
        }
      ]
    },
    {
      "name": "pdfrepair_last_error",
      "return": "const char*",
      "csharp_return": "IntPtr",
      "args": [],
      "note": "Static buffer, valid until the next call. Empty string when no error. On C# marshal as IntPtr + Marshal.PtrToStringAnsi."
    }
  ]
}