• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ FT_ERR函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中FT_ERR函数的典型用法代码示例。如果您正苦于以下问题:C++ FT_ERR函数的具体用法?C++ FT_ERR怎么用?C++ FT_ERR使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了FT_ERR函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: getaddr

static int getaddr(char *node, char *service, void **addr,
                   size_t *len)
{
    struct addrinfo *ai;
    int ret;

    if (!node) {
        *addr = NULL;
        *len = 0;
        return 0;
    }

    ret = getaddrinfo(node, service, NULL, &ai);
    if (ret) {
        FT_ERR("getaddrinfo error %s\n", gai_strerror(ret));
        return ret;
    }

    if ((*addr = malloc(ai->ai_addrlen))) {
        memcpy(*addr, ai->ai_addr, ai->ai_addrlen);
        *len = (size_t)ai->ai_addrlen;
    } else {
        FT_ERR("addr allocation failed\n");
        ret = EAI_MEMORY;
    }

    freeaddrinfo(ai);
    return ret;
}
开发者ID:vspetrov,项目名称:fabtests,代码行数:29,代码来源:shared.c


示例2: check_address

static int check_address(struct fid *fid, const char *message)
{
	char buf1[BUFSIZ], buf2[BUFSIZ];
	union sockaddr_any tmp;
	size_t tmplen;
	const char *ep_addr, *addr_expected;
	int ret;

	memset(&tmp, 0, sizeof tmp);
	tmplen = sizeof tmp;
	ret = fi_getname(fid, &tmp, &tmplen);
	if (ret) {
		FT_PRINTERR("fi_getname", ret);
	}

	if (sockaddrcmp(&tmp, tmplen, &bound_addr, bound_addr_len)) {
		ep_addr = sockaddrstr(&tmp, tmplen, buf1, BUFSIZ);
		if (!ep_addr) {
			FT_ERR("Unable to get ep_addr as string!\n");
			return -FI_EINVAL;
		}

		addr_expected = sockaddrstr(&bound_addr, bound_addr_len, buf2, BUFSIZ);
		if (!addr_expected) {
			FT_ERR("Unable to get addr_expected as string!\n");
			return -FI_EINVAL;
		}

		FT_ERR("address changed after %s: got %s expected %s\n",
			message, ep_addr, addr_expected);
		return -FI_EINVAL;
	}

	return 0;
}
开发者ID:RajKamal2013,项目名称:fabtests,代码行数:35,代码来源:msg_sockets.c


示例3: server_listen

static int server_listen(size_t paramlen)
{
	size_t expected;
	uint32_t event;
	int ret;

	expected = paramlen + sizeof(*entry);
	memset(entry, 0, expected);

	ret = fi_eq_sread(eq, &event, entry, expected, -1, 0);
	if (ret != expected) {
		FT_PROCESS_EQ_ERR(ret, eq, "fi_eq_sread", "listen");
		return ret;
	}

	if (event != FI_CONNREQ) {
		FT_ERR("Unexpected CM event %d", event);
		return -FI_EOTHER;
	}

	ret = ft_check_buf(entry->data, paramlen);
	if (ret)
		return ret;

	fi = entry->info;

	return 0;
}
开发者ID:a-abraham,项目名称:fabtests-cray,代码行数:28,代码来源:cm_data.c


示例4: pfr_get_advance

  pfr_get_advance( FT_Face   pfrface,       /* PFR_Face */
                   FT_UInt   gindex,
                   FT_Pos   *anadvance )
  {
    PFR_Face  face  = (PFR_Face)pfrface;
    FT_Error  error = FT_ERR( Invalid_Argument );


    *anadvance = 0;

    if ( !gindex )
      goto Exit;

    gindex--;

    if ( face )
    {
      PFR_PhyFont  phys = &face->phy_font;


      if ( gindex < phys->num_chars )
      {
        *anadvance = phys->chars[gindex].advance;
        error      = FT_Err_Ok;
      }
    }

  Exit:
    return error;
  }
开发者ID:dmdware,项目名称:vec,代码行数:30,代码来源:pfrdrivr.c


示例5: FT_Set_Var_Blend_Coordinates

  FT_Set_Var_Blend_Coordinates( FT_Face    face,
                                FT_UInt    num_coords,
                                FT_Fixed*  coords )
  {
    FT_Error                 error;
    FT_Service_MultiMasters  service;


    /* check of `face' delayed to `ft_face_get_mm_service' */

    if ( !coords )
      return FT_THROW( Invalid_Argument );

    error = ft_face_get_mm_service( face, &service );
    if ( !error )
    {
      error = FT_ERR( Invalid_Argument );
      if ( service->set_mm_blend )
        error = service->set_mm_blend( face, num_coords, coords );
    }

    /* enforce recomputation of auto-hinting data */
    if ( !error && face->autohint.finalizer )
    {
      face->autohint.finalizer( face->autohint.data );
      face->autohint.data = NULL;
    }

    return error;
  }
开发者ID:LumaDigital,项目名称:AtomicGameEngine,代码行数:30,代码来源:ftmm.c


示例6: FT_Get_BDF_Charset_ID

  FT_Get_BDF_Charset_ID( FT_Face       face,
                         const char*  *acharset_encoding,
                         const char*  *acharset_registry )
  {
    FT_Error     error;
    const char*  encoding = NULL;
    const char*  registry = NULL;


    error = FT_ERR( Invalid_Argument );

    if ( face )
    {
      FT_Service_BDF  service;


      FT_FACE_FIND_SERVICE( face, service, BDF );

      if ( service && service->get_charset_id )
        error = service->get_charset_id( face, &encoding, &registry );
    }

    if ( acharset_encoding )
      *acharset_encoding = encoding;

    if ( acharset_registry )
      *acharset_registry = registry;

    return error;
  }
开发者ID:WHS-TechOps,项目名称:Aviator,代码行数:30,代码来源:ftbdf.c


示例7: FT_Get_CID_Registry_Ordering_Supplement

  FT_Get_CID_Registry_Ordering_Supplement( FT_Face       face,
                                           const char*  *registry,
                                           const char*  *ordering,
                                           FT_Int       *supplement)
  {
    FT_Error     error;
    const char*  r = NULL;
    const char*  o = NULL;
    FT_Int       s = 0;


    error = FT_ERR( Invalid_Argument );

    if ( face )
    {
      FT_Service_CID  service;


      FT_FACE_FIND_SERVICE( face, service, CID );

      if ( service && service->get_ros )
        error = service->get_ros( face, &r, &o, &s );
    }

    if ( registry )
      *registry = r;

    if ( ordering )
      *ordering = o;

    if ( supplement )
      *supplement = s;

    return error;
  }
开发者ID:151706061,项目名称:PDFium,代码行数:35,代码来源:ftcid.c


示例8: ft_face_get_mm_service

  static FT_Error
  ft_face_get_mm_service( FT_Face                   face,
                          FT_Service_MultiMasters  *aservice )
  {
    FT_Error  error;


    *aservice = NULL;

    if ( !face )
      return FT_THROW( Invalid_Face_Handle );

    error = FT_ERR( Invalid_Argument );

    if ( FT_HAS_MULTIPLE_MASTERS( face ) )
    {
      FT_FACE_LOOKUP_SERVICE( face,
                              *aservice,
                              MULTI_MASTERS );

      if ( *aservice )
        error = FT_Err_Ok;
    }

    return error;
  }
开发者ID:AaronNGray,项目名称:texlive-libs,代码行数:26,代码来源:ftmm.c


示例9: ft_post_rma

ssize_t ft_post_rma(enum ft_rma_opcodes op, struct fid_ep *ep, size_t size,
		struct fi_rma_iov *remote, void *context)
{
	switch (op) {
	case FT_RMA_WRITE:
		FT_POST(fi_write, ft_get_tx_comp, tx_seq, "fi_write", ep, tx_buf,
				opts.transfer_size, fi_mr_desc(mr), remote_fi_addr,
				remote->addr, remote->key, context);
		break;
	case FT_RMA_WRITEDATA:
		FT_POST(fi_writedata, ft_get_tx_comp, tx_seq, "fi_writedata", ep,
				tx_buf, opts.transfer_size, fi_mr_desc(mr),
				remote_cq_data,	remote_fi_addr,	remote->addr,
				remote->key, context);
		break;
	case FT_RMA_READ:
		FT_POST(fi_read, ft_get_tx_comp, tx_seq, "fi_read", ep, rx_buf,
				opts.transfer_size, fi_mr_desc(mr), remote_fi_addr,
				remote->addr, remote->key, context);
		break;
	default:
		FT_ERR("Unknown RMA op type\n");
		return EXIT_FAILURE;
	}

	return 0;
}
开发者ID:a-abraham,项目名称:fabtests-cray,代码行数:27,代码来源:shared.c


示例10: tt_property_set

  /*
   *  PROPERTY SERVICE
   *
   */
  static FT_Error
  tt_property_set( FT_Module    module,         /* TT_Driver */
                   const char*  property_name,
                   const void*  value )
  {
    FT_Error   error  = FT_Err_Ok;
    TT_Driver  driver = (TT_Driver)module;


    if ( !ft_strcmp( property_name, "interpreter-version" ) )
    {
      FT_UInt*  interpreter_version = (FT_UInt*)value;


#ifndef TT_CONFIG_OPTION_SUBPIXEL_HINTING
      if ( *interpreter_version != TT_INTERPRETER_VERSION_35 )
        error = FT_ERR( Unimplemented_Feature );
      else
#endif
        driver->interpreter_version = *interpreter_version;

      return error;
    }

    FT_TRACE0(( "tt_property_set: missing property `%s'\n",
                property_name ));
    return FT_THROW( Missing_Property );
  }
开发者ID:WHS-TechOps,项目名称:Aviator,代码行数:32,代码来源:ttdriver.c


示例11: client_expect_accept

static int client_expect_accept(size_t paramlen)
{
	size_t expected;
	uint32_t event;
	int ret;

	expected = paramlen + sizeof(*entry);

	ret = client_connect(paramlen);
	if (ret) {
		FT_PRINTERR("fi_connect", ret);
		return ret;
	}

	ret = fi_eq_sread(eq, &event, entry, expected, -1, 0);
	if (ret != expected) {
		FT_PROCESS_EQ_ERR(ret, eq, "fi_eq_sread", "connect");
		return ret;
	}

	if (event != FI_CONNECTED || entry->fid != &ep->fid) {
		FT_ERR("Unexpected CM event %d fid %p (ep %p)", event,
				entry->fid, ep);
		return -FI_EOTHER;
	}

	/* Check data on FI_CONNECTED event. */
	ret = ft_check_buf(entry->data, paramlen);
	if (ret)
		return ret;

	fi_shutdown(ep, 0);
	return read_shutdown_event();
}
开发者ID:gbtitus,项目名称:libfabric,代码行数:34,代码来源:cm_data.c


示例12: tt_property_set

/*
 *  PROPERTY SERVICE
 *
 */
static FT_Error
tt_property_set( FT_Module    module,         /* TT_Driver */
                 const char*  property_name,
                 const void*  value,
                 FT_Bool      value_is_string )
{
    FT_Error   error  = FT_Err_Ok;
    TT_Driver  driver = (TT_Driver)module;

#ifndef FT_CONFIG_OPTION_ENVIRONMENT_PROPERTIES
    FT_UNUSED( value_is_string );
#endif


    if ( !ft_strcmp( property_name, "interpreter-version" ) )
    {
        FT_UInt  interpreter_version;


#ifdef FT_CONFIG_OPTION_ENVIRONMENT_PROPERTIES
        if ( value_is_string )
        {
            const char*  s = (const char*)value;


            interpreter_version = (FT_UInt)ft_strtol( s, NULL, 10 );
        }
        else
#endif
        {
            FT_UInt*  iv = (FT_UInt*)value;


            interpreter_version = *iv;
        }

        if ( interpreter_version == TT_INTERPRETER_VERSION_35
#ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY
                || interpreter_version == TT_INTERPRETER_VERSION_38
#endif
#ifdef TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL
                || interpreter_version == TT_INTERPRETER_VERSION_40
#endif
           )
            driver->interpreter_version = interpreter_version;
        else
            error = FT_ERR( Unimplemented_Feature );

        return error;
    }

    FT_TRACE0(( "tt_property_set: missing property `%s'\n",
                property_name ));
    return FT_THROW( Missing_Property );
}
开发者ID:android,项目名称:platform_external_freetype,代码行数:59,代码来源:ttdriver.c


示例13: dupaddr

static int dupaddr(void **dst_addr, size_t *dst_addrlen,
		void *src_addr, size_t src_addrlen)
{
	*dst_addr = malloc(src_addrlen);
	if (!*dst_addr) {
		FT_ERR("address allocation failed");
		return EAI_MEMORY;
	}
	*dst_addrlen = src_addrlen;
	memcpy(*dst_addr, src_addr, src_addrlen);
	return 0;
}
开发者ID:arsmith10,项目名称:fabtests,代码行数:12,代码来源:shared.c


示例14: FT_New_Face_From_FSSpec

  FT_New_Face_From_FSSpec( FT_Library     library,
                           const FSSpec*  spec,
                           FT_Long        face_index,
                           FT_Face*       aface )
  {

#if HAVE_FSREF

    FSRef  ref;


    if ( !spec || FSpMakeFSRef( spec, &ref ) != noErr )
      return FT_THROW( Invalid_Argument );
    else
      return FT_New_Face_From_FSRef( library, &ref, face_index, aface );

#elif HAVE_FSSPEC

    FT_Error      error;
    FT_Open_Args  args;
    OSErr         err;
    UInt8         pathname[PATH_MAX];


    if ( !spec )
      return FT_THROW( Invalid_Argument );

    err = FT_FSpMakePath( spec, pathname, sizeof ( pathname ) );
    if ( err )
      error = FT_ERR( Cannot_Open_Resource );

    error = FT_New_Face_From_Resource( library, pathname, face_index, aface );
    if ( error || *aface )
      return error;

    /* fallback to datafork font */
    args.flags    = FT_OPEN_PATHNAME;
    args.pathname = (char*)pathname;
    return FT_Open_Face( library, &args, face_index, aface );

#else

    FT_UNUSED( library );
    FT_UNUSED( spec );
    FT_UNUSED( face_index );
    FT_UNUSED( aface );

    return FT_THROW( Unimplemented_Feature );

#endif /* HAVE_FSREF, HAVE_FSSPEC */

  }
开发者ID:Wafflespeanut,项目名称:gecko-dev,代码行数:52,代码来源:ftmac.c


示例15: ft_comp_x

static int ft_comp_x(struct fid_cq *cq, struct ft_xcontrol *ft_x,
		const char *x_str, int timeout)
{
	uint8_t buf[FT_COMP_BUF_SIZE];
	struct timespec s, e;
	int poll_time = 0;
	int ret;

	switch(test_info.cq_wait_obj) {
	case FI_WAIT_NONE:
		do {
			if (!poll_time)
				clock_gettime(CLOCK_MONOTONIC, &s);

			ft_cq_read(fi_cq_read, cq, buf, comp_entry_cnt[ft_x->cq_format],
					ft_x->credits, x_str, ret);

			clock_gettime(CLOCK_MONOTONIC, &e);
			poll_time = get_elapsed(&s, &e, MILLI);
		} while (ret == -FI_EAGAIN && poll_time < timeout);

		break;
	case FI_WAIT_UNSPEC:
	case FI_WAIT_FD:
	case FI_WAIT_MUTEX_COND:
		ft_cq_read(fi_cq_sread, cq, buf, comp_entry_cnt[ft_x->cq_format],
			ft_x->credits, x_str, ret, NULL, timeout);
		break;
	case FI_WAIT_SET:
		FT_ERR("fi_ubertest: Unsupported cq wait object");
		return -1;
	default:
		FT_ERR("Unknown cq wait object");
		return -1;
	}

	return (ret == -FI_EAGAIN && timeout) ? ret : 0;
}
开发者ID:a-abraham,项目名称:fabtests-cray,代码行数:38,代码来源:ft_comp.c


示例16: FTC_Manager_RegisterCache

  FTC_Manager_RegisterCache( FTC_Manager      manager,
                             FTC_CacheClass   clazz,
                             FTC_Cache       *acache )
  {
    FT_Error   error = FT_ERR( Invalid_Argument );
    FTC_Cache  cache = NULL;


    if ( manager && clazz && acache )
    {
      FT_Memory  memory = manager->memory;


      if ( manager->num_caches >= FTC_MAX_CACHES )
      {
        error = FT_THROW( Too_Many_Caches );
        FT_ERROR(( "FTC_Manager_RegisterCache:"
                   " too many registered caches\n" ));
        goto Exit;
      }

      if ( !FT_ALLOC( cache, clazz->cache_size ) )
      {
        cache->manager   = manager;
        cache->memory    = memory;
        cache->clazz     = clazz[0];
        cache->org_class = clazz;

        /* THIS IS VERY IMPORTANT!  IT WILL WRETCH THE MANAGER */
        /* IF IT IS NOT SET CORRECTLY                          */
        cache->index = manager->num_caches;

        error = clazz->cache_init( cache );
        if ( error )
        {
          clazz->cache_done( cache );
          FT_FREE( cache );
          goto Exit;
        }

        manager->caches[manager->num_caches++] = cache;
      }
    }

  Exit:
    if ( acache )
      *acache = cache;
    return error;
  }
开发者ID:ImageMagick,项目名称:ttf,代码行数:49,代码来源:ftcmanag.c


示例17: ft_get_tx_comp

int ft_get_tx_comp(uint64_t total)
{
	int ret;

	if (txcq) {
		ret = ft_get_cq_comp(txcq, &tx_cq_cntr, total, -1);
	} else if (txcntr) {
		ret = fi_cntr_wait(txcntr, total, -1);
		if (ret)
			FT_PRINTERR("fi_cntr_wait", ret);
	} else {
		FT_ERR("Trying to get a TX completion when no TX CQ or counter were opened");
		ret = -FI_EOTHER;
	}
	return ret;
}
开发者ID:arsmith10,项目名称:fabtests,代码行数:16,代码来源:shared.c


示例18: main

  int main( int    argc,
            char** argv )
  {
    FT_Library       library;
    FT_StreamRec     stream;
    FT_Error         error = FT_Err_Ok;
    AFM_FontInfoRec  fi;


    if ( argc < 2 )
      return FT_ERR( Invalid_Argument );

    error = FT_Init_FreeType( &library );
    if ( error )
      return error;

    FT_ZERO( &stream );
    error = FT_Stream_Open( &stream, argv[1] );
    if ( error )
      goto Exit;
    stream.memory = library->memory;

    FT_ZERO( &fi );
    error = parse_afm( library, &stream, &fi );

    if ( !error )
    {
      FT_Memory  memory = library->memory;


      dump_fontinfo( &fi );

      if ( fi.KernPairs )
        FT_FREE( fi.KernPairs );
      if ( fi.TrackKerns )
        FT_FREE( fi.TrackKerns );
    }
    else
      printf( "parse error\n" );

    FT_Stream_Close( &stream );

  Exit:
    FT_Done_FreeType( library );

    return error;
  }
开发者ID:litao1009,项目名称:SimpleRoom,代码行数:47,代码来源:test_afm.c


示例19: FT_Get_Sfnt_Name

  FT_Get_Sfnt_Name( FT_Face       face,
                    FT_UInt       idx,
                    FT_SfntName  *aname )
  {
    FT_Error  error = FT_ERR( Invalid_Argument );


    if ( aname && face && FT_IS_SFNT( face ) )
    {
      TT_Face  ttface = (TT_Face)face;


      if ( idx < (FT_UInt)ttface->num_names )
      {
        TT_NameEntryRec*  entry = ttface->name_table.names + idx;


        /* load name on demand */
        if ( entry->stringLength > 0 && entry->string == NULL )
        {
          FT_Memory  memory = face->memory;
          FT_Stream  stream = face->stream;


          if ( FT_NEW_ARRAY  ( entry->string, entry->stringLength ) ||
               FT_STREAM_SEEK( entry->stringOffset )                ||
               FT_STREAM_READ( entry->string, entry->stringLength ) )
          {
            FT_FREE( entry->string );
            entry->stringLength = 0;
          }
        }

        aname->platform_id = entry->platformID;
        aname->encoding_id = entry->encodingID;
        aname->language_id = entry->languageID;
        aname->name_id     = entry->nameID;
        aname->string      = (FT_Byte*)entry->string;
        aname->string_len  = entry->stringLength;

        error = FT_Err_Ok;
      }
    }

    return error;
  }
开发者ID:hamfirst,项目名称:StormBrewerEngine,代码行数:46,代码来源:ftsnames.c


示例20: FT_Get_MM_Var

  FT_Get_MM_Var( FT_Face      face,
                 FT_MM_Var*  *amaster )
  {
    FT_Error                 error;
    FT_Service_MultiMasters  service;


    error = ft_face_get_mm_service( face, &service );
    if ( !error )
    {
      error = FT_ERR( Invalid_Argument );
      if ( service->get_mm_var )
        error = service->get_mm_var( face, amaster );
    }

    return error;
  }
开发者ID:03050903,项目名称:Urho3D,代码行数:17,代码来源:ftmm.c



注:本文中的FT_ERR函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ FT_ERROR函数代码示例发布时间:2022-05-30
下一篇:
C++ FT_Done_Size函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap