XDG library path support for OCaml via Eio capabilities
linux macos ocaml xdg

relax constraint, add headers

+48 -4
+17 -1
.gitignore
··· 1 - _build 1 + # OCaml build artifacts 2 + _build/ 3 + *.install 4 + *.merlin 5 + 6 + # Third-party sources (fetch locally with opam source) 7 + third_party/ 8 + 9 + # Editor and OS files 10 + .DS_Store 11 + *.swp 12 + *~ 13 + .vscode/ 14 + .idea/ 15 + 16 + # Opam local switch 17 + _opam/
+2 -2
dune-project
··· 8 8 (authors "Anil Madhavapeddy") 9 9 (homepage "https://tangled.sh/@anil.recoil.org/xdge") 10 10 (maintainers "Anil Madhavapeddy <anil@recoil.org>") 11 - (bug_reports "https://tangled.sh/@anil.recoil.org/xgde/issues") 11 + (bug_reports "https://tangled.sh/@anil.recoil.org/xdge/issues") 12 12 (maintenance_intent "(latest)") 13 13 14 14 (package ··· 24 24 (ocaml (>= 5.1.0)) 25 25 (eio (>= 1.1)) 26 26 (cmdliner (>= 1.2.0)) 27 - (fmt (>= 0.11.0)) 27 + fmt 28 28 xdg 29 29 (eio_main :with-test) 30 30 (odoc :with-doc)
+5
lib/xdge.ml
··· 1 + (*--------------------------------------------------------------------------- 2 + Copyright (c) 2025 Anil Madhavapeddy <anil@recoil.org>. All rights reserved. 3 + SPDX-License-Identifier: ISC 4 + ---------------------------------------------------------------------------*) 5 + 1 6 type source = Default | Env of string | Cmdline 2 7 3 8 type t = {
+5
lib/xdge.mli
··· 1 + (*--------------------------------------------------------------------------- 2 + Copyright (c) 2025 Anil Madhavapeddy <anil@recoil.org>. All rights reserved. 3 + SPDX-License-Identifier: ISC 4 + ---------------------------------------------------------------------------*) 5 + 1 6 (** XDG Base Directory Specification support with Eio capabilities 2 7 3 8 This library provides an OCaml implementation of the XDG Base Directory
+5
test/test_paths.ml
··· 1 + (*--------------------------------------------------------------------------- 2 + Copyright (c) 2025 Anil Madhavapeddy <anil@recoil.org>. All rights reserved. 3 + SPDX-License-Identifier: ISC 4 + ---------------------------------------------------------------------------*) 5 + 1 6 let test_path_validation () = 2 7 Printf.printf "Testing XDG path validation...\n"; 3 8 (* Test absolute path validation for environment variables *)
+4
test/test_paths.mli
··· 1 + (*--------------------------------------------------------------------------- 2 + Copyright (c) 2025 Anil Madhavapeddy <anil@recoil.org>. All rights reserved. 3 + SPDX-License-Identifier: ISC 4 + ---------------------------------------------------------------------------*)
+5
test/xdg_example.ml
··· 1 + (*--------------------------------------------------------------------------- 2 + Copyright (c) 2025 Anil Madhavapeddy <anil@recoil.org>. All rights reserved. 3 + SPDX-License-Identifier: ISC 4 + ---------------------------------------------------------------------------*) 5 + 1 6 let run (xdg, cfg) = 2 7 Fmt.pr "%a@.%a@.@.%a@.%a@." 3 8 Fmt.(styled `Bold string)
+4
test/xdg_example.mli
··· 1 + (*--------------------------------------------------------------------------- 2 + Copyright (c) 2025 Anil Madhavapeddy <anil@recoil.org>. All rights reserved. 3 + SPDX-License-Identifier: ISC 4 + ---------------------------------------------------------------------------*)
+1 -1
xdge.opam
··· 7 7 authors: ["Anil Madhavapeddy"] 8 8 license: "ISC" 9 9 homepage: "https://tangled.sh/@anil.recoil.org/xdge" 10 - bug-reports: "https://tangled.sh/@anil.recoil.org/xgde/issues" 10 + bug-reports: "https://tangled.sh/@anil.recoil.org/xdge/issues" 11 11 depends: [ 12 12 "dune" {>= "3.20"} 13 13 "ocaml" {>= "5.1.0"}