当前位置: 首页>>代码示例>>C++>>正文


C++ checkFieldInfo函数代码示例

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


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

示例1: FieldInfo__eq

WSLUA_METAMETHOD FieldInfo__eq(lua_State* L) {
    /* Checks whether lhs is within rhs */
    FieldInfo l = checkFieldInfo(L,1);
    FieldInfo r = checkFieldInfo(L,2);

    if (l->ds_tvb != r->ds_tvb)
        WSLUA_ERROR(FieldInfo__eq,"Data source must be the same for both fields");

    if (l->start <= r->start && r->start + r->length <= l->start + r->length) {
        lua_pushboolean(L,1);
        return 1;
    } else {
        return 0;
    }
}
开发者ID:pvons,项目名称:wireshark,代码行数:15,代码来源:wslua_field.c

示例2: FieldInfo__eq

WSLUA_METAMETHOD FieldInfo__eq(lua_State* L) {
    /* Checks whether lhs is within rhs. */
    FieldInfo l = checkFieldInfo(L,1);
    FieldInfo r = checkFieldInfo(L,2);

    /* it is not an error if their ds_tvb are different... they're just not equal */
    if (l->ws_fi->ds_tvb == r->ws_fi->ds_tvb &&
        l->ws_fi->start == r->ws_fi->start &&
        r->ws_fi->length == l->ws_fi->length) {
        lua_pushboolean(L,1);
    } else {
        lua_pushboolean(L,0);
    }
    return 1;
}
开发者ID:MultipathDTLS,项目名称:wireshark,代码行数:15,代码来源:wslua_field.c

示例3: FieldInfo__le

WSLUA_METAMETHOD FieldInfo__le(lua_State* L) {
    /* Checks whether the end byte of lhs is before the end of rhs. */
    FieldInfo l = checkFieldInfo(L,1);
    FieldInfo r = checkFieldInfo(L,2);

    if (l->ws_fi->ds_tvb != r->ws_fi->ds_tvb)
        WSLUA_ERROR(FieldInfo__le,"Data source must be the same for both fields");

    if (r->ws_fi->start + r->ws_fi->length <= l->ws_fi->start + l->ws_fi->length) {
        lua_pushboolean(L,1);
    } else {
        lua_pushboolean(L,0);
    }
    return 1;
}
开发者ID:MultipathDTLS,项目名称:wireshark,代码行数:15,代码来源:wslua_field.c

示例4: FieldInfo__lt

WSLUA_METAMETHOD FieldInfo__lt(lua_State* L) {
    /* Checks whether the end byte of rhs is before the beginning of rhs */
    FieldInfo l = checkFieldInfo(L,1);
    FieldInfo r = checkFieldInfo(L,2);

    if (l->ds_tvb != r->ds_tvb)
        WSLUA_ERROR(FieldInfo__lt,"Data source must be the same for both fields");

    if ( r->start + r->length < l->start ) {
        lua_pushboolean(L,1);
        return 1;
    } else {
        return 0;
    }
}
开发者ID:pvons,项目名称:wireshark,代码行数:15,代码来源:wslua_field.c

示例5: FieldInfo__tostring

WSLUA_METAMETHOD FieldInfo__tostring(lua_State* L) {
    /* The string representation of the field */
    FieldInfo fi = checkFieldInfo(L,1);

    if (!fi) {
        return luaL_error(L,"Missing FieldInfo object");
    }

    if (fi->value.ftype->val_to_string_repr) {
        gchar* repr = fvalue_to_string_repr(&fi->value,FTREPR_DISPLAY,NULL);
        if (repr) {
            lua_pushstring(L,repr);
        }
        else {
            lua_pushstring(L,"(unknown)");
        }
    }
    else if (fi->hfinfo->type == FT_NONE) {
        lua_pushstring(L, "(none)");
    }
    else {
        lua_pushstring(L,"(n/a)");
    }

    return 1;
}
开发者ID:pvons,项目名称:wireshark,代码行数:26,代码来源:wslua_field.c

示例6: FieldInfo_get_name

/* WSLUA_ATTRIBUTE FieldInfo_name RO The name of this field */
static int FieldInfo_get_name(lua_State* L) {
    /* The filter name of this field. */
    FieldInfo fi = checkFieldInfo(L,1);

    lua_pushstring(L,fi->ws_fi->hfinfo->abbrev);
    return 1;
}
开发者ID:MultipathDTLS,项目名称:wireshark,代码行数:8,代码来源:wslua_field.c

示例7: FieldInfo_get_generated

/* WSLUA_ATTRIBUTE FieldInfo_generated RO Whether this field was marked as generated (boolean) */
static int FieldInfo_get_generated(lua_State* L) {
    /* Whether this field was marked as generated. */
    FieldInfo fi = checkFieldInfo(L,1);

    lua_pushboolean(L,FI_GET_FLAG(fi->ws_fi, FI_GENERATED));
    return 1;
}
开发者ID:MultipathDTLS,项目名称:wireshark,代码行数:8,代码来源:wslua_field.c

示例8: FieldInfo__tostring

/* WSLUA_ATTRIBUTE FieldInfo_label RO The string representing this field */
WSLUA_METAMETHOD FieldInfo__tostring(lua_State* L) {
    /* The string representation of the field. */
    FieldInfo fi = checkFieldInfo(L,1);

    if (fi->ws_fi->value.ftype->val_to_string_repr) {
        gchar* repr = NULL;

        if (fi->ws_fi->hfinfo->type == FT_PROTOCOL || fi->ws_fi->hfinfo->type == FT_PCRE) {
            repr = fvalue_to_string_repr(&fi->ws_fi->value,FTREPR_DFILTER,BASE_NONE,NULL);
        }
        else {
            repr = fvalue_to_string_repr(&fi->ws_fi->value,FTREPR_DISPLAY,fi->ws_fi->hfinfo->display,NULL);
        }

        if (repr) {
            lua_pushstring(L,repr);
            /* fvalue_to_string_repr() g_malloc's the string's buffer */
            g_free(repr);
        }
        else {
            lua_pushstring(L,"(unknown)");
        }
    }
    else if (fi->ws_fi->hfinfo->type == FT_NONE) {
        lua_pushstring(L, "(none)");
    }
    else {
        lua_pushstring(L,"(n/a)");
    }

    return 1;
}
开发者ID:MultipathDTLS,项目名称:wireshark,代码行数:33,代码来源:wslua_field.c

示例9: FieldInfo_display

static int FieldInfo_display(lua_State* L) {
    /* The display string of this field as seen in GUI */
    FieldInfo fi = checkFieldInfo(L,1);
    gchar         label_str[ITEM_LABEL_LENGTH+1];
    gchar        *label_ptr;
    gchar        *value_ptr;

    if (!fi) return 0;

    if (!fi->rep) {
        label_ptr = label_str;
        proto_item_fill_label(fi, label_str);
    } else 
        label_ptr = fi->rep->representation;

    if (!label_ptr) return 0;

    value_ptr = strstr(label_ptr, ": ");
    if (!value_ptr) {
        /* just use whatever's there */
        lua_pushstring(L, label_ptr);
    } else {
        value_ptr += 2;  /* get past the ': ' */
        lua_pushstring(L, value_ptr);
    }

    return 1;
}
开发者ID:pvons,项目名称:wireshark,代码行数:28,代码来源:wslua_field.c

示例10: FieldInfo__len

WSLUA_METAMETHOD FieldInfo__len(lua_State* L) {
    /*
       Obtain the Length of the field
       */
    FieldInfo fi = checkFieldInfo(L,1);
    lua_pushnumber(L,fi->length);
    return 1;
}
开发者ID:pvons,项目名称:wireshark,代码行数:8,代码来源:wslua_field.c

示例11: FieldInfo__unm

WSLUA_METAMETHOD FieldInfo__unm(lua_State* L) {
    /*
       Obtain the Offset of the field
       */
    FieldInfo fi = checkFieldInfo(L,1);
    lua_pushnumber(L,fi->start);
    return 1;
}
开发者ID:pvons,项目名称:wireshark,代码行数:8,代码来源:wslua_field.c

示例12: FieldInfo_get_range

static int FieldInfo_get_range(lua_State* L) {
    /* The TvbRange covering this field */
    FieldInfo fi = checkFieldInfo(L,1);
    if (push_TvbRange (L, fi->ds_tvb, fi->start, fi->length)) {
        return 1;
    }

    return 0;
}
开发者ID:pvons,项目名称:wireshark,代码行数:9,代码来源:wslua_field.c

示例13: FieldInfo_get_range

/* WSLUA_ATTRIBUTE FieldInfo_range RO The `TvbRange` covering the bytes of this field in a Tvb. */
static int FieldInfo_get_range(lua_State* L) {
    FieldInfo fi = checkFieldInfo(L,1);

    if (push_TvbRange (L, fi->ws_fi->ds_tvb, fi->ws_fi->start, fi->ws_fi->length)) {
        return 1;
    }

    return 0;
}
开发者ID:HeartFlying,项目名称:wireshark,代码行数:10,代码来源:wslua_field.c

示例14: FieldInfo_get_type

/* WSLUA_ATTRIBUTE FieldInfo_type RO The internal field type, a number which
   matches one of the `ftype` values in `init.lua`.

   @since 1.99.8
 */
static int FieldInfo_get_type(lua_State* L) {
    FieldInfo fi = checkFieldInfo(L,1);

    if (fi->ws_fi->hfinfo) {
        lua_pushnumber(L, fi->ws_fi->hfinfo->type);
    }
    else {
        lua_pushnil(L);
    }

    return 1;
}
开发者ID:HeartFlying,项目名称:wireshark,代码行数:17,代码来源:wslua_field.c

示例15: FieldInfo_get_source

/* WSLUA_ATTRIBUTE FieldInfo_source RO The source `Tvb` object the `FieldInfo` is derived
    from, or nil if there is none.

   @since 1.99.8
 */
static int FieldInfo_get_source(lua_State* L) {
    FieldInfo fi = checkFieldInfo(L,1);

    if (fi->ws_fi->ds_tvb) {
        push_Tvb(L, fi->ws_fi->ds_tvb);
    }
    else {
        lua_pushnil(L);
    }

    return 1;
}
开发者ID:HeartFlying,项目名称:wireshark,代码行数:17,代码来源:wslua_field.c


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