亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? api.c

?? 下載來的一個看圖軟件的源代碼
?? C
?? 第 1 頁 / 共 2 頁
字號:
/* libwmf (api/api.c): library for wmf conversion   Copyright (C) 2000 - various; see CREDITS, ChangeLog, and sources   The libwmf Library 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 of the   License, or (at your option) any later version.   The libwmf Library 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   Library General Public License for more details.   You should have received a copy of the GNU Library General Public   License along with the libwmf Library; see the file COPYING.  If not,   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,   Boston, MA 02111-1307, USA.  */#ifdef HAVE_CONFIG_H#include "wmfconfig.h"#endif /* HAVE_CONFIG_H */#include <stdio.h>#include <stdlib.h>#include <string.h>#include "wmfdefs.h"#include "api/api.h"/** * Creates and initializes an instance of the \b libwmf library for a specified device layer. *  * @param API_return pointer to a wmfAPI* (the API handle use henceforth) * @param flags      bitwise OR of WMF_OPT_ options * @param options    pointer to wmfAPI_Options structure *  * This is the first and necessary step when using \b libwmf. Options are passed via the wmfAPI_Options * structure and \p flags. wmf_api_create allocates the wmfAPI structure and initializes the color and * font tables, the metafile player, and the device layer. If successful then the pointer to the wmfAPI * structure is returned via \p API_return, otherwise all allocated memory is released and the library * exits with an appropriate error. *  * @return The error state of the library: \b wmf_E_None indicates successful creation and initialization *         of the library, and \p *API_return will be non-zero. For any other error value \p *API_return *         will be zero. */wmf_error_t wmf_api_create (wmfAPI** API_return,unsigned long flags,wmfAPI_Options* options){	wmfAPI* API = 0;	wmfMemoryManager* MM = 0;	wmf_error_t err = wmf_E_None;	(*API_return) = 0;	if (flags & WMF_OPT_ARGS) wmf_arg (&flags,options);/* Initialize memory management array & allocate */	if (flags & WMF_OPT_ALLOC)	{	MM = (wmfMemoryManager*) options->malloc (options->context,sizeof (wmfMemoryManager));	}	else	{	MM = (wmfMemoryManager*) malloc (sizeof (wmfMemoryManager));	}	if (MM == 0)	{	if ((flags & WMF_OPT_NO_ERROR) == 0)		{	fputs ("wmf_api_create: insufficient memory!\n",stderr);		}		return (wmf_E_InsMem);	}	MM->count = 0;	MM->max = 32;	if (flags & WMF_OPT_ALLOC)	{	MM->list = (void**) options->malloc (options->context,MM->max * sizeof (void*));	}	else	{	MM->list = (void**) malloc (MM->max * sizeof (void*));	}	if (MM->list == 0)	{	if ((flags & WMF_OPT_NO_ERROR) == 0)		{	fputs ("wmf_api_create: insufficient memory!\n",stderr);		}		if (flags & WMF_OPT_ALLOC)		{	options->free (options->context,MM);		}		else		{	free (MM);		}		return (wmf_E_InsMem);	}	if (flags & WMF_OPT_ALLOC)	{	MM->context = options->context;		MM->malloc  = options->malloc;		MM->realloc = options->realloc;		MM->free    = options->free;	}	else	{	MM->context = 0;		MM->malloc  = 0;		MM->realloc = 0;		MM->free    = 0;	}/* Allocate wmfAPI structure */	if (flags & WMF_OPT_ALLOC)	{	API = (wmfAPI*) options->malloc (options->context,sizeof (wmfAPI));	}	else	{	API = (wmfAPI*) malloc (sizeof (wmfAPI));	}	if (API == 0)	{	if ((flags & WMF_OPT_NO_ERROR) == 0)		{	fputs ("wmf_api_create: insufficient memory!\n",stderr);		}		if (flags & WMF_OPT_ALLOC)		{	options->free (options->context,MM->list);			options->free (options->context,MM);		}		else		{	free (MM->list);			free (MM);		}		return (wmf_E_InsMem);	}	API->memory_data = (void*) MM;/* Initialize debug, error & other streams */	if (flags & WMF_OPT_NO_DEBUG) API->debug_out = 0;	else	{	if (flags & WMF_OPT_LOG_DEBUG) API->debug_out = options->debug_out;		else		{			API->debug_out = stdout;		}	}	if (flags & WMF_OPT_NO_ERROR) API->error_out = 0;	else	{	if (flags & WMF_OPT_LOG_ERROR) API->error_out = options->error_out;		else		{			API->error_out = stderr;		}	}	API->MetaHeader.pmh = &(API->PlaceableMetaHeader);	API->MetaHeader.wmfheader = &(API->Head);	API->File = &(API->MetaHeader);	API->File->filein = 0; /* Input stream: file (unused) */	API->buffer_data = 0;  /* Input stream */	API->bbuf.read = 0;	API->bbuf.seek = 0;	API->bbuf.tell = 0;/* Status function & context */	API->status.context = 0;	API->status.function = 0;/* General purpose string buffer */	API->string_buffer.length = 0;	API->string_buffer.buffer = 0;/* Zero some unset pointers  */	API->function_reference = 0;	API->font_data = 0;	API->fonts = 0;	API->color_data = 0;/* Library error state: */	API->err = wmf_E_None;/* Finally: flags, etc. */	API->flags = flags;/* ---- Henceforth all allocation to be done via api ---- *//* Initialize string buffer */	API->string_buffer.length = 64;	API->string_buffer.buffer = wmf_malloc (API,API->string_buffer.length * sizeof (char));	if (ERR (API))	{	WMF_DEBUG (API,"bailing...");		err = wmf_api_destroy (API);		return (err);	}/* Create color data - must be done prior to IPA initialization */	wmf_ipa_color_init (API);	if (ERR (API))	{	WMF_DEBUG (API,"bailing...");		err = wmf_api_destroy (API);		return (err);	}/* Create ipa function interface */	API->function_reference = wmf_malloc (API,sizeof (wmfFunctionReference));	if (ERR (API))	{	WMF_DEBUG (API,"bailing...");		err = wmf_api_destroy (API);		return (err);	}/* Create ipa-device data */	if (flags & WMF_OPT_FUNCTION)	{	options->function (API);	}	else if (flags & WMF_OPT_MODULE) /* TODO... TODO... TODO... */	{	WMF_ERROR (API,"libwmf: module interface not implemented yet...");		WMF_ERROR (API,"        unable to initialize device layer!");		API->err = wmf_E_Glitch;	}	else	{	WMF_ERROR (API,"libwmf: unable to initialize device layer!");		API->err = wmf_E_Glitch;	}	if (ERR (API))	{	WMF_DEBUG (API,"bailing...");		err = wmf_api_destroy (API);		return (err);	}/* Create font data */	wmf_ipa_font_init (API,options);	wmf_arg_fontdirs (API,options);	if (ERR (API))	{	WMF_DEBUG (API,"bailing...");		err = wmf_api_destroy (API);		return (err);	}/* Create player data */	wmf_player_init (API);	if (ERR (API))	{	WMF_DEBUG (API,"bailing...");		err = wmf_api_destroy (API);		return (err);	}/* Have successfully created the API... */	(*API_return) = API;	return (wmf_E_None);}/** * Close the device layer, if open, and release all allocated memory attached to the memory manager. *  * @param API the API handle *  * @return The final error state of the library. */wmf_error_t wmf_api_destroy (wmfAPI* API) /* Basically free all alloced memory */{	wmf_error_t err;                  /* associated with the API */	wmfMemoryManager*     MM = (wmfMemoryManager*)     API->memory_data;	wmfFunctionReference* FR = (wmfFunctionReference*) API->function_reference;	wmfFontData*          FD = (wmfFontData*)          API->font_data;	if (FR)	{	/* FR->device_close must be the first action of wmf_api_destroy in case		 * FR->device_close decides, for whatever reason, to re-play the meta file		 * or to acquire API resources...		 */		if ((API->flags & API_DEVICE_OPEN) && FR->device_close) FR->device_close (API);	}	if (API->flags & API_FTLIBRARY_OPEN)	{	FT_Done_FreeType (FD->Library);	}	err = API->err;	while (MM->count)	{	MM->count--;		if (MM->free)		{	MM->free (MM->context,MM->list[MM->count]);		}		else		{	free (MM->list[MM->count]);		}	}	if (MM->free)	{	MM->free (MM->context,API);		MM->free (MM->context,MM->list);		MM->free (MM->context,MM);	}	else	{	free (API);		free (MM->list);		free (MM);	}	return (err);}/* ERROR & DEBUG Reporting * ======================= *//** * Set the error state of the library to wmf_E_Assert. *  * @param API  the API handle * @param file file name * @param line line number *  * This should only be called via the macro WMF_ASSERT(API,<expr>) which is defined (for debug builds only) * as: * @verbatim#define WMF_ASSERT(Z,M) if (!(M)) wmf_assert (Z,__FILE__,__LINE__)@endverbatim * i.e., if <expr> evaluates to 0 then call wmf_assert() with current file name and line number. */void wmf_assert (wmfAPI* API,char* file,int line){	wmf_error (API,file,line,"Assertion failed!");	API->err = wmf_E_Assert;}/** * Print message to error stream. *  * @param API  the API handle * @param file file name * @param line line number * @param msg  message to print *  * This should only be called via the macro WMF_ERROR(API,msg) which calls wmf_error() with the current file * name and line number. */void wmf_error (wmfAPI* API,char* file,int line,char* msg){	if (API->error_out == 0) return;	fprintf (API->error_out,"ERROR: %s (%d): %s\n",file,line,msg);	fflush (API->error_out);}/** * Print message to debug stream. *  * @param API  the API handle * @param file file name * @param line line number * @param msg  message to print *  * This should only be called via the macro WMF_DEBUG(API,msg) which (in debug builds only) calls * wmf_debug() with the current file name and line number. */void wmf_debug (wmfAPI* API,char* file,int line,char* msg){	if (API->debug_out == 0) return;	fprintf (API->debug_out,"%s (%d): %s\n",file,line,msg);	fflush (API->debug_out);}/** * Print formatted message to debug stream. *  * @param API the API handle * @param msg message to print *  * With syntax similar to printf(), wmf_printf() prints formatted output to the debug stream. */void wmf_printf (wmfAPI* API,char* msg,...){	va_list argp;	va_start (argp,msg);	if (API->debug_out)	{	vfprintf (API->debug_out,msg,argp);		fflush (API->debug_out);	}	va_end (argp);}/* Memory management interface * =========================== *//** * Allocate memory of specified size and attach to the API's memory manager's internal list. *  * @param API  the API handle * @param size size in bytes of memory required *  * With syntax similar to malloc(), wmf_malloc() allocates \p size bytes of memory and adds a reference to * it in the memory manager's list. To free the memory, use wmf_free(). *  * @return Pointer to new memory, or zero on failure. *         Sets error state \b wmf_E_InsMem on failure. */void* wmf_malloc (wmfAPI* API,size_t size){	wmfMemoryManager* MM = (wmfMemoryManager*) API->memory_data;	void*  mem = 0;	void** more = 0;	if (size == 0)	{	WMF_DEBUG (API,"wmf_[*]alloc: attempt to allocate zero-sized memory!");		return (0);	}	if (MM->count == MM->max)	{	if (MM->realloc)		{	more = (void**) MM->realloc (MM->context,MM->list,(MM->max+32) * sizeof (void*));		}		else		{	more = (void**) realloc (MM->list,(MM->max+32) * sizeof (void*));

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
成人欧美一区二区三区白人| 午夜久久久久久| 亚洲男人天堂一区| 韩日av一区二区| 欧美日韩电影在线播放| 欧美激情一区二区在线| 日韩不卡在线观看日韩不卡视频| 成人一区二区三区视频在线观看 | 亚洲国产另类av| 国产成人啪午夜精品网站男同| 精品婷婷伊人一区三区三| 国产日韩欧美精品一区| 精品一区二区在线视频| 欧美一区二区视频在线观看| 亚洲一卡二卡三卡四卡 | 欧美96一区二区免费视频| 91麻豆成人久久精品二区三区| 国产午夜精品一区二区三区嫩草 | 69堂亚洲精品首页| 亚洲永久免费视频| 91免费看视频| 亚洲日本乱码在线观看| 成人av电影在线| 国产精品国产三级国产专播品爱网| 极品少妇一区二区| 久久综合五月天婷婷伊人| 蜜臀久久99精品久久久久宅男| 欧美日韩二区三区| 奇米色一区二区三区四区| 欧美一区日本一区韩国一区| 日本欧美在线观看| 欧美一区二区视频在线观看 | 欧美日本国产视频| 亚洲国产美国国产综合一区二区| 91久久免费观看| 亚洲电影一级片| 91.麻豆视频| 麻豆91在线播放| 久久久国产精品麻豆| 国产高清视频一区| 色婷婷av久久久久久久| 国产精品盗摄一区二区三区| www.亚洲人| 亚洲精品v日韩精品| 欧美日本韩国一区二区三区视频| 天天色 色综合| 精品国产一区二区三区四区四| 激情av综合网| 最新国产精品久久精品| 欧美视频一区二区在线观看| 欧美aa在线视频| 国产清纯白嫩初高生在线观看91 | 日韩一区在线免费观看| 欧美色大人视频| 久久99久久99小草精品免视看| 日本一区二区三区电影| 91美女片黄在线| 日本午夜一区二区| 国产精品午夜在线| 欧美在线观看一二区| 蜜桃精品视频在线| 亚洲婷婷综合久久一本伊一区| 欧美日韩一区二区在线视频| 国产在线精品一区二区三区不卡| 亚洲国产经典视频| 91精品国产综合久久久蜜臀粉嫩| 狠狠狠色丁香婷婷综合久久五月| 亚洲精品中文在线| 欧美精品一区视频| 欧美午夜影院一区| 大白屁股一区二区视频| 亚洲成人免费电影| 国产精品剧情在线亚洲| 3d动漫精品啪啪一区二区竹菊 | 亚洲国产精品自拍| 久久久青草青青国产亚洲免观| 91福利资源站| 国产成人一区二区精品非洲| 亚洲妇熟xx妇色黄| 国产精品国产三级国产普通话三级 | 石原莉奈在线亚洲二区| 国产午夜精品一区二区三区嫩草| 欧美日韩综合不卡| 成人sese在线| 国产在线精品视频| 天天综合天天综合色| 国产精品国产三级国产aⅴ无密码| 欧美一区二区三区在线观看视频| av色综合久久天堂av综合| 国产一区免费电影| 日韩av午夜在线观看| 一区二区三区在线影院| 中文字幕精品一区二区精品绿巨人| 日韩三级在线免费观看| 欧美色网站导航| 色婷婷国产精品久久包臀| 成人涩涩免费视频| 国产精品一区二区在线播放| 日本视频一区二区三区| 婷婷激情综合网| 亚洲午夜影视影院在线观看| 国产精品麻豆欧美日韩ww| 久久精品在线免费观看| 精品国产伦一区二区三区免费| 884aa四虎影成人精品一区| 欧美在线免费播放| 精品视频全国免费看| 欧美午夜寂寞影院| 欧洲国内综合视频| 欧美亚洲高清一区二区三区不卡| 丰满少妇在线播放bd日韩电影| 狠狠色狠狠色综合| 国产美女av一区二区三区| 精品一区二区精品| 国产激情精品久久久第一区二区| 韩国三级中文字幕hd久久精品| 久久99精品国产麻豆婷婷| 加勒比av一区二区| 国产**成人网毛片九色 | 国内精品免费在线观看| 国产在线精品一区二区不卡了| 国产永久精品大片wwwapp| 国产美女av一区二区三区| 丁香另类激情小说| jvid福利写真一区二区三区| 99精品国产99久久久久久白柏| 一本色道亚洲精品aⅴ| 欧美在线小视频| 91精品国产综合久久久久久| 欧美一级欧美三级在线观看 | 国产乱子轮精品视频| 国产馆精品极品| 91影视在线播放| 欧美另类videos死尸| 欧美变态tickle挠乳网站| 国产亚洲精品7777| 一区二区三区在线看| 婷婷六月综合亚洲| 国产主播一区二区三区| 91免费版在线看| 欧美日韩国产精品自在自线| 精品福利二区三区| 亚洲欧美色一区| 久久精品999| 波多野结衣一区二区三区 | 午夜精品一区二区三区免费视频 | 亚洲精品大片www| 久色婷婷小香蕉久久| av色综合久久天堂av综合| 欧美精品1区2区| 中文一区二区在线观看| 亚洲6080在线| 成人精品电影在线观看| 亚洲天堂成人网| 蜜臀av性久久久久av蜜臀妖精| 欧美一区午夜视频在线观看| 国产欧美日韩视频一区二区| 亚洲18女电影在线观看| 成人h动漫精品一区二| 日韩免费性生活视频播放| 亚洲人成网站在线| 国产曰批免费观看久久久| 欧美日韩精品专区| 国产精品国产三级国产普通话蜜臀| 日产国产欧美视频一区精品| 91丨porny丨首页| wwww国产精品欧美| 日韩高清在线不卡| 色一情一乱一乱一91av| 国产亚洲一区字幕| 蜜臀av性久久久久蜜臀av麻豆| 91福利国产精品| 中文字幕二三区不卡| 精品一区二区三区久久久| 欧美日韩在线精品一区二区三区激情| 久久久精品影视| 久久激五月天综合精品| 欧美三级韩国三级日本三斤| 日韩理论电影院| 成人综合在线观看| 久久先锋影音av鲁色资源网| 日韩高清国产一区在线| 在线视频你懂得一区二区三区| 国产精品乱码一区二区三区软件| 精品一区二区三区在线观看| 555夜色666亚洲国产免| 亚洲chinese男男1069| 色国产综合视频| 一区二区三区四区视频精品免费| 成人一级黄色片| 国产精品免费视频网站| 国产成人综合网站| 国产欧美日本一区二区三区| 久久国产精品露脸对白| 精品久久人人做人人爽| 精一区二区三区| 久久精品一区八戒影视| 国产黄色精品网站| 中日韩免费视频中文字幕| 成人精品视频网站|