⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mxml-private.c

📁 MINIXml 具有 解析、查找、生成、遍历 功能,一般不是太复杂的应用足够了。可贵的是全部实现是标准c,移植很容易。
💻 C
字号:
/* * "$Id: mxml-private.c 225 2005-08-16 14:46:18Z mike $" * * Private functions for Mini-XML, a small XML-like file parsing library. * * Copyright 2003-2005 by Michael Sweet. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2, or (at your option) any later version. * * This program 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. * * Contents: * *   mxml_error()      - Display an error message. *   mxml_integer_cb() - Default callback for integer values. *   mxml_opaque_cb()  - Default callback for opaque values. *   mxml_real_cb()    - Default callback for real number values. *//* * Include necessary headers... */#include "config.h"#include "mxml.h"/* * Error callback function... */void	(*mxml_error_cb)(const char *) = NULL;/* * 'mxml_error()' - Display an error message. */voidmxml_error(const char *format,		/* I - Printf-style format string */           ...)				/* I - Additional arguments as needed */{  va_list	ap;			/* Pointer to arguments */  char		s[1024];		/* Message string */ /*  * Range check input...  */  if (!format)    return; /*  * Format the error message string...  */  va_start(ap, format);  vsnprintf(s, sizeof(s), format, ap);  va_end(ap); /*  * And then display the error message...  */  if (mxml_error_cb)    (*mxml_error_cb)(s);  else    fprintf(stderr, "mxml: %s\n", s);}/* * 'mxml_ignore_cb()' - Default callback for ignored values. */mxml_type_t				/* O - Node type */mxml_ignore_cb(mxml_node_t *node)	/* I - Current node */{  (void)node;  return (MXML_IGNORE);}/* * 'mxml_integer_cb()' - Default callback for integer values. */mxml_type_t				/* O - Node type */mxml_integer_cb(mxml_node_t *node)	/* I - Current node */{  (void)node;  return (MXML_INTEGER);}/* * 'mxml_opaque_cb()' - Default callback for opaque values. */mxml_type_t				/* O - Node type */mxml_opaque_cb(mxml_node_t *node)	/* I - Current node */{  (void)node;  return (MXML_OPAQUE);}/* * 'mxml_real_cb()' - Default callback for real number values. */mxml_type_t				/* O - Node type */mxml_real_cb(mxml_node_t *node)		/* I - Current node */{  (void)node;  return (MXML_REAL);}/* * End of "$Id: mxml-private.c 225 2005-08-16 14:46:18Z mike $". */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -