Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes14kdownloads
header.h68 linesDownload Raw Back to snowball
1/*-------------------------------------------------------------------------2 *3 * header.h4 *		Replacement header file for Snowball stemmer modules5 *6 * The Snowball stemmer modules do #include "header.h", and think they7 * are including snowball/libstemmer/header.h.  We adjust the CPPFLAGS8 * so that this file is found instead, and thereby we can modify the9 * headers they see.  The main point here is to ensure that pg_config.h10 * is included before any system headers such as <stdio.h>; without that,11 * we have portability issues on some platforms due to variation in12 * largefile options across different modules in the backend.13 *14 * NOTE: this file should not be included into any non-snowball sources!15 *16 * Portions Copyright (c) 1996-2023, PostgreSQL Global Development Group17 *18 * src/include/snowball/header.h19 *20 *-------------------------------------------------------------------------21 */22#ifndef SNOWBALL_HEADR_H23#define SNOWBALL_HEADR_H24 25/*26 * It's against Postgres coding conventions to include postgres.h in a27 * header file, but we allow the violation here because the alternative is28 * to modify the machine-generated .c files provided by the Snowball project.29 */30#include "postgres.h"31 32/* Some platforms define MAXINT and/or MININT, causing conflicts */33#ifdef MAXINT34#undef MAXINT35#endif36#ifdef MININT37#undef MININT38#endif39 40/* Now we can include the original Snowball header.h */41#include "snowball/libstemmer/header.h" /* pgrminclude ignore */42 43/*44 * Redefine standard memory allocation interface to pgsql's one.45 * This allows us to control where the Snowball code allocates stuff.46 */47#ifdef malloc48#undef malloc49#endif50#define malloc(a)		palloc(a)51 52#ifdef calloc53#undef calloc54#endif55#define calloc(a,b)		palloc0((a) * (b))56 57#ifdef realloc58#undef realloc59#endif60#define realloc(a,b)	repalloc(a,b)61 62#ifdef free63#undef free64#endif65#define free(a)			pfree(a)66 67#endif							/* SNOWBALL_HEADR_H */68 
codekingpro/portable-devtools · Team Ai