{
  "name": "scorpiox-crontab",
  "version": "1.3.0",
  "description": "Pure C crontab engine \u2014 5-field cron parser, natural-language describer, next-run calculator, and background multi-job scheduler with process execution, stdout/stderr capture, JSON persistence, per-job run timeout and cancel, and per-job working folder + environment overrides. Powers the Personal Cron Server WinUI3 app. Exit-code contract: -2 = stopped by the job's timeout, -3 = stopped by Cancel.",
  "exports": [
    {
      "name": "crontab_version",
      "return": "const char*",
      "csharp_return": "IntPtr",
      "args": []
    },
    {
      "name": "crontab_validate_expr",
      "return": "int",
      "csharp_return": "int",
      "args": [
        {
          "name": "expr",
          "type": "const char*",
          "csharp_type": "string",
          "marshal": "UnmanagedType.LPUTF8Str"
        },
        {
          "name": "err_buf",
          "type": "char*",
          "csharp_type": "IntPtr"
        },
        {
          "name": "err_buf_len",
          "type": "int",
          "csharp_type": "int"
        }
      ]
    },
    {
      "name": "crontab_describe_expr",
      "return": "const char*",
      "csharp_return": "IntPtr",
      "args": [
        {
          "name": "expr",
          "type": "const char*",
          "csharp_type": "string",
          "marshal": "UnmanagedType.LPUTF8Str"
        }
      ]
    },
    {
      "name": "crontab_calc_next",
      "return": "int",
      "csharp_return": "int",
      "args": [
        {
          "name": "expr",
          "type": "const char*",
          "csharp_type": "string",
          "marshal": "UnmanagedType.LPUTF8Str"
        },
        {
          "name": "from_time",
          "type": "int64_t",
          "csharp_type": "long"
        },
        {
          "name": "next_time",
          "type": "int64_t*",
          "csharp_type": "out long"
        }
      ]
    },
    {
      "name": "crontab_get_next_runs_json",
      "return": "const char*",
      "csharp_return": "IntPtr",
      "args": [
        {
          "name": "expr",
          "type": "const char*",
          "csharp_type": "string",
          "marshal": "UnmanagedType.LPUTF8Str"
        },
        {
          "name": "count",
          "type": "int",
          "csharp_type": "int"
        }
      ]
    },
    {
      "name": "crontab_create",
      "return": "void*",
      "csharp_return": "IntPtr",
      "args": [
        {
          "name": "storage_dir",
          "type": "const char*",
          "csharp_type": "string",
          "marshal": "UnmanagedType.LPUTF8Str"
        }
      ]
    },
    {
      "name": "crontab_destroy",
      "return": "void",
      "csharp_return": "void",
      "args": [
        {
          "name": "handle",
          "type": "void*",
          "csharp_type": "IntPtr"
        }
      ]
    },
    {
      "name": "crontab_start",
      "return": "int",
      "csharp_return": "int",
      "args": [
        {
          "name": "handle",
          "type": "void*",
          "csharp_type": "IntPtr"
        }
      ]
    },
    {
      "name": "crontab_stop",
      "return": "int",
      "csharp_return": "int",
      "args": [
        {
          "name": "handle",
          "type": "void*",
          "csharp_type": "IntPtr"
        }
      ]
    },
    {
      "name": "crontab_is_running",
      "return": "int",
      "csharp_return": "int",
      "args": [
        {
          "name": "handle",
          "type": "void*",
          "csharp_type": "IntPtr"
        }
      ]
    },
    {
      "name": "crontab_add_job",
      "return": "int",
      "csharp_return": "int",
      "args": [
        {
          "name": "handle",
          "type": "void*",
          "csharp_type": "IntPtr"
        },
        {
          "name": "name",
          "type": "const char*",
          "csharp_type": "string",
          "marshal": "UnmanagedType.LPUTF8Str"
        },
        {
          "name": "expr",
          "type": "const char*",
          "csharp_type": "string",
          "marshal": "UnmanagedType.LPUTF8Str"
        },
        {
          "name": "cmd",
          "type": "const char*",
          "csharp_type": "string",
          "marshal": "UnmanagedType.LPUTF8Str"
        },
        {
          "name": "enabled",
          "type": "int",
          "csharp_type": "int"
        }
      ]
    },
    {
      "name": "crontab_update_job",
      "return": "int",
      "csharp_return": "int",
      "args": [
        {
          "name": "handle",
          "type": "void*",
          "csharp_type": "IntPtr"
        },
        {
          "name": "job_id",
          "type": "int",
          "csharp_type": "int"
        },
        {
          "name": "name",
          "type": "const char*",
          "csharp_type": "string",
          "marshal": "UnmanagedType.LPUTF8Str"
        },
        {
          "name": "expr",
          "type": "const char*",
          "csharp_type": "string",
          "marshal": "UnmanagedType.LPUTF8Str"
        },
        {
          "name": "cmd",
          "type": "const char*",
          "csharp_type": "string",
          "marshal": "UnmanagedType.LPUTF8Str"
        },
        {
          "name": "enabled",
          "type": "int",
          "csharp_type": "int"
        }
      ]
    },
    {
      "name": "crontab_delete_job",
      "return": "int",
      "csharp_return": "int",
      "args": [
        {
          "name": "handle",
          "type": "void*",
          "csharp_type": "IntPtr"
        },
        {
          "name": "job_id",
          "type": "int",
          "csharp_type": "int"
        }
      ]
    },
    {
      "name": "crontab_run_now",
      "return": "int",
      "csharp_return": "int",
      "args": [
        {
          "name": "handle",
          "type": "void*",
          "csharp_type": "IntPtr"
        },
        {
          "name": "job_id",
          "type": "int",
          "csharp_type": "int"
        }
      ]
    },
    {
      "name": "crontab_get_jobs_json",
      "return": "const char*",
      "csharp_return": "IntPtr",
      "args": [
        {
          "name": "handle",
          "type": "void*",
          "csharp_type": "IntPtr"
        }
      ]
    },
    {
      "name": "crontab_get_job_logs_json",
      "return": "const char*",
      "csharp_return": "IntPtr",
      "args": [
        {
          "name": "handle",
          "type": "void*",
          "csharp_type": "IntPtr"
        },
        {
          "name": "job_id",
          "type": "int",
          "csharp_type": "int"
        },
        {
          "name": "limit",
          "type": "int",
          "csharp_type": "int"
        }
      ]
    },
    {
      "name": "crontab_cancel_job",
      "return": "int",
      "csharp_return": "int",
      "args": [
        {
          "name": "handle",
          "type": "void*",
          "csharp_type": "IntPtr"
        },
        {
          "name": "job_id",
          "type": "int",
          "csharp_type": "int"
        }
      ]
    },
    {
      "name": "crontab_set_job_timeout",
      "return": "int",
      "csharp_return": "int",
      "args": [
        {
          "name": "handle",
          "type": "void*",
          "csharp_type": "IntPtr"
        },
        {
          "name": "job_id",
          "type": "int",
          "csharp_type": "int"
        },
        {
          "name": "max_runtime_sec",
          "type": "int",
          "csharp_type": "int"
        }
      ]
    },
    {
      "name": "crontab_set_job_paths",
      "return": "int",
      "csharp_return": "int",
      "added": "1.3.0",
      "notes": "C9. workdir '' = inherit (lpCurrentDirectory NULL). env = newline-separated KEY=VALUE layered on the parent environment. 0 ok, -1 unknown id, -2 workdir not an existing directory or an env line with no '='.",
      "args": [
        {
          "name": "handle",
          "type": "void*",
          "csharp_type": "IntPtr"
        },
        {
          "name": "job_id",
          "type": "int",
          "csharp_type": "int"
        },
        {
          "name": "workdir",
          "type": "const char*",
          "csharp_type": "string",
          "marshal": "UnmanagedType.LPUTF8Str"
        },
        {
          "name": "env",
          "type": "const char*",
          "csharp_type": "string",
          "marshal": "UnmanagedType.LPUTF8Str"
        }
      ]
    }
  ]
}