mirror of
https://github.com/kiwix/libkiwix.git
synced 2026-09-14 14:46:34 -04:00
Introduce a ContentOrigin struct and a resolveContentOrigin() helper that will let readOpds() take a single contentOriginUri parameter instead of separate urlHost/libraryPath ones. As a first step, wire readOpds()'s body to use resolveContentOrigin() to derive baseDir from libraryPath (replacing parseOpdsDom()'s internal removeLastPathElement() call), while urlHost is still passed through untouched. This is not yet functional as a single-parameter API: readOpds()'s public signature and callers are unchanged, and the urlHost side of resolveContentOrigin() isn't exercised yet. That follows in the next commit.
45 lines
1.4 KiB
C
45 lines
1.4 KiB
C
/*
|
|
* Copyright 2026 Hamazasp Avetisyan <hamik.avetisyan@gmail.com>
|
|
*
|
|
* This program is free software; you can redistribute it and/or
|
|
* modify it under the terms of the GNU General Public License as
|
|
* published by the Free Software Foundation; either version 2 of the
|
|
* License, or (at your option) any later version.
|
|
*
|
|
* This program is distributed in the hope that it will be useful, but
|
|
* is provided AS IS, WITHOUT ANY WARRANTY; without even the implied
|
|
* warranty of MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, and
|
|
* NON-INFRINGEMENT. See the GNU General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU General Public License
|
|
* along with this program; if not, write to the Free Software
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|
*
|
|
*/
|
|
|
|
#ifndef LIBKIWIX_PATH_TESTING_TOOLS_H
|
|
#define LIBKIWIX_PATH_TESTING_TOOLS_H
|
|
|
|
#ifdef _WIN32
|
|
# define S "\\"
|
|
# define AS "c:"
|
|
# define A_SAMBA "\\\\sambadir"
|
|
#else
|
|
# define S "/"
|
|
# define AS ""
|
|
#endif
|
|
|
|
#define P2(a, b) a S b
|
|
#define P3(a, b, c) P2(P2(a, b), c)
|
|
#define P4(a, b, c, d) P2(P3(a, b, c), d)
|
|
#define P5(a, b, c, d, e) P2(P4(a, b, c, d), e)
|
|
#define P6(a, b, c, d, e, f) P2(P5(a, b, c ,d, e), f)
|
|
|
|
#define A1(a) P2(AS,a)
|
|
#define A2(a, b) A1(P2(a, b))
|
|
#define A3(a, b, c) A1(P3(a, b, c))
|
|
#define A4(a, b, c, d) A1(P4(a, b, c, d))
|
|
#define A5(a, b, c, d, e) A1(P5(a, b, c, d, e))
|
|
|
|
#endif // LIBKIWIX_PATH_TESTING_TOOLS_H
|