#!/bin/sh

# Copyright © 2009-2018 Jakub Wilk <jwilk@jwilk.net>
#
# This file is part of pdf2djvu.
#
# pdf2djvu is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# pdf2djvu is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# General Public License for more details.

set -e -u

exec > paths.hh
cat <<EOF
/* Automatically generated by $0. */

#ifndef PDF2DJVU_PATHS
#define PDF2DJVU_PATHS
namespace paths
{
EOF

while [ $# -gt 0 ]
do
  key="$1"
  value="$2"
  printf '  static const char %s[] = "%s";\n' "$key" "$value"
  shift 2
done

cat <<EOF
}
#endif
EOF
