本文整理汇总了C++中EXEC函数的典型用法代码示例。如果您正苦于以下问题:C++ EXEC函数的具体用法?C++ EXEC怎么用?C++ EXEC使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了EXEC函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: espresso
pcover espresso(pset_family F, pset_family D1, pset_family R)
{
pcover E, D, Fsave;
pset last, p;
cost_t cost, best_cost;
begin:
Fsave = sf_save(F); /* save original function */
D = sf_save(D1); /* make a scratch copy of D */
/* Setup has always been a problem */
if (recompute_onset) {
EXEC(E = simplify(cube1list(F)), "SIMPLIFY ", E);
free_cover(F);
F = E;
}
cover_cost(F, &cost);
if (unwrap_onset && (cube.part_size[cube.num_vars - 1] > 1)
&& (cost.out != cost.cubes*cube.part_size[cube.num_vars-1])
&& (cost.out < 5000))
EXEC(F = sf_contain(unravel(F, cube.num_vars - 1)), "SETUP ", F);
/* Initial expand and irredundant */
foreach_set(F, last, p) {
RESET(p, PRIME);
}
示例2: _load
static gboolean
_load (GESFormatter * self, GESTimeline * timeline, const gchar * string,
GError ** error)
{
guint i;
GList *tmp;
GError *err;
GESStructureParser *parser = _parse_structures (string);
err = ges_structure_parser_get_error (parser);
if (err) {
if (error)
*error = err;
return FALSE;
}
g_object_set (timeline, "auto-transition", TRUE, NULL);
if (!(ges_timeline_add_track (timeline, GES_TRACK (ges_video_track_new ()))))
goto fail;
if (!(ges_timeline_add_track (timeline, GES_TRACK (ges_audio_track_new ()))))
goto fail;
/* Here we've finished initializing our timeline, we're
* ready to start using it... by solely working with the layer !*/
for (tmp = parser->structures; tmp; tmp = tmp->next) {
const gchar *name = gst_structure_get_name (tmp->data);
if (g_str_has_prefix (name, "set-")) {
EXEC (_set_child_property, tmp->data, &err);
continue;
}
for (i = 0; i < G_N_ELEMENTS (timeline_parsing_options); i++) {
if (gst_structure_has_name (tmp->data,
timeline_parsing_options[i].long_name)
|| (strlen (name) == 1 &&
*name == timeline_parsing_options[i].short_name)) {
EXEC (((ActionFromStructureFunc) timeline_parsing_options[i].arg_data),
tmp->data, &err);
}
}
}
gst_object_unref (parser);
return TRUE;
fail:
gst_object_unref (parser);
if (err) {
if (error)
*error = err;
}
return FALSE;
}
示例3: PREPARE
int JSQLInvitationCodeDB::removeInvitationCode(const QString& code)
{
QSqlQuery query;
QString dn = QSqlDatabase::database().driverName();
// QSQLITE
if( dn == "QSQLITE" ){
PREPARE( query,
"DELETE FROM "
TableName
" where `id` in ( "
" select `id` from "
TableName
" where `code` = :code "
" order by `id` LIMIT 1 "
" ) ",
0);
}else{
PREPARE( query,
"DELETE FROM "
TableName
" where code = :code "
"LIMIT 1",
0);
}
query.bindValue(":code" , code );
EXEC( query , -1 );
return query.numRowsAffected();
}
示例4: PREPARE
bool JSQLGameInfoDB::isGameIdExist(JID id)
{
QSqlQuery query;
PREPARE( query ,
"select game_id from gameinfo "
"where game_id= :gameID" ,
false );
query.bindValue(":gameID", id);
EXEC( query , false );
if( query.driver()->hasFeature(QSqlDriver::QuerySize) ){
if(query.size() > 0){
return true;
}else{
return false;
}
}else{
if(query.next()){
return true;
}else{
return false;
}
}
}
示例5: connect_p
static void connect_p(int argc, const char **argv)
{
bt_bdaddr_t addr;
int local_role;
int remote_role;
RETURN_IF_NULL(if_pan);
VERIFY_ADDR_ARG(2, &addr);
/* local role */
if (argc < 4) {
haltest_error("No local mode specified\n");
return;
}
local_role = str2btpan_role_t(argv[3]);
if (local_role == -1)
local_role = atoi(argv[3]);
/* remote role */
if (argc < 5) {
haltest_error("No remote mode specified\n");
return;
}
remote_role = str2btpan_role_t(argv[4]);
if (remote_role == -1)
remote_role = atoi(argv[4]);
EXEC(if_pan->connect, &addr, local_role, remote_role);
}
示例6: handle_call_action_p
/* perform specified call related action */
static void handle_call_action_p(int argc, const char **argv)
{
bthf_client_call_action_t action;
int index = 0;
RETURN_IF_NULL(if_hf_client);
/* action */
if (argc <= 2) {
haltest_error("No action specified\n");
return;
}
action = str2bthf_client_call_action_t(argv[2]);
/* call index */
if (action == BTHF_CLIENT_CALL_ACTION_CHLD_1x ||
action == BTHF_CLIENT_CALL_ACTION_CHLD_2x) {
if (argc <= 3) {
haltest_error("No call index specified\n");
return;
}
index = atoi(argv[3]);
}
EXEC(if_hf_client->handle_call_action, action, index);
}
示例7: create
void create(){
char *sql = "CREATE TABLE Toc(Id INT, Name TEXT, Price INT);"
"INSERT INTO Toc VALUES(1, 'Honda', 2000);";
SQL *db;
char str[256+3+5]="data/\0";
char str2[256];
printf("business name?\n:");
if(fgets(str2,256,stdin)){
strcat(str,str2);
str[strlen(str)-1]='\0';
strcat(str,".db");
printf("created: %s\n",str);
db=OPEN(str);
if(db==0){
PRINT("OPEN ERROR\n");
CLOSE(db);
}
if(EXEC(db,sql)!=SQLITE_OK){
PRINT("EXEC ERROR\n");
printf("%s\n",errmsg);
CLOSE(db);
}
CLOSE(db);
}else{
}
return;
}
示例8: get_report_p
static void get_report_p(int argc, const char **argv)
{
bt_bdaddr_t addr;
bthh_report_type_t reportType;
uint8_t reportId;
int bufferSize;
RETURN_IF_NULL(if_hh);
VERIFY_ADDR_ARG(2, &addr);
if (argc < 4) {
haltest_error("No report type specified\n");
return;
}
reportType = str2bthh_report_type_t(argv[3]);
if (argc < 5) {
haltest_error("No reportId specified\n");
return;
}
reportId = (uint8_t) atoi(argv[4]);
if (argc < 6) {
haltest_error("No bufferSize specified\n");
return;
}
bufferSize = atoi(argv[5]);
EXEC(if_hh->get_report, &addr, reportType, reportId, bufferSize);
}
示例9: gatts_send_indication_p
static void gatts_send_indication_p(int argc, const char *argv[])
{
int server_if;
int attr_handle;
int conn_id;
int confirm;
char data[200];
int len = 0;
RETURN_IF_NULL(if_gatt);
VERIFY_SERVER_IF(2, server_if);
VERIFY_HANDLE(3, attr_handle);
VERIFY_CONN_ID(4, conn_id);
/* confirm */
if (argc <= 5) {
haltest_error("No transport specified\n");
return;
}
confirm = atoi(argv[5]);
if (argc > 6) {
len = strlen(argv[6]);
scan_field(argv[6], len, (uint8_t *) data, sizeof(data));
}
EXEC(if_gatt->server->send_indication, server_if, attr_handle, conn_id,
len, confirm, data);
}
示例10: ssp_reply_p
static void ssp_reply_p(int argc, const char **argv)
{
bt_bdaddr_t addr;
bt_ssp_variant_t var;
int accept;
int passkey;
RETURN_IF_NULL(if_bluetooth);
VERIFY_ADDR_ARG(2, &addr);
if (argc < 4) {
haltest_error("No ssp variant specified\n");
return;
}
var = str2btsspvariant(argv[3]);
if (argc < 5) {
haltest_error("No accept value specified\n");
return;
}
accept = atoi(argv[4]);
passkey = 0;
if (accept && var == BT_SSP_VARIANT_PASSKEY_ENTRY && argc >= 5)
passkey = atoi(argv[4]);
EXEC(if_bluetooth->ssp_reply, &addr, var, accept, passkey);
}
示例11: init_p
static void init_p(int argc, const char **argv)
{
int err;
const hw_module_t *module;
hw_device_t *device;
err = hw_get_module(BT_HARDWARE_MODULE_ID, &module);
if (err) {
haltest_error("he_get_module returned %d\n", err);
return;
}
err = module->methods->open(module, BT_HARDWARE_MODULE_ID, &device);
if (err) {
haltest_error("module->methods->open returned %d\n", err);
return;
}
if_bluetooth =
((bluetooth_device_t *) device)->get_bluetooth_interface();
if (!if_bluetooth) {
haltest_error("get_bluetooth_interface returned NULL\n");
return;
}
EXEC(if_bluetooth->init, &bt_callbacks);
}
示例12: gatts_add_characteristic_p
static void gatts_add_characteristic_p(int argc, const char *argv[])
{
int server_if;
int service_handle;
int properties;
int permissions;
bt_uuid_t uuid;
RETURN_IF_NULL(if_gatt);
VERIFY_SERVER_IF(2, server_if);
VERIFY_SERVICE_HANDLE(3, service_handle);
VERIFY_UUID(4, &uuid);
/* properties */
if (argc <= 5) {
haltest_error("No properties specified\n");
return;
}
properties = atoi(argv[5]);
/* permissions */
if (argc <= 6) {
haltest_error("No permissions specified\n");
return;
}
permissions = atoi(argv[6]);
EXEC(if_gatt->server->add_characteristic, server_if, service_handle,
&uuid, properties, permissions);
}
示例13: test_command_p
static void test_command_p(int argc, const char **argv)
{
int command;
int i;
bt_bdaddr_t bd_addr;
bt_uuid_t uuid;
btgatt_test_params_t params = {
.bda1 = &bd_addr,
.uuid1 = &uuid
};
uint16_t *u = ¶ms.u1;
RETURN_IF_NULL(if_gatt);
/* command */
if (argc <= 2) {
haltest_error("No command specified\n");
return;
}
command = atoi(argv[2]);
VERIFY_ADDR_ARG(3, &bd_addr);
VERIFY_UUID(4, &uuid);
for (i = 5; i < argc; i++)
VERIFY_TEST_ARG(i, *u++);
EXEC(if_gatt->client->test_command, command, ¶ms);
}
示例14: connect_channel_p
static void connect_channel_p(int argc, const char **argv)
{
uint32_t app_id, mdep_cfg_index;
int channel_id = -1;
bt_bdaddr_t bd_addr;
RETURN_IF_NULL(if_hl);
if (argc <= 2) {
haltest_error("No app id is specified");
return;
}
VERIFY_ADDR_ARG(3, &bd_addr);
if (argc <= 4) {
haltest_error("No mdep cfg index is specified");
return;
}
app_id = (uint32_t) atoi(argv[2]);
mdep_cfg_index = (uint32_t) atoi(argv[4]);
EXEC(if_hl->connect_channel, app_id, &bd_addr, mdep_cfg_index,
&channel_id);
}
示例15: PREPARE
bool JSQLUserInfoDB::isUserIdExist(JID id){
QSqlQuery query;
PREPARE( query ,
"select * from userinfo "
"where user_id = :userId" ,
false );
query.bindValue(":userId", id);
EXEC( query , false );
if( query.driver()->hasFeature(QSqlDriver::QuerySize) ){
if(query.size() > 0){
return true;
}else{
return false;
}
}else{
if(query.next()){
return true;
}else{
return false;
}
}
}