Displaying 20 results from an estimated 26 matches for "arg_nam".
Did you mean:
arg_name
2020 Jan 18
1
How to get an object name from C?
...as html by mistake).
Hi,
How can I get from C an object name used as a function argument? I
have sample code in C that gives me access to the name of the function
being called:
SEXP xname(SEXP x)
{
const char *fun_name = CHAR(PRINTNAME(CAR(x)));
x = CDR(x);
const char *arg_name = isNull(TAG(x)) ? "" : CHAR(PRINTNAME(TAG(x)));
Rprintf("fn_name: %s, arg_name: %s\n", fun_name, arg_name);
return R_NilValue;
}
> xname <- function(...) invisible(.External("xname", ...))
>
> x1 = 123
>
> xname(x1)
fn_name: xname...
2007 Feb 16
0
11 commits - libswfdec/swfdec_font.c libswfdec/swfdec_font.h libswfdec/swfdec_js_movie.c libswfdec/swfdec_script.c libswfdec/swfdec_script.h test/.gitignore test/trace
...fun->nvars = 4;
}
@@ -1462,9 +1464,10 @@ swfdec_action_define_function (JSContext
return JS_FALSE;
}
if (preload != 0) {
- script->preloads[i] = preload;
+ preloads[i] = preload;
swfdec_bits_skip_string (&bits);
has_preloads = TRUE;
+ continue;
}
}
arg_name = swfdec_bits_skip_string (&bits);
@@ -1483,9 +1486,9 @@ swfdec_action_define_function (JSContext
return JS_FALSE;
}
}
- if (script->preloads && !has_preloads) {
- g_free (script->preloads);
- script->preloads = NULL;
+ if (preloads && !has_prelo...
2007 Nov 22
0
5 commits - libswfdec/swfdec_as_interpret.c libswfdec/swfdec_bits.c libswfdec/swfdec_bits.h libswfdec/swfdec_debugger.c libswfdec/swfdec_movie.c libswfdec/swfdec_script.c libswfdec/swfdec_sprite_movie.c libswfdec/swfdec_tag.c libswfdec/swfdec_text_field.c
...ame == NULL) {
SWFDEC_ERROR ("could not parse function name");
g_string_free (string, TRUE);
@@ -2879,7 +2879,7 @@ swfdec_action_print_define_function (guint action, const guint8 *data, guint len
preload = swfdec_bits_get_u8 (&bits);
else
preload = 0;
- arg_name = swfdec_bits_get_string_with_version (&bits, 7);
+ arg_name = swfdec_bits_get_string (&bits, 7);
if (preload == 0 && (arg_name == NULL || *arg_name == '\0')) {
SWFDEC_ERROR ("empty argument name not allowed");
g_string_free (string, TRUE);
@...
2016 Jun 27
0
Re: [PATCH] RFC: OCaml tools: add and use a Getopt module
...tra_argspec : Getopt.keys * Getopt.spec * Getopt.doc;
> extra_pod_argval : string option;
> extra_pod_description : string;
> }
> @@ -208,27 +208,33 @@ let dump_pod_options () =
> let args = List.map (
> function
> | (op_name,
> - { extra_argspec = (arg_name,
> - (Arg.Unit _ | Arg.Bool _ | Arg.Set _ | Arg.Clear _),
> + { extra_argspec = (arg_names,
> + (Getopt.Unit _ | Getopt.Set _ | Getopt.Clear _),
> _);
> extra_pod_argval = None;
>...
2016 Jun 24
2
[PATCH] RFC: OCaml tools: add and use a Getopt module
...ec : Arg.key * Arg.spec * Arg.doc;
+ extra_argspec : Getopt.keys * Getopt.spec * Getopt.doc;
extra_pod_argval : string option;
extra_pod_description : string;
}
@@ -208,27 +208,33 @@ let dump_pod_options () =
let args = List.map (
function
| (op_name,
- { extra_argspec = (arg_name,
- (Arg.Unit _ | Arg.Bool _ | Arg.Set _ | Arg.Clear _),
+ { extra_argspec = (arg_names,
+ (Getopt.Unit _ | Getopt.Set _ | Getopt.Clear _),
_);
extra_pod_argval = None;
extra_pod_description = pod...
2016 Jul 18
0
[PATCH v2 2/3] mllib: Use L"..." and S '...' for long and short options.
...sysprep/sysprep_operation.ml
@@ -21,6 +21,7 @@ open Common_utils
open Printf
open Common_gettext.Gettext
+open Getopt.OptionName
class filesystem_side_effects =
object
@@ -215,7 +216,8 @@ let dump_pod_options () =
extra_pod_description = pod }) ->
List.map (
fun arg_name ->
- let heading = sprintf "B<%s>" arg_name in
+ let heading =
+ sprintf "B<%s>" (Getopt.string_of_option_name arg_name) in
arg_name, (op_name, heading, pod)
) arg_names
@@ -228,7 +230,9 @@ let dump_pod_options ()...
2016 Jul 11
2
[PATCH v2] OCaml tools: add and use a Getopt module
...ec : Arg.key * Arg.spec * Arg.doc;
+ extra_argspec : Getopt.keys * Getopt.spec * Getopt.doc;
extra_pod_argval : string option;
extra_pod_description : string;
}
@@ -208,27 +208,33 @@ let dump_pod_options () =
let args = List.map (
function
| (op_name,
- { extra_argspec = (arg_name,
- (Arg.Unit _ | Arg.Bool _ | Arg.Set _ | Arg.Clear _),
+ { extra_argspec = (arg_names,
+ (Getopt.Unit _ | Getopt.Set _ | Getopt.Clear _),
_);
extra_pod_argval = None;
extra_pod_description = pod...
2016 Jul 13
3
[PATCH v3 1/2] OCaml tools: add and use a Getopt module
...ec : Arg.key * Arg.spec * Arg.doc;
+ extra_argspec : Getopt.keys * Getopt.spec * Getopt.doc;
extra_pod_argval : string option;
extra_pod_description : string;
}
@@ -208,30 +208,37 @@ let dump_pod_options () =
let args = List.map (
function
| (op_name,
- { extra_argspec = (arg_name,
- (Arg.Unit _ | Arg.Bool _ | Arg.Set _ | Arg.Clear _),
+ { extra_argspec = (arg_names,
+ (Getopt.Unit _ | Getopt.Set _ | Getopt.Clear _),
_);
extra_pod_argval = None;
extra_pod_description = pod...
2016 Jul 18
4
[PATCH v2 0/3] mllib: Various fixes and changes to Getopt module.
v1 -> v2:
- Further fixes to Getopt int parsing.
- Completed the L/S changes.
- Fixed the test suite so it passes now. Also we don't need the
special-case tests for 64 bit arch.
Rich.
2016 Jul 18
3
[PATCH v4 0/2] mllib: Various fixes and changes to Getopt module.
v3 -> v4:
- Pushed the first patch upstream since it was ACKed.
- Prevent use of M except for the special virt-v2v options.
- Sort the options after added --help etc.
- Make corresponding fixes to the tests.
Rich.
2007 Apr 04
0
Branch 'as' - 4 commits - libswfdec/Makefile.am libswfdec/swfdec_as_context.c libswfdec/swfdec_as_frame.c libswfdec/swfdec_as_interpret.c libswfdec/swfdec_as_interpret.h libswfdec/swfdec_as_object.c libswfdec/swfdec_as_types.c libswfdec/swfdec_as_types.h
...egisters = swfdec_bits_get_u8 (&bits) + 1;
+ flags = swfdec_bits_get_u16 (&bits);
+ preloads = g_new0 (guint8, n_args);
+ } else {
+ script->n_registers = 5;
+ }
+ fun->nvars = script->n_registers;
+ for (i = 0; i < n_args; i++) {
+ JSAtom *atom;
+ const char *arg_name;
+ if (v2) {
+ guint preload = swfdec_bits_get_u8 (&bits);
+ if (preload && preload >= script->n_registers) {
+ SWFDEC_ERROR ("argument %u is preloaded into register %u out of %u",
+ i, preload, script->n_registers);
+ return JS_FALSE;
+ }
+...
2016 Jul 18
4
[PATCH v3 0/3] mllib: Various fixes and changes to Getopt module.
v2 -> v3:
- Add M variant and test it.
Rich.
2007 Jan 31
0
Branch 'interpreter' - 20 commits - autogen.sh configure.ac libswfdec/js libswfdec/swfdec_debug.h libswfdec/swfdec_js.c libswfdec/swfdec_js_color.c libswfdec/swfdec_js_movie.c libswfdec/swfdec_movie.c libswfdec/swfdec_movie.h libswfdec/swfdec_script.c
...+ fun = JS_NewFunction (cx, NULL, n_args, JSFUN_LAMBDA, NULL, NULL);
+ } else {
+ /* named function */
+ fun = JS_NewFunction (cx, NULL, n_args, 0, NULL, function_name);
+ }
+ if (fun == NULL)
+ return JS_FALSE;
+ for (i = 0; i < n_args; i++) {
+ JSAtom *atom;
+ const char *arg_name = swfdec_bits_get_string (&bits);
+ if (arg_name == NULL || *arg_name == '\0') {
+ SWFDEC_ERROR ("empty argument name not allowed");
+ return JS_FALSE;
+ }
+ /* FIXME: check duplicate arguments */
+ atom = js_Atomize (cx, arg_name, strlen (arg_name), 0);...
2008 Mar 18
14
Proposal for an improved API for Sizer (and ToolBar)
...fault value
# e.g. [ [:proportion, 0], [:flag, 0], [:border, 0] ]
def self.args_as_list(args_def, *mixed_args)
# get keyword arguments from mixed_args if supplied, else empty
kwa = mixed_args.last.kind_of?(Hash) ? mixed_args.pop : {}
out_args = []
args_def.each_with_index do | (arg_name, arg_value), i |
if arg = mixed_args[i] # use the supplied list arg
out_args << arg
elsif kwa.key?(arg_name) # use the keyword arg
out_args << kwa[arg_name]
else # use the default argument
out_args << arg_value
end
end
out_a...
2011 Jul 27
2
Plotting a function that includes logical operators
I am trying to plot the following function over the range 0-100
test <- function(t){{
if (t<=10)
x<-t*0
else x<-2*t
}
x
}
when I use plot(test,0,100) the GUI produces the following;
"Warning message:
In if (t <= 10) x <- t * 0 else x <- 2 * t :
the condition has length > 1 and only the first element will be used"
I am confused as when I evaluate the function
2012 Mar 31
3
[PATCH (incomplete)] Rewrite virt-sysprep in OCaml.
This patch is incomplete but it illustrates the idea. virt-sysprep is
rewritten as a modular tool in OCaml.
Only the 'utmp' and 'hostname' operations are implemented at the
moment.
Rich.
2016 Jul 18
4
[PATCH 1/3] mllib: Getopt: point to man page as additional help
On error, point also to the man page of the current tool in addition to
'$TOOL --help'.
---
mllib/getopt-c.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/mllib/getopt-c.c b/mllib/getopt-c.c
index bf40f91..3efd5d3 100644
--- a/mllib/getopt-c.c
+++ b/mllib/getopt-c.c
@@ -69,8 +69,8 @@ cleanup_option_list (void *ptr)
static void __attribute__((noreturn))
2007 Mar 28
0
Branch 'as' - 3 commits - libswfdec/Makefile.am libswfdec/swfdec_as_context.c libswfdec/swfdec_as_context.h libswfdec/swfdec_as_frame.c libswfdec/swfdec_as_frame.h libswfdec/swfdec_as_object.c libswfdec/swfdec_as_object.h libswfdec/swfdec_as_types.c
...et_u8 (&bits) + 1;
flags = swfdec_bits_get_u16 (&bits);
preloads = g_new0 (guint8, n_args);
} else {
- fun->nvars = 5;
+ script->n_registers = 5;
}
+ fun->nvars = script->n_registers;
for (i = 0; i < n_args; i++) {
JSAtom *atom;
const char *arg_name;
if (v2) {
guint preload = swfdec_bits_get_u8 (&bits);
- if (preload && preload >= fun->nvars) {
+ if (preload && preload >= script->n_registers) {
SWFDEC_ERROR ("argument %u is preloaded into register %u out of %u",
- i, prelo...
2019 Apr 08
0
[PATCH v4 2/7] common: Bundle the libvirt-ocaml library for use by virt-v2v
...elsif ($_ eq "pool") { "virStoragePoolPtr" }
+ elsif ($_ eq "vol") { "virStorageVolPtr" }
+ elsif ($_ eq "sec") { "virSecretPtr" }
+ else {
+ die "unknown short name $_"
+ }
+}
+
+# OCaml argument names.
+
+sub gen_arg_names
+{
+ my $sig = shift;
+
+ if ($sig =~ /^(\w+) : string$/) {
+ ( "$1v" )
+ } elsif ($sig =~ /^(\w+) : static string$/) {
+ ( "$1v" )
+ } elsif ($sig =~ /^(\w+) : int$/) {
+ ( "$1v" )
+ } elsif ($sig =~ /^(\w+) : uuid$/) {
+ ( "$1v" )
+ } el...
2019 Dec 16
3
[v2v PATCH 0/2] Move libvirt-ocaml copy to v2v repo
libvirt-ocaml is used only by virt-v2v, so move it to this repository,
instead of having it around in the common submodule.
The removal from common will happen later.
Pino Toscano (2):
common: Bundle the libvirt-ocaml library for use by virt-v2v
build: switch embedded copy of libvirt-ocaml
.gitignore | 2 +
3rdparty/libvirt-ocaml/Makefile.am |