{
  "name": "scorpiox-pdfmerge",
  "version": "1.0.3",
  "exports": [
    {
      "name": "pdfmerge_init",
      "return": "int",
      "csharp_return": "int",
      "args": [],
      "note": "Returns 1."
    },
    {
      "name": "pdfmerge_cleanup",
      "return": "void",
      "csharp_return": "void",
      "args": [],
      "note": "Clears the error buffer."
    },
    {
      "name": "pdfmerge_files",
      "return": "int",
      "csharp_return": "int",
      "args": [
        {
          "name": "input_paths",
          "type": "const char**",
          "csharp_type": "string[]",
          "marshal": "UnmanagedType.LPUTF8Str",
          "note": "Array of file paths, concatenated in order."
        },
        {
          "name": "count",
          "type": "int",
          "csharp_type": "int",
          "note": "Number of paths (>= 1)."
        },
        {
          "name": "output_path",
          "type": "const char*",
          "csharp_type": "string",
          "marshal": "UnmanagedType.LPUTF8Str"
        }
      ],
      "note": "Returns 0 on success, non-zero on failure."
    },
    {
      "name": "pdfmerge_two",
      "return": "int",
      "csharp_return": "int",
      "args": [
        {
          "name": "pdf1",
          "type": "const char*",
          "csharp_type": "string",
          "marshal": "UnmanagedType.LPUTF8Str"
        },
        {
          "name": "pdf2",
          "type": "const char*",
          "csharp_type": "string",
          "marshal": "UnmanagedType.LPUTF8Str"
        },
        {
          "name": "output_path",
          "type": "const char*",
          "csharp_type": "string",
          "marshal": "UnmanagedType.LPUTF8Str"
        }
      ],
      "note": "pdf1 pages first, then pdf2. Returns 0 on success, non-zero on failure."
    },
    {
      "name": "pdfmerge_append",
      "return": "int",
      "csharp_return": "int",
      "args": [
        {
          "name": "base_pdf",
          "type": "const char*",
          "csharp_type": "string",
          "marshal": "UnmanagedType.LPUTF8Str"
        },
        {
          "name": "append_pdf",
          "type": "const char*",
          "csharp_type": "string",
          "marshal": "UnmanagedType.LPUTF8Str"
        },
        {
          "name": "output_path",
          "type": "const char*",
          "csharp_type": "string",
          "marshal": "UnmanagedType.LPUTF8Str"
        }
      ],
      "note": "Output = base pages followed by append pages; inputs are never modified. Returns 0 on success."
    },
    {
      "name": "pdfmerge_page_count",
      "return": "int",
      "csharp_return": "int",
      "args": [
        {
          "name": "pdf_path",
          "type": "const char*",
          "csharp_type": "string",
          "marshal": "UnmanagedType.LPUTF8Str"
        }
      ],
      "note": "Returns page count (>= 0) on success, or -1 on failure."
    },
    {
      "name": "pdfmerge_last_error",
      "return": "const char*",
      "csharp_return": "IntPtr",
      "args": [],
      "note": "Static buffer, valid until next call. Marshal as IntPtr + PtrToStringAnsi (Linux .NET 9 string-return marshaling bug)."
    }
  ]
}
