亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区三区免费野_久草精品视频
亚洲国产综合人成综合网站| 亚洲欧美日韩电影| 欧美日韩国产色站一区二区三区| 成人激情综合网站| 成人免费视频caoporn| 韩国精品主播一区二区在线观看| 奇米影视一区二区三区| 美女爽到高潮91| 黄页视频在线91| 激情综合网av| 国产成人av网站| 成人一区二区视频| 99综合电影在线视频| bt欧美亚洲午夜电影天堂| proumb性欧美在线观看| 91碰在线视频| 91国偷自产一区二区开放时间 | 中文字幕亚洲区| 国产精品久久久久久久久免费相片| 中文字幕的久久| 亚洲欧洲国产日韩| 一区二区三区免费在线观看| 视频一区二区中文字幕| 久久国产麻豆精品| www.性欧美| 欧美日韩精品免费| 精品国产不卡一区二区三区| 亚洲国产成人在线| 午夜伊人狠狠久久| 国产一区福利在线| 91麻豆高清视频| 欧美日韩国产高清一区| 久久精品视频免费| 一区二区高清免费观看影视大全 | 欧美精品vⅰdeose4hd| 精品国产乱码久久久久久老虎 | 久久色在线视频| 亚洲视频资源在线| 麻豆国产精品官网| 成人av小说网| 欧美一区二区三区视频在线| 国产欧美视频一区二区| 香蕉乱码成人久久天堂爱免费| 韩国v欧美v日本v亚洲v| 色94色欧美sute亚洲13| 亚洲精品一区二区三区影院 | 久久久亚洲欧洲日产国码αv| 亚洲欧美另类久久久精品2019| 日韩电影在线观看网站| 99久久夜色精品国产网站| 欧美一区二区视频免费观看| 国产精品女上位| 国产主播一区二区三区| 欧美三级日韩三级国产三级| 国产精品五月天| 加勒比av一区二区| 欧美一区二区三区免费大片| 国产精品久久久久影院亚瑟| 国精产品一区一区三区mba桃花| 日本韩国一区二区三区视频| 国产精品萝li| 成人丝袜视频网| 久久久久99精品一区| 日韩成人免费看| 欧美理论片在线| 亚洲午夜电影网| 99久久久精品| 亚洲人成精品久久久久久| 日本在线不卡视频| 欧美性感一区二区三区| 中文字幕在线不卡视频| gogo大胆日本视频一区| 国产欧美精品一区| 国产一区二区三区免费播放| 日韩欧美国产成人一区二区| 亚洲第一搞黄网站| 欧美日韩dvd在线观看| 亚洲国产色一区| 欧美色视频在线| 五月天激情小说综合| 欧美日韩免费一区二区三区视频| 亚洲成人激情自拍| 91麻豆精品国产91久久久久| 日韩成人一区二区三区在线观看| 日韩欧美资源站| 韩国欧美一区二区| 国产色91在线| 一本一道综合狠狠老| 亚洲黄网站在线观看| 欧美日韩免费一区二区三区 | 国产偷国产偷精品高清尤物 | 一区二区三区四区蜜桃| 91久久香蕉国产日韩欧美9色| 亚洲综合色噜噜狠狠| 欧美男同性恋视频网站| 天堂av在线一区| 久久精品一区二区三区不卡| 91视频免费播放| 香蕉成人伊视频在线观看| 精品国产乱码久久久久久蜜臀| 成人丝袜视频网| 午夜精品在线看| 国产网站一区二区| 欧美日韩在线三区| 国产一区视频在线看| 亚洲欧洲成人av每日更新| 欧美日韩精品久久久| 激情丁香综合五月| 尤物av一区二区| 精品日韩欧美在线| 91美女蜜桃在线| 极品瑜伽女神91| 亚洲一区二区在线视频| 欧美r级电影在线观看| 色综合网色综合| 国产一区二区在线电影| 亚洲精品中文字幕在线观看| 欧美成人猛片aaaaaaa| 色综合天天综合网天天看片| 青青草成人在线观看| 国产精品毛片无遮挡高清| 777xxx欧美| 91片在线免费观看| 国产一区二区三区黄视频 | 国产精品毛片久久久久久| 日韩欧美在线网站| 欧美少妇一区二区| a美女胸又www黄视频久久| 激情文学综合丁香| 爽好多水快深点欧美视频| 欧美国产成人精品| 欧美一二三区在线| 99国产精品久久| 成人免费毛片嘿嘿连载视频| 日韩中文字幕不卡| 亚洲狠狠爱一区二区三区| 亚洲日本在线观看| 国产精品久久久久毛片软件| 精品日韩一区二区| 欧美电影免费提供在线观看| 在线电影一区二区三区| 9人人澡人人爽人人精品| 国产成人免费在线观看| 国产一区二三区| 极品少妇xxxx精品少妇| 另类的小说在线视频另类成人小视频在线| 亚洲婷婷在线视频| 国产精品看片你懂得| 中文字幕欧美区| 国产精品久久久久久久久免费丝袜| 精品久久久久香蕉网| 精品区一区二区| 日韩视频免费观看高清完整版在线观看 | 亚洲国产精品嫩草影院| 亚洲精品综合在线| 亚洲一区精品在线| 亚洲一区视频在线| 首页欧美精品中文字幕| 日韩成人av影视| 久久精品免费看| 韩国视频一区二区| 成人av资源下载| 91视频91自| 精品视频一区 二区 三区| 91精品国产综合久久福利 | 国内久久精品视频| 国产一区不卡在线| 顶级嫩模精品视频在线看| 成人午夜精品一区二区三区| av电影在线不卡| 欧美性大战久久久久久久| 在线观看一区日韩| 欧美一卡在线观看| 久久久国产一区二区三区四区小说 | 日本强好片久久久久久aaa| 蜜臀国产一区二区三区在线播放| 麻豆成人免费电影| 国产精品亚洲第一区在线暖暖韩国 | 中文字幕一区二区三中文字幕| 亚洲色图视频网站| 日本欧洲一区二区| 成人激情文学综合网| 欧美三级在线播放| 国产亚洲一区字幕| 一区二区三区在线看| 免费三级欧美电影| 91在线精品秘密一区二区| 欧美福利视频导航| 国产精品嫩草影院com| 亚洲一级在线观看| 成人毛片在线观看| 欧美精品三级日韩久久| 国产欧美日韩中文久久| 亚洲电影一级片| 成人美女在线视频| 日韩三级av在线播放| 亚洲欧美日韩久久| 国产综合久久久久久久久久久久| 色综合夜色一区| 中文在线一区二区|