head	1.1;
branch	1.1.1;
access;
symbols
	netbsd-11:1.1.1.1.0.2
	libXfont2-2-0-8:1.1.1.1
	xorg:1.1.1;
locks; strict;
comment	@ * @;


1.1
date	2026.07.08.08.08.05;	author mrg;	state Exp;
branches
	1.1.1.1;
next	;
commitid	7VdJyWSkIgj0cPMG;

1.1.1.1
date	2026.07.08.08.08.05;	author mrg;	state Exp;
branches
	1.1.1.1.2.1;
next	;
commitid	7VdJyWSkIgj0cPMG;

1.1.1.1.2.1
date	2026.07.08.08.08.05;	author martin;	state dead;
branches;
next	1.1.1.1.2.2;
commitid	TjCsKikLRsNeSfOG;

1.1.1.1.2.2
date	2026.07.19.11.16.00;	author martin;	state Exp;
branches;
next	;
commitid	TjCsKikLRsNeSfOG;


desc
@@


1.1
log
@Initial revision
@
text
@/*
 * Common helpers for PCF security regression tests.
 *
 * Copyright (c) 2026, Red Hat, Inc.
 *
 * Permission is hereby granted, free of charge, to any person obtaining a
 * copy of this software and associated documentation files (the "Software"),
 * to deal in the Software without restriction, including without limitation
 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
 * and/or sell copies of the Software, and to permit persons to whom the
 * Software is furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice (including the next
 * paragraph) shall be included in all copies or substantial portions of the
 * Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
 * DEALINGS IN THE SOFTWARE.
 */

#ifndef PCF_TEST_COMMON_H
#define PCF_TEST_COMMON_H

#include "utils/font-test-utils.h"

/*
 * Initialize libXfont2 and return the FPE function table.
 * Stores result in *fpe_function_count.
 */
xfont2_fpe_funcs_rec const **
pcf_test_init(int *fpe_function_count);

/*
 * Load a pre-built font directory, attempt to open the given XLFD,
 * and verify no crash occurs.
 *
 * Returns 0 on success (no crash), 1 on failure.
 */
int
pcf_test_open_font(xfont2_fpe_funcs_rec const **fpe_functions,
                   const char *test_name,
                   const char *font_dir,
                   const char *xlfd);

#endif /* PCF_TEST_COMMON_H */
@


1.1.1.1
log
@initial import of libXfont2-2.0.8
@
text
@@


1.1.1.1.2.1
log
@file pcf-test-common.h was added on branch netbsd-11 on 2026-07-19 11:16:00 +0000
@
text
@d1 50
@


1.1.1.1.2.2
log
@Pull up the following, requested by mrg in ticket #378:

	xsrc/external/mit/libXfont2/dist/test/gen_evil_pcf_bitmapscale.py up to 1.1.1.1
	xsrc/external/mit/libXfont2/dist/test/gen_evil_pcf_encoding.py up to 1.1.1.1
	xsrc/external/mit/libXfont2/dist/test/gen_evil_pcf_norepad.py up to 1.1.1.1
	xsrc/external/mit/libXfont2/dist/test/gen_evil_pcf_props.py up to 1.1.1.1
	xsrc/external/mit/libXfont2/dist/test/gen_evil_pcf_repad.py up to 1.1.1.1
	xsrc/external/mit/libXfont2/dist/test/pcf-test-common.c up to 1.1.1.1
	xsrc/external/mit/libXfont2/dist/test/pcf-test-common.h up to 1.1.1.1
	xsrc/external/mit/libXfont2/dist/test/test-pcf-bitmapscale.c up to 1.1.1.1
	xsrc/external/mit/libXfont2/dist/test/test-pcf-encoding.c up to 1.1.1.1
	xsrc/external/mit/libXfont2/dist/test/test-pcf-norepad.c up to 1.1.1.1
	xsrc/external/mit/libXfont2/dist/test/test-pcf-props.c up to 1.1.1.1
	xsrc/external/mit/libXfont2/dist/test/test-pcf-repad.c up to 1.1.1.1
	xsrc/external/mit/libXfont2/dist/test-driver         up to 1.1.1.1
	xsrc/external/mit/libXfont2/dist/ChangeLog           up to 1.1.1.7
	xsrc/external/mit/libXfont2/dist/Makefile.am         up to 1.1.1.4
	xsrc/external/mit/libXfont2/dist/Makefile.in         up to 1.1.1.7
	xsrc/external/mit/libXfont2/dist/aclocal.m4          up to 1.1.1.7
	xsrc/external/mit/libXfont2/dist/compile             up to 1.1.1.4
	xsrc/external/mit/libXfont2/dist/config.guess        up to 1.1.1.5
	xsrc/external/mit/libXfont2/dist/config.h.in         up to 1.1.1.6
	xsrc/external/mit/libXfont2/dist/config.sub          up to 1.1.1.6
	xsrc/external/mit/libXfont2/dist/configure           up to 1.1.1.7
	xsrc/external/mit/libXfont2/dist/configure.ac        up to 1.1.1.7
	xsrc/external/mit/libXfont2/dist/depcomp             up to 1.1.1.4
	xsrc/external/mit/libXfont2/dist/install-sh          up to 1.1.1.5
	xsrc/external/mit/libXfont2/dist/ltmain.sh           up to 1.1.1.6
	xsrc/external/mit/libXfont2/dist/missing             up to 1.1.1.4
	xsrc/external/mit/libXfont2/dist/doc/Makefile.in     up to 1.1.1.7
	xsrc/external/mit/libXfont2/dist/include/X11/fonts/bdfint.h up to 1.1.1.2
	xsrc/external/mit/libXfont2/dist/m4/libtool.m4       up to 1.1.1.2
	xsrc/external/mit/libXfont2/dist/m4/ltoptions.m4     up to 1.1.1.2
	xsrc/external/mit/libXfont2/dist/m4/ltsugar.m4       up to 1.1.1.2
	xsrc/external/mit/libXfont2/dist/m4/ltversion.m4     up to 1.1.1.2
	xsrc/external/mit/libXfont2/dist/m4/lt~obsolete.m4   up to 1.1.1.2
	xsrc/external/mit/libXfont2/dist/src/FreeType/ftenc.c up to 1.1.1.3
	xsrc/external/mit/libXfont2/dist/src/bitmap/bdfread.c up to 1.1.1.4
	xsrc/external/mit/libXfont2/dist/src/bitmap/pcfread.c up to 1.1.1.5
	xsrc/external/mit/libXfont2/dist/src/builtins/render.c up to 1.1.1.2
	xsrc/external/mit/libXfont2/dist/src/fc/fsio.c       up to 1.1.1.3
	xsrc/external/mit/libXfont2/dist/test/utils/font-test-utils.c up to 1.1.1.4

Import latest libXfont2
@
text
@a0 50
/*
 * Common helpers for PCF security regression tests.
 *
 * Copyright (c) 2026, Red Hat, Inc.
 *
 * Permission is hereby granted, free of charge, to any person obtaining a
 * copy of this software and associated documentation files (the "Software"),
 * to deal in the Software without restriction, including without limitation
 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
 * and/or sell copies of the Software, and to permit persons to whom the
 * Software is furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice (including the next
 * paragraph) shall be included in all copies or substantial portions of the
 * Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
 * DEALINGS IN THE SOFTWARE.
 */

#ifndef PCF_TEST_COMMON_H
#define PCF_TEST_COMMON_H

#include "utils/font-test-utils.h"

/*
 * Initialize libXfont2 and return the FPE function table.
 * Stores result in *fpe_function_count.
 */
xfont2_fpe_funcs_rec const **
pcf_test_init(int *fpe_function_count);

/*
 * Load a pre-built font directory, attempt to open the given XLFD,
 * and verify no crash occurs.
 *
 * Returns 0 on success (no crash), 1 on failure.
 */
int
pcf_test_open_font(xfont2_fpe_funcs_rec const **fpe_functions,
                   const char *test_name,
                   const char *font_dir,
                   const char *xlfd);

#endif /* PCF_TEST_COMMON_H */
@


