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

C++ LOOKUP函数代码示例

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

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



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

示例1: csAxisDrill

int csAxisDrill( char *operation, char *axis, char *surface )
{
   static LWCommandCode ccode;
   ModData *md = getModData();
   DynaValue argv[ 3 ];

   assert( md->edit == NULL );

   argv[ 0 ].type = DY_STRING;
   argv[ 0 ].str.buf = operation;
   argv[ 0 ].str.bufLen = 0;

   argv[ 1 ].type = DY_STRING;
   argv[ 1 ].str.buf = axis;
   argv[ 1 ].str.bufLen = 0;

   if ( surface ) {
      argv[ 2 ].type = DY_STRING;
      argv[ 2 ].str.buf = surface;
      argv[ 2 ].str.bufLen = 0;
   }
   else argv[ 2 ].type = DY_NULL;

   LOOKUP( "AXISDRILL" );
   EXECUTE( 3, argv );
   return OK;
}
开发者ID:DimondTheCat,项目名称:xray,代码行数:27,代码来源:tools.c


示例2: zlog_debug

static void
rip_auth_write_leading_rte
(
  struct stream *s,
  struct rip_interface *ri,
  const u_int8_t key_id,
  char *auth_str,
  u_int16_t main_body_len
)
{
  u_int8_t dlen;

  if (IS_RIP_DEBUG_AUTH)
    zlog_debug ("writing authentication header for %uB of main body", main_body_len);
  stream_putw (s, RIP_FAMILY_AUTH);
  switch (ri->auth_type)
  {
  case RIP_AUTH_SIMPLE_PASSWORD:
    {
      u_int8_t padded_simple_password[RIP_AUTH_SIMPLE_SIZE] = { 0 };
      memcpy (padded_simple_password, auth_str, MIN (RIP_AUTH_SIMPLE_SIZE, strlen (auth_str)));
      stream_putw (s, RIP_AUTH_SIMPLE_PASSWORD);
      stream_put (s, padded_simple_password, RIP_AUTH_SIMPLE_SIZE);
      break;
    }
  case RIP_AUTH_HASH:
    if (IS_RIP_DEBUG_AUTH)
      zlog_debug ("hash algorithm is '%s'", LOOKUP (hash_algo_str, ri->hash_algo));
    stream_putw (s, RIP_AUTH_HASH);
    stream_putw (s, main_body_len);
    stream_putc (s, key_id);
    switch (ri->hash_algo)
    {
    case HASH_KEYED_MD5:
      /* Auth Data Len.  Set 16 for MD5 authentication data. Older ripds
       * however expect RIP_HEADER_SIZE + HASH_SIZE_MD5 so we allow for this
       * to be configurable. */
      dlen = ri->md5_auth_len;
      break;
    case HASH_HMAC_SHA1:
    case HASH_HMAC_SHA256:
    case HASH_HMAC_SHA384:
    case HASH_HMAC_SHA512:
      dlen = hash_digest_length[ri->hash_algo];
      break;
    default:
      assert (0);
    }
    if (IS_RIP_DEBUG_AUTH)
      zlog_debug ("declared auth data length is %uB", dlen);
    stream_putc (s, dlen);
    stream_putl (s, time (NULL)); /* Sequence Number (non-decreasing). */
    stream_putl (s, 0); /* reserved, MBZ */
    stream_putl (s, 0); /* reserved, MBZ */
    break;
  default:
    assert (0);
  }
}
开发者ID:Quagga-RE,项目名称:wip-tcs-rfc6506,代码行数:59,代码来源:rip_auth.c


示例3: bgp_fsm_event_error

/* FSM error, unexpected event.  This is error of BGP connection. So cut the
   peer and change to Idle status. */
static int
bgp_fsm_event_error (struct peer *peer)
{
  plog_err (peer->log, "%s [FSM] unexpected packet received in state %s",
	    peer->host, LOOKUP (bgp_status_msg, peer->status));

  return bgp_stop_with_notify (peer, BGP_NOTIFY_FSM_ERR, 0);
}
开发者ID:LabNConsulting,项目名称:quagga-vnc,代码行数:10,代码来源:bgp_fsm.c


示例4: ism_change_callback

static void
ism_change_callback (struct in_addr ifaddr, struct in_addr area_id,
		     u_char state)
{
  printf ("ism_change: ifaddr: %s ", inet_ntoa (ifaddr));
  printf ("area_id: %s\n", inet_ntoa (area_id));
  printf ("state: %d [%s]\n", state, LOOKUP (ospf_ism_state_msg, state));
}
开发者ID:Addision,项目名称:LVS,代码行数:8,代码来源:ospfclient.c


示例5: real_slot_lookup

static inline struct objc_slot * real_slot_lookup(struct objc_object ** obj, uint32_t sel, id sender)
{
	id object = *obj;
	struct objc_slot * ret = NULL;
	do
	{
		if(LOOKUP(object))
		{
			return (*LOOKUP(object))(obj, object, sel, sender);
		}
		if(SLOTS(object))
		{
			ret = SparseArrayLookup(SLOTS(object), sel);
		}
		object = object->isa;
	} while(object != NULL && ret == NULL);
	return ret;
}
开发者ID:zc00gii,项目名称:O.Os,代码行数:18,代码来源:objc_object.c


示例6: nsm_change_callback

static void
nsm_change_callback (struct in_addr ifaddr, struct in_addr nbraddr,
		     struct in_addr router_id, u_char state)
{
  printf ("nsm_change: ifaddr: %s ", inet_ntoa (ifaddr));
  printf ("nbraddr: %s\n", inet_ntoa (nbraddr));
  printf ("router_id: %s\n", inet_ntoa (router_id));
  printf ("state: %d [%s]\n", state, LOOKUP (ospf_nsm_state_msg, state));
}
开发者ID:Addision,项目名称:LVS,代码行数:9,代码来源:ospfclient.c


示例7: rbtree_get

/* =============================================================================
 * rbtree_get
 * =============================================================================
 */
void*
rbtree_get (rbtree_t* r, void* key) {
    node_t* n = LOOKUP(r, key);
    if (n != NULL) {
        void* val = LDF(n, v);
        return val;
    }
    return NULL;
}
开发者ID:amohtasham,项目名称:rstm,代码行数:13,代码来源:rbtree.c


示例8: bgp_event

/* Execute event process. */
int
bgp_event (struct thread *thread)
{
  int ret = 0;
  int event;
  int next;
  struct peer *peer;

  peer = THREAD_ARG (thread);
  event = THREAD_VAL (thread);

  /* Logging this event. */
  next = FSM [peer->status -1][event - 1].next_state;

  if (BGP_DEBUG (fsm, FSM) && peer->status != next)
    plog_debug (peer->log, "%s [FSM] %s (%s->%s)", peer->host, 
	       bgp_event_str[event],
	       LOOKUP (bgp_status_msg, peer->status),
	       LOOKUP (bgp_status_msg, next));

  /* Call function. */
  if (FSM [peer->status -1][event - 1].func)
    ret = (*(FSM [peer->status - 1][event - 1].func))(peer);

  /* When function do not want proceed next job return -1. */
  if (ret >= 0)
    {
      /* If status is changed. */
      if (next != peer->status)
        {
          /* Transition into Clearing must /always/ clear all routes.. */
          if (next == Clearing)
            bgp_clear_route_all (peer);
          
          bgp_fsm_change_status (peer, next);
        }
      
      /* Make sure timer is set. */
      bgp_timer_set (peer);
    }
  
  return ret;
}
开发者ID:jameshilliard,项目名称:actiontec_opensrc_mi424wr-rev-e-f_fw-20-10-7-5,代码行数:44,代码来源:bgp_fsm.c


示例9: csSelInvert

int csSelInvert( void )
{
   static LWCommandCode ccode;
   ModData *md = getModData();

   assert( md->edit == NULL );

   LOOKUP( "SEL_INVERT" );
   EXECUTE( 0, NULL );
   return OK;
}
开发者ID:DimondTheCat,项目名称:xray,代码行数:11,代码来源:select.c


示例10: csSelUnhide

int csSelUnhide( void )
{
   static LWCommandCode ccode;
   ModData *md = getModData();

   assert( md->edit == NULL );

   LOOKUP( "SEL_UNHIDE" );
   EXECUTE( 0, NULL );
   return OK;
}
开发者ID:DimondTheCat,项目名称:xray,代码行数:11,代码来源:select.c


示例11: csMakeText

int csMakeText( char *text, int index, char *cornertype, double spacing,
   double scale, char *axis, double *pos )
{
   static LWCommandCode ccode;
   ModData *md = getModData();
   DynaValue argv[ 7 ];

   assert( md->edit == NULL );

   argv[ 0 ].type = DY_STRING;
   argv[ 0 ].str.buf = text;
   argv[ 0 ].str.bufLen = 0;

   argv[ 1 ].type = DY_INTEGER;
   argv[ 1 ].intv.value = index;

   if ( cornertype ) {
      argv[ 2 ].type = DY_STRING;
      argv[ 2 ].str.buf = cornertype;
      argv[ 2 ].str.bufLen = 0;
   }
   else argv[ 2 ].type = DY_NULL;

   if ( spacing != 0.0 ) {
      argv[ 3 ].type = DY_FLOAT;
      argv[ 3 ].flt.value = spacing;
   }
   else argv[ 3 ].type = DY_NULL;

   if ( scale != 0.0 ) {
      argv[ 4 ].type = DY_FLOAT;
      argv[ 4 ].flt.value = scale;
   }
   else argv[ 4 ].type = DY_NULL;

   if ( axis ) {
      argv[ 5 ].type = DY_STRING;
      argv[ 5 ].str.buf = axis;
      argv[ 5 ].str.bufLen = 0;
   }
   else argv[ 5 ].type = DY_NULL;

   if ( pos ) {
      argv[ 6 ].type = DY_VFLOAT;
      argv[ 6 ].fvec.val[ 0 ] = pos[ 0 ];
      argv[ 6 ].fvec.val[ 1 ] = pos[ 1 ];
      argv[ 6 ].fvec.val[ 2 ] = pos[ 2 ];
   }
   else argv[ 6 ].type = DY_NULL;

   LOOKUP( "MAKETEXT" );
   EXECUTE( 7, argv );
   return OK;
}
开发者ID:DimondTheCat,项目名称:xray,代码行数:54,代码来源:text.c


示例12: MCGetMsg

static MCMsgT *
MCGetMsg(MCSetT *set, int msgId)
{
	MCMsgT  *msg;
	int32_t    lo, hi, cur, dir;

	if (set == NULL || set->invalid || msgId <= 0)
		return (NULL);
	LOOKUP(set, msg, msgId, ntohl(set->numMsgs), u.msgs);
	return (msg);
}
开发者ID:010001111,项目名称:darling,代码行数:11,代码来源:msgcat.c


示例13: DEFINE_PROPERTYKEY

/*****************************************************************************
 * mmdevice.c : Windows Multimedia Device API audio output plugin for VLC
 *****************************************************************************
 * Copyright (C) 2012-2014 Rémi Denis-Courmont
 *
 * This program is free software; you can redistribute it and/or modify it
 * under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation; either version 2.1 of the License, 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 Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program; if not, write to the Free Software Foundation,
 * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
 *****************************************************************************/

#ifdef HAVE_CONFIG_H
# include <config.h>
#endif

#define INITGUID
#define COBJMACROS
#define CONST_VTABLE

#include <stdlib.h>
#include <math.h>
#include <assert.h>
#include <audiopolicy.h>
#include <mmdeviceapi.h>
#include <endpointvolume.h>

DEFINE_PROPERTYKEY(PKEY_Device_FriendlyName, 0xa45c254e, 0xdf1c, 0x4efd,
   0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 14);

#include <vlc_common.h>
#include <vlc_plugin.h>
#include <vlc_aout.h>
#include <vlc_charset.h>
#include <vlc_modules.h>
#include "audio_output/mmdevice.h"

#if (_WIN32_WINNT < 0x600)
static VOID WINAPI (*InitializeConditionVariable)(PCONDITION_VARIABLE);
static BOOL WINAPI (*SleepConditionVariableCS)(PCONDITION_VARIABLE,
                                               PCRITICAL_SECTION, DWORD);
static VOID WINAPI (*WakeConditionVariable)(PCONDITION_VARIABLE);
#define LOOKUP(s) \
    if (((s) = (void *)GetProcAddress(h, #s)) == NULL) return FALSE

BOOL WINAPI DllMain(HINSTANCE, DWORD, LPVOID); /* avoid warning */
BOOL WINAPI DllMain(HINSTANCE dll, DWORD reason, LPVOID reserved)
{
    (void) dll;
    (void) reserved;

    switch (reason)
    {
        case DLL_PROCESS_ATTACH:
        {
            HANDLE h = GetModuleHandle(TEXT("kernel32.dll"));
            if (unlikely(h == NULL))
                return FALSE;
            LOOKUP(InitializeConditionVariable);
            LOOKUP(SleepConditionVariableCS);
            LOOKUP(WakeConditionVariable);
            break;
        }
    }
    return TRUE;
}
开发者ID:ondravondra,项目名称:vlc,代码行数:74,代码来源:mmdevice.c


示例14: csInvertHide

int csInvertHide( void )
{
   static LWCommandCode ccode;
   ModData *md = getModData();

   assert( md->edit == NULL );

   LOOKUP( "INVERT_HIDE" );
   EXECUTE( 0, NULL );
   return OK;
}
开发者ID:DimondTheCat,项目名称:xray,代码行数:11,代码来源:select.c


示例15: findApiSymbols

static int findApiSymbols(void)
{
    HMODULE dll = NULL;

    #define LOOKUP_NOFALLBACK(x, reallyLook) \
        symLookup(dll, (PHYSFS_FARPROC *) &p##x, #x, reallyLook, NULL)

    #define LOOKUP(x, reallyLook) \
        symLookup(dll, (PHYSFS_FARPROC *) &p##x, #x, \
                  reallyLook, (PHYSFS_FARPROC) fallback##x)

    /* Apparently Win9x HAS the Unicode entry points, they just don't WORK. */
    /*  ...so don't look them up unless we're on NT+. (see osHasUnicode.) */

    dll = libUserEnv = LoadLibraryA("userenv.dll");
    if (dll != NULL)
        LOOKUP_NOFALLBACK(GetUserProfileDirectoryW, osHasUnicode);

    /* !!! FIXME: what do they call advapi32.dll on Win64? */
    dll = libAdvApi32 = LoadLibraryA("advapi32.dll");
    if (dll != NULL)
        LOOKUP(GetUserNameW, osHasUnicode);

    /* !!! FIXME: what do they call kernel32.dll on Win64? */
    dll = libKernel32 = LoadLibraryA("kernel32.dll");
    if (dll != NULL)
    {
        LOOKUP_NOFALLBACK(GetFileAttributesExA, 1);
        LOOKUP_NOFALLBACK(GetFileAttributesExW, osHasUnicode);
        LOOKUP_NOFALLBACK(FindFirstFileW, osHasUnicode);
        LOOKUP_NOFALLBACK(FindNextFileW, osHasUnicode);
        LOOKUP(GetModuleFileNameW, osHasUnicode);
        LOOKUP(FormatMessageW, osHasUnicode);
        LOOKUP(GetFileAttributesW, osHasUnicode);
        LOOKUP(GetCurrentDirectoryW, osHasUnicode);
        LOOKUP(CreateDirectoryW, osHasUnicode);
        LOOKUP(RemoveDirectoryW, osHasUnicode);
        LOOKUP(CreateFileW, osHasUnicode);
        LOOKUP(DeleteFileW, osHasUnicode);
    } /* if */

    #undef LOOKUP_NOFALLBACK
    #undef LOOKUP

    return(1);
} /* findApiSymbols */
开发者ID:ahrnbom,项目名称:physfs-uwp,代码行数:46,代码来源:windows.c


示例16: bgp_fsm_change_status

/* Called after event occured, this function change status and reset
   read/write and timer thread. */
void
bgp_fsm_change_status (struct peer *peer, int status)
{
  bgp_dump_state (peer, peer->status, status);

  /* Transition into Clearing or Deleted must /always/ clear all routes.. 
   * (and must do so before actually changing into Deleted..
   */
  if (status >= Clearing)
    bgp_clear_route_all (peer);
  
  /* Preserve old status and change into new status. */
  peer->ostatus = peer->status;
  peer->status = status;
  
  if (BGP_DEBUG (normal, NORMAL))
    zlog_debug ("%s went from %s to %s",
		peer->host,
		LOOKUP (bgp_status_msg, peer->ostatus),
		LOOKUP (bgp_status_msg, peer->status));
}
开发者ID:ahouston,项目名称:quagga-multiple,代码行数:23,代码来源:bgp_fsm.c


示例17: ospf_nsm_event

/* Execute NSM event process. */
int
ospf_nsm_event (struct thread *thread)
{
  int event;
  int next_state;
  struct ospf_neighbor *nbr;
  struct in_addr router_id;
  int old_state;
  struct ospf_interface *oi;

  nbr = THREAD_ARG (thread);
  event = THREAD_VAL (thread);
  router_id = nbr->router_id;

  old_state = nbr->state;
  oi = nbr->oi ;
  
  /* Call function. */
  next_state = (*(NSM [nbr->state][event].func))(nbr);

  /* When event is NSM_KillNbr or InactivityTimer, the neighbor is
     deleted. */
  if (event == NSM_KillNbr || event == NSM_InactivityTimer)
    {
      if (IS_DEBUG_OSPF (nsm, NSM_EVENTS))
	zlog_debug ("NSM[%s:%s]: neighbor deleted",
		   IF_NAME (oi), inet_ntoa (router_id));

      /* Timers are canceled in ospf_nbr_free, moreover we cannot call
         nsm_timer_set here because nbr is freed already!!!*/
      /*nsm_timer_set (nbr);*/

      return 0;
    }

  if (! next_state)
    next_state = NSM [nbr->state][event].next_state;

  if (IS_DEBUG_OSPF (nsm, NSM_EVENTS))
    zlog_debug ("NSM[%s:%s]: %s (%s)", IF_NAME (oi),
	       inet_ntoa (nbr->router_id),
	       LOOKUP (ospf_nsm_state_msg, nbr->state),
	       ospf_nsm_event_str [event]);
  
  /* If state is changed. */
  if (next_state != nbr->state)
    nsm_change_state (nbr, next_state);

  /* Make sure timer is set. */
  nsm_timer_set (nbr);

  return 0;
}
开发者ID:OPSF,项目名称:uClinux,代码行数:54,代码来源:ospf_nsm.c


示例18: MCGetSet

static MCSetT *
MCGetSet(MCCatT *cat, int setId)
{
	MCSetT  *set;
	int32_t    lo, hi, cur, dir;

	if (cat == NULL || setId <= 0)
		return (NULL);
	LOOKUP(cat, set, setId, cat->numSets, sets);
	if (set->invalid && loadSet(cat, set) <= 0)
		return (NULL);
	return (set);
}
开发者ID:010001111,项目名称:darling,代码行数:13,代码来源:msgcat.c


示例19: LOOKUP_R

ent* LOOKUP_R(ent* e, const char* fmt, ...) {
    char buf[128];

    va_list va;
    va_start(va, fmt);
    vprintf(buf, 128, fmt, va, false);
    va_end(va);

    vector* v = ksplit_to_vector(buf, "/");
    ent * ret = LOOKUP(e, v, 0);
    cleanup_vector(v);
    return ret;
}
开发者ID:capel,项目名称:brazos,代码行数:13,代码来源:ent.cpp


示例20: rbtree_delete

/* =============================================================================
 * rbtree_delete
 * -- Returns TRUE if key exists
 * =============================================================================
 */
bool_t
rbtree_delete (rbtree_t* r, void* key)
{
    node_t* node = NULL;
    node = LOOKUP(r, key);
    if (node != NULL) {
        node = DELETE(r, node);
    }
    if (node != NULL) {
        releaseNode(node);
    }
    return ((node != NULL) ? TRUE : FALSE);
}
开发者ID:amohtasham,项目名称:rstm,代码行数:18,代码来源:rbtree.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ LOOP函数代码示例发布时间:2022-05-30
下一篇:
C++ LONG_TO_PTR函数代码示例发布时间: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