本文整理汇总了C++中print_arguments函数的典型用法代码示例。如果您正苦于以下问题:C++ print_arguments函数的具体用法?C++ print_arguments怎么用?C++ print_arguments使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了print_arguments函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: generate_interface_xml
static void generate_interface_xml(GString *gstr, struct interface_data *iface)
{
const GDBusMethodTable *method;
const GDBusSignalTable *signal;
for (method = iface->methods; method && method->name; method++) {
if (!strlen(method->signature) && !strlen(method->reply))
g_string_append_printf(gstr, "\t\t<method name=\"%s\"/>\n",
method->name);
else {
g_string_append_printf(gstr, "\t\t<method name=\"%s\">\n",
method->name);
print_arguments(gstr, method->signature, "in");
print_arguments(gstr, method->reply, "out");
g_string_append_printf(gstr, "\t\t</method>\n");
}
}
for (signal = iface->signals; signal && signal->name; signal++) {
if (!strlen(signal->signature))
g_string_append_printf(gstr, "\t\t<signal name=\"%s\"/>\n",
signal->name);
else {
g_string_append_printf(gstr, "\t\t<signal name=\"%s\">\n",
signal->name);
print_arguments(gstr, signal->signature, NULL);
g_string_append_printf(gstr, "\t\t</signal>\n");
}
}
}
开发者ID:593141477,项目名称:bluez-rda,代码行数:30,代码来源:object.c
示例2: generate_interface_xml
static void generate_interface_xml(GString *gstr, struct interface_data *iface)
{
const GDBusMethodTable *method;
const GDBusSignalTable *signal;
for (method = iface->methods; method && method->name; method++) {
gboolean deprecated = method->flags &
G_DBUS_METHOD_FLAG_DEPRECATED;
gboolean noreply = method->flags &
G_DBUS_METHOD_FLAG_NOREPLY;
if (!deprecated && !noreply &&
!(method->in_args && method->in_args->name) &&
!(method->out_args && method->out_args->name))
g_string_append_printf(gstr, "\t\t<method name=\"%s\"/>\n",
method->name);
else {
g_string_append_printf(gstr, "\t\t<method name=\"%s\">\n",
method->name);
print_arguments(gstr, method->in_args, "in");
print_arguments(gstr, method->out_args, "out");
if (deprecated)
g_string_append_printf(gstr, "\t\t\t<annotation name=\"org.freedesktop.DBus.Deprecated\" value=\"true\"/>\n");
if (noreply)
g_string_append_printf(gstr, "\t\t\t<annotation name=\"org.freedesktop.DBus.Method.NoReply\" value=\"true\"/>\n");
g_string_append_printf(gstr, "\t\t</method>\n");
}
}
for (signal = iface->signals; signal && signal->name; signal++) {
gboolean deprecated = signal->flags &
G_DBUS_SIGNAL_FLAG_DEPRECATED;
if (!deprecated && !(signal->args && signal->args->name))
g_string_append_printf(gstr, "\t\t<signal name=\"%s\"/>\n",
signal->name);
else {
g_string_append_printf(gstr, "\t\t<signal name=\"%s\">\n",
signal->name);
print_arguments(gstr, signal->args, NULL);
if (deprecated)
g_string_append_printf(gstr, "\t\t\t<annotation name=\"org.freedesktop.DBus.Deprecated\" value=\"true\"/>\n");
g_string_append_printf(gstr, "\t\t</signal>\n");
}
}
}
开发者ID:blammit,项目名称:bluez,代码行数:51,代码来源:object.c
示例3: main
int main(int argc, char *argv[]){
print_arguments(argc, argv);
return 0;
}
开发者ID:suhasbhairav,项目名称:CodeTheHardWayInC,代码行数:7,代码来源:ex14.c
示例4: main
int main(int argc , char *argv[])
{
print_arguments(argc, argv);
find_negative(argc, argv);
//printf("Argc is %d.\n",argc);
return 0;
}
开发者ID:amankhatri,项目名称:learnc,代码行数:7,代码来源:problem1.3.c
示例5: main
int main(int argc, char *argv[]) {
print_arguments(argc, argv);
int a = 1;
int b = 2;
char _string[] = "string";
int areas[] = {10, 12, 13, 14, 20};
int numbers[4] = {0, 1};
printf("a: %d, b: %d \n", a, b);
printf("%s \n", _string);
printf("The number of ints in areas: %ld\n",
sizeof(areas) / sizeof(int));
printf("numbers: %d %d %d %d\n",
numbers[0], numbers[1],
numbers[2], numbers[3]);
int i = 0;
for(i = 1; i < argc; i++) {
printf("arg %d: %s\n", i, argv[i]);
}
return 0;
}
开发者ID:papaloizouc,项目名称:misc,代码行数:25,代码来源:hworld.c
示例6: print_insn_crx
/* Prints the instruction by calling print_arguments after proper matching: */
int
print_insn_crx(bfd_vma memaddr, struct disassemble_info *info)
{
int is_decoded; /* Nonzero means instruction has a match. */
/* Initialize global variables: */
cst4flag = 0;
size_changed = 0;
/* Retrieve the encoding from current memory location: */
get_words_at_PC(memaddr, info);
/* Find a matching opcode in table: */
is_decoded = match_opcode();
/* If found, print the instruction's mnemonic and arguments: */
if ((is_decoded > 0) && (((words[0] << 16) != 0) || (words[1] != 0)))
{
info->fprintf_func(info->stream, "%s", instruction->mnemonic);
if ((currInsn.nargs = get_number_of_operands()) != 0)
info->fprintf_func(info->stream, "\t");
make_instruction();
print_arguments(&currInsn, memaddr, info);
return currInsn.size;
}
/* No match found: */
info->fprintf_func(info->stream, "%s ", ILLEGAL);
return 2;
}
开发者ID:cooljeanius,项目名称:apple-gdb-1824,代码行数:29,代码来源:crx-dis.c
示例7: mon_backtrace
/* mon_backtrace prints the current stack backtrace. */
int mon_backtrace(int argc, char **argv)
{
int *fp = NULL;
int pc = 0;
(void) argc;
(void) argv;
fp = read_fp();
pc = fp[0];
while (fp != NULL) {
int lr = fp[-1];
struct DebugInfo info = get_debug_info(pc);
if ((int) fp == lr)
break;
kprintf(" fp: %x, lr: %x\n", fp, lr);
kprintf(" %s:%s:%d\n", info.file, info.function,
info.source_line_number);
if (info.arg_count != 0)
print_arguments(&info, fp);
pc = lr;
fp = (int *) fp[-3];
}
return 0;
}
开发者ID:Machiry,项目名称:arunos,代码行数:32,代码来源:mon_backtrace.c
示例8: main
int main(int argc, char *argv[])
{
print_arguments(argc, argv);
//char derp[] = "for reals";
//char *herp[] = {"for reals", "for srs"};
//printf("%s\n", derp);
//printf("%s\n", herp[1]);
return 0;
}
开发者ID:PhilipCastiglione,项目名称:zed-is-yelling-at-me,代码行数:9,代码来源:ex14.c
示例9: main
int main(int argc, char ** argv) {
print_arguments();
std::cout << "Starting Reactor" << std::endl;
reactor_loop_init();
return 0;
}
开发者ID:film42,项目名称:drake,代码行数:10,代码来源:daemon.cpp
示例10: visit
void visit(const CompressedNode * e){
if(e->arguments.size() == 1){
e->arguments[0]->accept(this);
}
else{
stream << '{';
print_arguments(e);
stream << '}';
}
}
开发者ID:TheLartians,项目名称:Expresso,代码行数:10,代码来源:core.cpp
示例11: cpn_opts_usage
void cpn_opts_usage(const struct cpn_opt *opts,
const char *executable, FILE *out)
{
fputs("USAGE: ", out);
print_header(opts, executable, NULL, out);
if (has_actions(opts) || has_options(opts))
fputc('\n', out);
print_arguments(opts, out, 1);
if (has_actions(opts) && has_options(opts))
fputc('\n', out);
print_actions(opts, out, 1);
}
开发者ID:capone-project,项目名称:capone-core,代码行数:12,代码来源:opts.c
示例12: print_actions
static void print_actions(const struct cpn_opt *opts, FILE *out, int indent)
{
const struct cpn_opt *it;
int i;
for (it = opts; it && it->type != CPN_OPTS_TYPE_END; it++) {
if (it->type != CPN_OPTS_TYPE_ACTION)
continue;
for (i = indent; i; i--)
fputc('\t', out);
print_header(it->value.action_opts, it->long_name, it->description, out);
print_arguments(it->value.action_opts, out, indent + 1);
if (has_actions(it) && has_options(it))
fputc('\n', out);
print_actions(it->value.action_opts, out, indent + 1);
}
}
开发者ID:capone-project,项目名称:capone-core,代码行数:18,代码来源:opts.c
示例13: check_authorization
static int check_authorization(DBusConnection *conn)
{
DBusMessage *msg, *reply;
DBusMessageIter iter;
DBusError err;
msg = dbus_message_new_method_call(AUTHORITY_DBUS, AUTHORITY_PATH,
AUTHORITY_INTF, "CheckAuthorization");
if (!msg) {
fprintf(stderr, "Can't allocate new method call\n");
return -ENOMEM;
}
dbus_message_iter_init_append(msg, &iter);
add_arguments(conn, &iter);
dbus_error_init(&err);
reply = dbus_connection_send_with_reply_and_block(conn, msg, -1, &err);
dbus_message_unref(msg);
if (!reply) {
if (dbus_error_is_set(&err)) {
fprintf(stderr, "%s\n", err.message);
dbus_error_free(&err);
} else
fprintf(stderr, "Can't check authorization\n");
return -EIO;
}
if (dbus_message_has_signature(reply, "(bba{ss})") == TRUE) {
dbus_message_iter_init(reply, &iter);
print_arguments(&iter);
}
dbus_message_unref(reply);
return 0;
}
开发者ID:rtiemann,项目名称:connman,代码行数:40,代码来源:polkit-test.c
示例14: main
int main(int argc, char *argv[]) {
// note syntax is argv not argv[]
print_arguments(argc, argv);
return 0;
}
开发者ID:beepscore,项目名称:LearnCTheHardWay,代码行数:6,代码来源:ex14.c
示例15: main
int main(int argc, char *argv[]) {
int err = 0;
double *m = NULL;
double *c = NULL;
double *x = NULL;
gsl_rng_env_setup();
const gsl_rng_type *T = gsl_rng_default;
gsl_rng **rng = NULL;
DEBUGPRINT("### Parsing arguments");
struct arguments args;
initialise_arguments(&args);
argp_parse (&argp, argc, argv, 0, 0, &args);
#ifdef DEBUG
print_arguments(&args);
#endif
DEBUGPRINT("### Reading input configuration");
struct input_config cfg;
read_input_config(args.input_file, &cfg);
#ifdef DEBUG
print_input_config(&cfg);
#endif
DEBUGPRINT("### Generating realization");
int n_threads = omp_get_max_threads();
rng = malloc(n_threads * sizeof(gsl_rng *));
if (!rng) {
printf("Error: Could not allocate memory for 'rng'.\n");
err = -1;
goto cleanup;
}
for (int i = 0; i < n_threads; i++) {
rng[i] = gsl_rng_alloc(T);
gsl_rng_set(rng[i], cfg.rng_seed + i);
}
ptrdiff_t n = 1;
double vol = 1.0;
for (int i = 0; i < cfg.levy_basis_rank; i++) {
n *= (ptrdiff_t)cfg.levy_basis_dimension[i];
vol *= cfg.levy_basis_resolution[i];
}
x = malloc(n * cfg.levy_seed_dimension * sizeof(double));
if (!x) {
printf("Error: Could not allocate memory for 'x'.\n");
err = -1;
goto cleanup;
}
if (strcmp(cfg.levy_seed_family, "normal") == 0) {
struct normal_seed_parameters *q = cfg.levy_seed_parameters;
int dim = cfg.levy_seed_dimension;
m = calloc(dim, sizeof(double));
c = calloc(dim * dim, sizeof(double));
for (int i = 0; i < dim; i++)
m[i] = q->mean[i] * vol;
for (int i = 0; i < dim * dim; i++)
c[i] = q->covariance[i] * vol;
err = generate_multivariate_normal(n_threads, rng, dim, m, c, n, x);
if (err) {
printf("Error in generate_multivariate_normal.\n");
goto cleanup;
}
}
else {
printf("Error: The Levy seed family \"%s\" is not yet supported.\n", cfg.levy_seed_family);
err = -1;
goto cleanup;
}
DEBUGPRINT("### Writing output");
write_output(args.output_file, &cfg, x);
cleanup:
free(c);
free(m);
free(x);
for (int i = 0; i < n_threads; i++)
gsl_rng_free(rng[i]);
free(rng);
return err;
}
开发者ID:emilhedevang,项目名称:ambit-stochastics,代码行数:87,代码来源:simulate-homogeneous-levy-basis.c
示例16: generate_interface_xml
static void generate_interface_xml(GString *gstr, struct interface_data *iface)
{
const GDBusMethodTable *method;
const GDBusSignalTable *signal;
const GDBusPropertyTable *property;
for (method = iface->methods; method && method->name; method++) {
if (check_experimental(method->flags,
G_DBUS_METHOD_FLAG_EXPERIMENTAL))
continue;
g_string_append_printf(gstr, "<method name=\"%s\">",
method->name);
print_arguments(gstr, method->in_args, "in");
print_arguments(gstr, method->out_args, "out");
if (method->flags & G_DBUS_METHOD_FLAG_DEPRECATED)
g_string_append_printf(gstr,
G_DBUS_ANNOTATE_DEPRECATED);
if (method->flags & G_DBUS_METHOD_FLAG_NOREPLY)
g_string_append_printf(gstr, G_DBUS_ANNOTATE_NOREPLY);
g_string_append_printf(gstr, "</method>");
}
for (signal = iface->signals; signal && signal->name; signal++) {
if (check_experimental(signal->flags,
G_DBUS_SIGNAL_FLAG_EXPERIMENTAL))
continue;
g_string_append_printf(gstr, "<signal name=\"%s\">",
signal->name);
print_arguments(gstr, signal->args, NULL);
if (signal->flags & G_DBUS_SIGNAL_FLAG_DEPRECATED)
g_string_append_printf(gstr,
G_DBUS_ANNOTATE_DEPRECATED);
g_string_append_printf(gstr, "</signal>\n");
}
for (property = iface->properties; property && property->name;
property++) {
if (check_experimental(property->flags,
G_DBUS_PROPERTY_FLAG_EXPERIMENTAL))
continue;
g_string_append_printf(gstr, "<property name=\"%s\""
" type=\"%s\" access=\"%s%s\">",
property->name, property->type,
property->get ? "read" : "",
property->set ? "write" : "");
if (property->flags & G_DBUS_PROPERTY_FLAG_DEPRECATED)
g_string_append_printf(gstr,
G_DBUS_ANNOTATE_DEPRECATED);
g_string_append_printf(gstr, "</property>");
}
}
开发者ID:akatrevorjay,项目名称:bluez-dinovo,代码行数:61,代码来源:object.c
示例17: generate_interface_xml
static void generate_interface_xml(GString *gstr, struct interface_data *iface)
{
const GDBusMethodTable *method;
const GDBusSignalTable *signal;
const GDBusPropertyTable *property;
for (method = iface->methods; method && method->name; method++) {
gboolean deprecated = method->flags &
G_DBUS_METHOD_FLAG_DEPRECATED;
gboolean noreply = method->flags &
G_DBUS_METHOD_FLAG_NOREPLY;
if (!deprecated && !noreply &&
!(method->in_args && method->in_args->name) &&
!(method->out_args && method->out_args->name))
g_string_append_printf(gstr,
"\t\t<method name=\"%s\"/>\n",
method->name);
else {
g_string_append_printf(gstr,
"\t\t<method name=\"%s\">\n",
method->name);
print_arguments(gstr, method->in_args, "in");
print_arguments(gstr, method->out_args, "out");
if (deprecated)
g_string_append_printf(gstr,
G_DBUS_ANNOTATE_DEPRECATED("\t\t\t"));
if (noreply)
g_string_append_printf(gstr,
G_DBUS_ANNOTATE_NOREPLY("\t\t\t"));
g_string_append_printf(gstr, "\t\t</method>\n");
}
}
for (signal = iface->signals; signal && signal->name; signal++) {
gboolean deprecated = signal->flags &
G_DBUS_SIGNAL_FLAG_DEPRECATED;
if (!deprecated && !(signal->args && signal->args->name))
g_string_append_printf(gstr,
"\t\t<signal name=\"%s\"/>\n",
signal->name);
else {
g_string_append_printf(gstr,
"\t\t<signal name=\"%s\">\n",
signal->name);
print_arguments(gstr, signal->args, NULL);
if (deprecated)
g_string_append_printf(gstr,
G_DBUS_ANNOTATE_DEPRECATED("\t\t\t"));
g_string_append_printf(gstr, "\t\t</signal>\n");
}
}
for (property = iface->properties; property && property->name;
property++) {
gboolean deprecated = property->flags &
G_DBUS_PROPERTY_FLAG_DEPRECATED;
g_string_append_printf(gstr, "\t\t<property name=\"%s\""
" type=\"%s\" access=\"%s%s\"",
property->name, property->type,
property->get ? "read" : "",
property->set ? "write" : "");
if (!deprecated)
g_string_append_printf(gstr, "/>\n");
else
g_string_append_printf(gstr,
G_DBUS_ANNOTATE_DEPRECATED(">\n\t\t\t"));
}
}
开发者ID:intgr,项目名称:bluez,代码行数:76,代码来源:object.c
示例18: print_operator_debug_info
void print_operator_debug_info(scp_operand op) {
print_arguments(op);
}
开发者ID:MaximDanilov,项目名称:scp-machine,代码行数:3,代码来源:scp_debugger.c
示例19: main
int main(int argc, char *argv[])
{
struct timert t1;
struct timert *t1Ptr = &t1;
if (timer_start(t1Ptr)) {
exit(-1);
}
process_optlong(argc, argv, msg, &myargument, longopts);
print_arguments(myargument);
// DEBUG_PRINT("%s", "****DEBUG_LOG_ENABLE****");
if (!myargument.filename) {
myargument.filename = "/home/love/dic.txt";
}
int fd;
fd = open(myargument.filename, O_RDONLY);
if (!fd) {
printf("can't open file(%s)\n", myargument.filename);
exit(-1);
}
DEBUG_PRINT("file(%s)opened(%d)", myargument.filename, fd);
FILE *fd_File;
fd_File = fdopen(fd, "r");
if (!fd_File) {
printf("fdopen(fd) error....\n");
exit(-1);
}
int month_no;
char buf[8192] = {};
char *charPtrTmp;
charPtrTmp = &buf;
for ( ; ; ) {
charPtrTmp = fgets(buf, sizeof(buf), fd_File);
if (!charPtrTmp) {
break;
}
if (myargument.mode) {
printf("DEBUG: %s\n", buf);
}
if (strlen(buf) > 1) {
if (myargument.mode)
DEBUG_PRINT("strlen of buf:%d", strlen(buf));
buf[strlen(buf) - 1] = '\0';
month_no = lookup_word(buf, month_names);
if (month_no >= 0) {
printf("found at %2d(%s)\n", month_no, month_names[month_no]);
} else if (myargument.mode) {
printf("%d\t%s\n", month_no, buf);
}
}
}
/* int c; */
/* while((c = getchar()) != EOF) { */
/* putchar(c); */
/* } */
mylib_func1();
if (timer_stop (t1Ptr)) {
exit(-1);
}
int month_names_size = 12;
// DEBUG_PRINT("%s %d", "sizeof month_names", month_names_size);
int i;
for (i = 0; i < month_names_size; i++) {
unsigned int resu;
resu = hash3(month_names[i], sizeof(month_names[i]));
printf("hash(%d) = %x\n", i, resu);
}
int a = 23;
int b = 15;
printf("a=%d\t b=%d\n", a, b);
a = a ^ b;
b = b ^ a;
a = a ^ b;
printf("after swap with ^, a=%d\t b=%d\n", a, b);
printf("\nEND: this program taked %ld useconds!\n",
timer_delta_useconds(t1Ptr));
exit(0);
}
开发者ID:lcmust,项目名称:git6500cgo,代码行数:85,代码来源:learn_c.c
示例20: main
int main(int argc, char *argv[]) {
herr_t err = 0;
int n_threads = omp_get_max_threads();
hid_t kernel_file_id = 0;
hid_t levy_basis_file_id = 0;
hid_t levy_basis_dataset_id = 0;
hid_t levy_basis_dataspace_id = 0;
hid_t output_file_id = 0;
hid_t output_dataset_id = 0;
hid_t output_dataspace_id = 0;
hid_t memspace = 0;
hsize_t n_k = 0;
double *tmp = NULL;
double *k_abscissa = NULL;
double *k_ordinate = NULL;
double *x1 = NULL;
double *x2 = NULL;
double *x3 = NULL;
DEBUGPRINT("### Parsing arguments");
struct arguments args;
initialise_arguments(&args);
argp_parse (&argp, argc, argv, 0, 0, &args);
#ifdef DEBUG
print_arguments(&args);
#endif
DEBUGPRINT("### Reading kernel");
kernel_file_id = H5Fopen(args.kernel_file, H5F_ACC_RDONLY, H5P_DEFAULT);
if (kernel_file_id <= 0) {
printf("Error: Could not open \"%s\".\n", args.kernel_file);
err = -1;
goto cleanup;
}
err = H5LTget_dataset_info(kernel_file_id, "/abscissa", &n_k, NULL, NULL);
if (err < 0) {
printf("Error: Could not read dataset info.\n");
goto cleanup;
}
printf("n_k = %i\n", (int)n_k);
k_abscissa = malloc(n_k * sizeof(double));
k_ordinate = malloc(n_k * sizeof(double));
err = H5LTread_dataset_double(kernel_file_id, "/abscissa", k_abscissa);
err = H5LTread_dataset_double(kernel_file_id, "/ordinate", k_ordinate);
DEBUGPRINT("### Reading Levy basis");
hsize_t dims[4];
hsize_t offset[4];
hsize_t count[4];
levy_basis_file_id = H5Fopen(args.levy_basis_file, H5F_ACC_RDONLY, H5P_DEFAULT);
levy_basis_dataset_id = H5Dopen(levy_basis_file_id, "/levy_basis_realization", H5P_DEFAULT);
levy_basis_dataspace_id = H5Dget_space(levy_basis_dataset_id);
err = H5Sget_simple_extent_dims(levy_basis_dataspace_id, dims, NULL);
if (dims[0] != dims[1] || dims[1] != dims[2]) {
printf("Error: The three dimensions must be equal.\n");
err = -1;
goto cleanup;
}
hsize_t dims_pad[3];
dims_pad[0] = dims[0];
dims_pad[1] = dims[1];
dims_pad[2] = 2 * (dims[2] / 2 + 1);
hsize_t n_x = dims_pad[0] * dims_pad[1] * dims_pad[2];
x1 = malloc(n_x * sizeof(double));
x2 = malloc(n_x * sizeof(double));
x3 = malloc(n_x * sizeof(double));
double *x[] = {x1, x2, x3};
if (!x1 || !x2 || !x3) {
printf("Error: Could not allocate memory for the Levy basis.\n");
err = -1;
goto cleanup;
}
#pragma omp parallel for
for (ptrdiff_t i = 0; i < n_x; i++) {
x1[i] = 0.0;
x2[i] = 0.0;
x3[i] = 0.0;
}
/* Define memory dataspace */
memspace = H5Screate_simple(3, dims_pad, NULL);
offset[0] = offset[1] = offset[2] = 0;
count[0] = dims[0];
count[1] = dims[1];
count[2] = dims[2];
/* Define hyperslab in the memory dataspace */
err = H5Sselect_hyperslab(memspace, H5S_SELECT_SET, offset, NULL, count, NULL);
for (int j = 0; j < 3; j++) {
/* Define hyperslap in the file dataspace */
offset[3] = j;
//.........这里部分代码省略.........
开发者ID:emilhedevang,项目名称:ambit-stochastics,代码行数:101,代码来源:simulate-vector-field.c
注:本文中的print_arguments函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论