chromium/third_party/fontconfig/src/src/fcformat.c

/*
 * Copyright © 2008,2009 Red Hat, Inc.
 *
 * Red Hat Author(s): Behdad Esfahbod
 *
 * Permission to use, copy, modify, distribute, and sell this software and its
 * documentation for any purpose is hereby granted without fee, provided that
 * the above copyright notice appear in all copies and that both that
 * copyright notice and this permission notice appear in supporting
 * documentation, and that the name of the author(s) not be used in
 * advertising or publicity pertaining to distribution of the software without
 * specific, written prior permission.  The authors make no
 * representations about the suitability of this software for any purpose.  It
 * is provided "as is" without express or implied warranty.
 *
 * THE AUTHOR(S) DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
 * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
 * EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY SPECIAL, INDIRECT OR
 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
 * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 * PERFORMANCE OF THIS SOFTWARE.
 */

#include "fcint.h"
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>


/* The language is documented in doc/fcformat.fncs
 * These are the features implemented:
 *
 * simple	%{elt}
 * width	%width{elt}
 * index	%{elt[idx]}
 * name=	%{elt=}
 * :name=	%{:elt}
 * default	%{elt:-word}
 * count	%{#elt}
 * subexpr	%{{expr}}
 * filter-out	%{-elt1,elt2,elt3{expr}}
 * filter-in	%{+elt1,elt2,elt3{expr}}
 * conditional	%{?elt1,elt2,!elt3{}{}}
 * enumerate	%{[]elt1,elt2{expr}}
 * langset	langset enumeration using the same syntax
 * builtin	%{=blt}
 * convert	%{elt|conv1|conv2|conv3}
 *
 * converters:
 * basename	FcStrBasename
 * dirname	FcStrDirname
 * downcase	FcStrDowncase
 * shescape
 * cescape
 * xmlescape
 * delete	delete chars
 * escape	escape chars
 * translate	translate chars
 *
 * builtins:
 * unparse	FcNameUnparse
 * fcmatch	fc-match default
 * fclist	fc-list default
 * fccat	fc-cat default
 * pkgkit	PackageKit package tag format
 *
 *
 * Some ideas for future syntax extensions:
 *
 * - verbose builtin that is like FcPatternPrint
 * - allow indexing subexprs using '%{[idx]elt1,elt2{subexpr}}'
 * - allow indexing in +, -, ? filtering?
 * - conditional/filtering/deletion on binding (using '(w)'/'(s)'/'(=)' notation)
 */


#define FCCAT_FORMAT
#define FCMATCH_FORMAT
#define FCLIST_FORMAT
#define PKGKIT_FORMAT


static void
message (const char *fmt, ...)
{}


FcFormatContext;

static FcBool
FcFormatContextInit (FcFormatContext *c,
		     const FcChar8   *format,
		     FcChar8         *scratch,
		     int              scratch_len)
{}

static void
FcFormatContextDone (FcFormatContext *c)
{}

static FcBool
consume_char (FcFormatContext *c,
	      FcChar8          term)
{}

static FcBool
expect_char (FcFormatContext *c,
	      FcChar8          term)
{}

static FcBool
FcCharIsPunct (const FcChar8 c)
{}

static char escaped_char(const char ch)
{}

static FcBool
read_word (FcFormatContext *c)
{}

static FcBool
read_chars (FcFormatContext *c,
	    FcChar8          term)
{}

static FcBool
FcPatternFormatToBuf (FcPattern     *pat,
		      const FcChar8 *format,
		      FcStrBuf      *buf);

static FcBool
interpret_builtin (FcFormatContext *c,
		   FcPattern       *pat,
		   FcStrBuf        *buf)
{}

static FcBool
interpret_expr (FcFormatContext *c,
		FcPattern       *pat,
		FcStrBuf        *buf,
		FcChar8          term);

static FcBool
interpret_subexpr (FcFormatContext *c,
		   FcPattern       *pat,
		   FcStrBuf        *buf)
{}

static FcBool
maybe_interpret_subexpr (FcFormatContext *c,
			 FcPattern       *pat,
			 FcStrBuf        *buf)
{}

static FcBool
skip_subexpr (FcFormatContext *c);

static FcBool
skip_percent (FcFormatContext *c)
{}

static FcBool
skip_expr (FcFormatContext *c)
{}

static FcBool
skip_subexpr (FcFormatContext *c)
{}

static FcBool
maybe_skip_subexpr (FcFormatContext *c)
{}

static FcBool
interpret_filter_in (FcFormatContext *c,
		     FcPattern       *pat,
		     FcStrBuf        *buf)
{}

static FcBool
interpret_filter_out (FcFormatContext *c,
		      FcPattern       *pat,
		      FcStrBuf        *buf)
{}

static FcBool
interpret_cond (FcFormatContext *c,
		FcPattern       *pat,
		FcStrBuf        *buf)
{}

static FcBool
interpret_count (FcFormatContext *c,
		 FcPattern       *pat,
		 FcStrBuf        *buf)
{}

static FcBool
interpret_enumerate (FcFormatContext *c,
		     FcPattern       *pat,
		     FcStrBuf        *buf)
{}

static FcBool
interpret_simple (FcFormatContext *c,
		  FcPattern       *pat,
		  FcStrBuf        *buf)
{}

static FcBool
cescape (FcFormatContext *c FC_UNUSED,
	 const FcChar8   *str,
	 FcStrBuf        *buf)
{}

static FcBool
shescape (FcFormatContext *c FC_UNUSED,
	  const FcChar8   *str,
	  FcStrBuf        *buf)
{}

static FcBool
xmlescape (FcFormatContext *c FC_UNUSED,
	   const FcChar8   *str,
	   FcStrBuf        *buf)
{}

static FcBool
delete_chars (FcFormatContext *c,
	      const FcChar8   *str,
	      FcStrBuf        *buf)
{}

static FcBool
escape_chars (FcFormatContext *c,
	      const FcChar8   *str,
	      FcStrBuf        *buf)
{}

static FcBool
translate_chars (FcFormatContext *c,
		 const FcChar8   *str,
		 FcStrBuf        *buf)
{}

static FcBool
interpret_convert (FcFormatContext *c,
		   FcStrBuf        *buf,
		   int              start)
{}

static FcBool
maybe_interpret_converts (FcFormatContext *c,
			   FcStrBuf        *buf,
			   int              start)
{}

static FcBool
align_to_width (FcStrBuf *buf,
		int       start,
		int       width)
{}
static FcBool
interpret_percent (FcFormatContext *c,
		   FcPattern       *pat,
		   FcStrBuf        *buf)
{}

static FcBool
interpret_expr (FcFormatContext *c,
		FcPattern       *pat,
		FcStrBuf        *buf,
		FcChar8          term)
{}

static FcBool
FcPatternFormatToBuf (FcPattern     *pat,
		      const FcChar8 *format,
		      FcStrBuf      *buf)
{}

FcChar8 *
FcPatternFormat (FcPattern *pat,
		 const FcChar8 *format)
{}

#define __fcformat__
#include "fcaliastail.h"
#undef __fcformat__