本文整理匯總了C++中ADD_DATA函數的典型用法代碼示例。如果您正苦於以下問題:C++ ADD_DATA函數的具體用法?C++ ADD_DATA怎麽用?C++ ADD_DATA使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了ADD_DATA函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。
示例1: data_cursor_all_bottom_left
static void
data_cursor_all_bottom_left(void)
{
ADD_DATA("all - bottom left - bottom left",
gcut_list_string_new(
"(03,03)", "(03,04)", "(03,05)", "(03,06)", "(03,07)", "(03,08)",
"(04,03)", "(04,04)", "(04,05)", "(04,06)", "(04,07)", "(04,08)",
"(05,03)", "(05,04)", "(05,05)", "(05,06)", "(05,07)", "(05,08)",
"(06,03)", "(06,04)", "(06,05)", "(06,06)", "(06,07)", "(06,08)",
"(07,03)", "(07,04)", "(07,05)", "(07,06)", "(07,07)", "(07,08)",
"(08,03)", "(08,04)", "(08,05)", "(08,06)", "(08,07)", "(08,08)",
NULL),
8, 3,
3, 8);
ADD_DATA("all - bottom left - top left",
gcut_list_string_new(
"(07,03)", "(07,04)", "(07,05)", "(07,06)", "(07,07)", "(07,08)",
"(08,03)", "(08,04)", "(08,05)", "(08,06)", "(08,07)", "(08,08)",
NULL),
8, 3,
7, 8);
ADD_DATA("all - bottom left - bottom right",
gcut_list_string_new("(03,07)", "(03,08)",
"(04,07)", "(04,08)",
"(05,07)", "(05,08)",
"(06,07)", "(06,08)",
"(07,07)", "(07,08)",
"(08,07)", "(08,08)",
NULL),
8, 7,
3, 8);
}
示例2: data_hash_table_create
static void
data_hash_table_create(void)
{
ADD_DATA("hash",
"table_create Blog TABLE_HASH_KEY ShortText",
"Blog",
GRN_OBJ_TABLE_HASH_KEY,
"ShortText",
NULL);
ADD_DATA("hash - without key",
"table_create Blog TABLE_HASH_KEY",
"Blog",
GRN_OBJ_TABLE_HASH_KEY,
NULL,
NULL);
ADD_DATA("hash - key normalize",
"table_create Blog TABLE_HASH_KEY|KEY_NORMALIZE ShortText",
"Blog",
GRN_OBJ_TABLE_HASH_KEY | GRN_OBJ_KEY_NORMALIZE,
"ShortText",
NULL);
ADD_DATA("hash - key normalize - value",
"table_create Blog TABLE_HASH_KEY|KEY_NORMALIZE ShortText Int32",
"Blog",
GRN_OBJ_TABLE_HASH_KEY | GRN_OBJ_KEY_NORMALIZE,
"ShortText",
"Int32");
}
示例3: data_cursor_bottom
static void
data_cursor_bottom(void)
{
ADD_DATA("bottom - minimum",
gcut_list_string_new("(03,07)", "(03,08)",
"(04,07)", "(04,08)",
NULL),
4, 7,
3, 8);
ADD_DATA("bottom - left",
gcut_list_string_new(
"(03,03)", "(03,04)", "(03,05)", "(03,06)", "(03,07)", "(03,08)",
"(04,03)", "(04,04)", "(04,05)", "(04,06)", "(04,07)", "(04,08)",
NULL),
4, 3,
3, 8);
ADD_DATA("bottom - right",
gcut_list_string_new(
"(03,07)", "(03,08)", "(03,09)", "(03,10)", "(03,11)", "(03,12)",
"(04,07)", "(04,08)", "(04,09)", "(04,10)", "(04,11)", "(04,12)",
NULL),
4, 7,
3, 12);
}
示例4: multi_respawn_broadcast
// send a broadcast pack indicating a player has respawned
void multi_respawn_broadcast(net_player *np)
{
ubyte data[50],val;
int packet_size = 0;
ushort signature;
vector pos;
// broadcast the packet to all players
Assert(Net_player->flags & NETINFO_FLAG_AM_MASTER);
signature = Objects[np->player->objnum].net_signature;
pos = Objects[np->player->objnum].pos;
// build the header and add the opcode
BUILD_HEADER(RESPAWN_NOTICE);
val = RESPAWN_BROADCAST;
ADD_DATA(val);
// add the data for the respawn
ADD_USHORT(signature);
add_vector_data( data, &packet_size, pos );
ADD_SHORT(np->player_id);
ADD_DATA(np->s_info.cur_primary_bank);
ADD_DATA(np->s_info.cur_secondary_bank);
ADD_DATA(np->s_info.cur_link_status);
ADD_USHORT(np->s_info.ship_ets);
ADD_STRING(np->p_info.p_objp->name);
Assert( np->s_info.ship_ets != 0 ); // find dave or allender
multi_io_send_to_all_reliable(data, packet_size);
}
示例5: data_cursor_left
static void
data_cursor_left(void)
{
ADD_DATA("left - minimum",
gcut_list_string_new("(07,03)", "(07,04)",
"(08,03)", "(08,04)",
NULL),
8, 3,
7, 4);
ADD_DATA("left - bottom",
gcut_list_string_new("(03,03)", "(03,04)",
"(04,03)", "(04,04)",
"(05,03)", "(05,04)",
"(06,03)", "(06,04)",
"(07,03)", "(07,04)",
"(08,03)", "(08,04)",
NULL),
8, 3,
3, 4);
ADD_DATA("left - top",
gcut_list_string_new("(07,03)", "(07,04)",
"(08,03)", "(08,04)",
"(09,03)", "(09,04)",
"(10,03)", "(10,04)",
"(11,03)", "(11,04)",
"(12,03)", "(12,04)",
NULL),
12, 3,
7, 4);
}
示例6: data_cursor_top
static void
data_cursor_top(void)
{
ADD_DATA("top - minimum",
gcut_list_string_new("(11,07)", "(11,08)",
"(12,07)", "(12,08)",
NULL),
12, 7,
11, 8);
ADD_DATA("top - left",
gcut_list_string_new(
"(11,03)", "(11,04)", "(11,05)", "(11,06)", "(11,07)", "(11,08)",
"(12,03)", "(12,04)", "(12,05)", "(12,06)", "(12,07)", "(12,08)",
NULL),
12, 3,
11, 8);
ADD_DATA("top - right",
gcut_list_string_new(
"(11,07)", "(11,08)", "(11,09)", "(11,10)", "(11,11)", "(11,12)",
"(12,07)", "(12,08)", "(12,09)", "(12,10)", "(12,11)", "(12,12)",
NULL),
12, 7,
11, 12);
}
示例7: data_near_uint32
void
data_near_uint32(void)
{
#define ADD_DATA(label, expected, min_size, max, offset, limit, flags) \
gcut_add_datum(label, \
"expected", G_TYPE_POINTER, \
expected, g_list_free, \
"min-size", G_TYPE_INT, min_size, \
"max", G_TYPE_UINT, max, \
"offset", G_TYPE_INT, offset, \
"limit", G_TYPE_INT, limit, \
"flags", G_TYPE_INT, flags, \
NULL)
ADD_DATA("no limit",
uint_list_new(5,
0x00000000U, 0x00000004U, 0x00000080U,
0xdeadbeefU, 0xffffffffU),
0, 0,
0, -1,
0);
ADD_DATA("min limit",
uint_list_new(3, 0x00000000U, 0x00000004U, 0x00000080U),
1, 0,
0, -1,
0);
#undef ADD_DATA
}
示例8: data_cursor_right
static void
data_cursor_right(void)
{
ADD_DATA("right - minimum",
gcut_list_string_new("(07,11)", "(07,12)",
"(08,11)", "(08,12)",
NULL),
8, 11,
7, 12);
ADD_DATA("right - bottom",
gcut_list_string_new("(03,11)", "(03,12)",
"(04,11)", "(04,12)",
"(05,11)", "(05,12)",
"(06,11)", "(06,12)",
"(07,11)", "(07,12)",
"(08,11)", "(08,12)",
NULL),
8, 11,
3, 12);
ADD_DATA("right - top",
gcut_list_string_new("(07,11)", "(07,12)",
"(08,11)", "(08,12)",
"(09,11)", "(09,12)",
"(10,11)", "(10,12)",
"(11,11)", "(11,12)",
"(12,11)", "(12,12)",
NULL),
12, 11,
7, 12);
}
示例9: data_prefix_rk_offset_and_limit
static void
data_prefix_rk_offset_and_limit(void)
{
ADD_DATA("offset",
gcut_list_string_new("キノウ",
"キョウカ",
"クミコミ",
"クミコム",
"ケンサクヨウキュウ",
"コウセイド",
"コウソク",
"コンパクト",
NULL),
"k",
3, -1);
ADD_DATA("limit",
gcut_list_string_new("カネソナエタ",
"カノウ",
"ケンサク",
NULL),
"k",
0, 3);
ADD_DATA("offset - limit",
gcut_list_string_new("キノウ",
"キョウカ",
"ケンサクヨウキュウ",
"コウセイド",
"コウソク",
NULL),
"k",
3, 5);
}
示例10: data_prefix_error
void
data_prefix_error(void)
{
#define ADD_DATA(label, rc, message, offset, limit) \
gcut_add_datum(label, \
"rc", G_TYPE_UINT, rc, \
"message", G_TYPE_STRING, message, \
"offset", G_TYPE_INT, offset, \
"limit", G_TYPE_INT, limit, \
NULL)
ADD_DATA("negative offset",
GRN_TOO_SMALL_OFFSET,
"can't use negative offset with GRN_CURSOR_PREFIX: -1",
-1, -1);
ADD_DATA("large offset",
GRN_TOO_LARGE_OFFSET,
"offset is rather than table size: offset:100, table_size:8",
100, -1);
ADD_DATA("negative limit",
GRN_TOO_SMALL_LIMIT,
"can't use small limit rather than -1 with GRN_CURSOR_PREFIX: -2",
0, -2);
#undef ADD_DATA
}
示例11: test_socks_5_no_authenticate
/** Perform SOCKS 5 authentication */
static void
test_socks_5_no_authenticate(void *ptr)
{
SOCKS_TEST_INIT();
/*SOCKS 5 No Authentication */
ADD_DATA(buf,"\x05\x01\x00");
tt_assert(!fetch_from_buf_socks(buf, socks,
get_options()->TestSocks,
get_options()->SafeSocks));
tt_int_op(2,OP_EQ, socks->replylen);
tt_int_op(5,OP_EQ, socks->reply[0]);
tt_int_op(SOCKS_NO_AUTH,OP_EQ, socks->reply[1]);
tt_int_op(0,OP_EQ, buf_datalen(buf));
/*SOCKS 5 Send username/password anyway - pretend to be broken */
ADD_DATA(buf,"\x01\x02\x01\x01\x02\x01\x01");
tt_assert(!fetch_from_buf_socks(buf, socks,
get_options()->TestSocks,
get_options()->SafeSocks));
tt_int_op(5,OP_EQ, socks->socks_version);
tt_int_op(2,OP_EQ, socks->replylen);
tt_int_op(1,OP_EQ, socks->reply[0]);
tt_int_op(0,OP_EQ, socks->reply[1]);
tt_int_op(2,OP_EQ, socks->usernamelen);
tt_int_op(2,OP_EQ, socks->passwordlen);
tt_mem_op("\x01\x01",OP_EQ, socks->username, 2);
tt_mem_op("\x01\x01",OP_EQ, socks->password, 2);
done:
;
}
示例12: multi_options_update_mission
// update the standalone with the mission settings I have picked (mission filename, etc)
void multi_options_update_mission(netgame_info *ng, int campaign_mode)
{
ubyte data[MAX_PACKET_SIZE],code;
int packet_size = 0;
// should be a host on a standalone
Assert((Net_player->flags & NETINFO_FLAG_GAME_HOST) && !(Net_player->flags & NETINFO_FLAG_AM_MASTER));
// build the header
BUILD_HEADER(OPTIONS_UPDATE);
code = MULTI_OPTION_MISSION;
ADD_DATA(code);
// type (coop or team vs. team)
ADD_INT(ng->type_flags);
// respawns
ADD_UINT(ng->respawn);
// add the mission/campaign filename
code = (ubyte)campaign_mode;
ADD_DATA(code);
if(campaign_mode){
ADD_STRING(ng->campaign_name);
} else {
ADD_STRING(ng->mission_name);
}
// send to the server
multi_io_send_reliable(Net_player, data, packet_size);
}
示例13: data_cursor_all_top_left
static void
data_cursor_all_top_left(void)
{
ADD_DATA("all - top left - top left",
gcut_list_string_new(
"(07,03)", "(07,04)", "(07,05)", "(07,06)", "(07,07)", "(07,08)",
"(08,03)", "(08,04)", "(08,05)", "(08,06)", "(08,07)", "(08,08)",
"(09,03)", "(09,04)", "(09,05)", "(09,06)", "(09,07)", "(09,08)",
"(10,03)", "(10,04)", "(10,05)", "(10,06)", "(10,07)", "(10,08)",
"(11,03)", "(11,04)", "(11,05)", "(11,06)", "(11,07)", "(11,08)",
"(12,03)", "(12,04)", "(12,05)", "(12,06)", "(12,07)", "(12,08)",
NULL),
12, 3,
7, 8);
ADD_DATA("all - top left - top right",
gcut_list_string_new("(07,07)", "(07,08)",
"(08,07)", "(08,08)",
"(09,07)", "(09,08)",
"(10,07)", "(10,08)",
"(11,07)", "(11,08)",
"(12,07)", "(12,08)",
NULL),
12, 7,
7, 8);
}
示例14: data_uvector_column
void
data_uvector_column(void)
{
ADD_DATA("int32", "[-322,7,9270]", "Int32",
G_TYPE_INT, -322, 7, 9270);
ADD_DATA("float", "[0.5,12.5,-1.0]", "Float",
G_TYPE_DOUBLE, 0.5, 12.5, -1.0);
ADD_DATA("bool", "[true,false,true]", "Bool",
G_TYPE_BOOLEAN, TRUE, FALSE, TRUE);
}
示例15: data_near_geo_point
void
data_near_geo_point(void)
{
#define ADD_DATA(label, expected, min_size, max, offset, limit, flags) \
gcut_add_datum(label, \
"expected", G_TYPE_POINTER, \
expected, gcut_list_string_free, \
"min-size", G_TYPE_INT, min_size, \
"max", G_TYPE_STRING, max, \
"offset", G_TYPE_INT, offset, \
"limit", G_TYPE_INT, limit, \
"flags", G_TYPE_INT, flags, \
NULL)
ADD_DATA("no limit",
gcut_list_string_new(POINT(1, 2, 3,
4, 5, 6),
POINT(1, 2, 3,
7, 8, 9),
POINT(7, 8, 9,
4, 5, 6),
POINT(88, 58, 58,
178, 58, 58),
POINT(89, 59, 59,
179, -59, -59),
POINT(89, 59, 59,
179, 59, 59),
POINT(-89, -59, -59,
179, 59, 59),
POINT(-89, -59, -59,
-179, -59, -59),
POINT(-88, -58, -58,
-178, -58, -58),
NULL),
0,
TAKEN_POINT(0, 0, 0,
0, 0, 0),
0, -1,
0);
ADD_DATA("min-size",
gcut_list_string_new(POINT(1, 2, 3,
4, 5, 6),
POINT(1, 2, 3,
7, 8, 9),
POINT(7, 8, 9,
4, 5, 6),
NULL),
1,
TAKEN_POINT(0, 0, 0,
0, 0, 0),
0, -1,
0);
#undef ADD_DATA
}