Sponsored Content
Full Discussion: add a file.c in a program.
Top Forums Programming add a file.c in a program. Post 302327034 by Corona688 on Friday 19th of June 2009 11:25:39 AM
Old 06-19-2009
It is not linking new_function.o in with the rest of the objects. I believe you need to edit Makefile.in, then run ./configure again to make the changes stick.
 

10 More Discussions You Might Find Interesting

1. Windows & DOS: Issues & Discussions

program to rename file name

I need a program to rename file name. so the input to run the program would be RenameFiles //server1/Folder1/folder2/test*er.doc program would return: ++server1+Folder1+folder2+test*er.doc Can some one please help me? (1 Reply)
Discussion started by: randyzapata
1 Replies

2. Shell Programming and Scripting

Joining program to one batch file

I created a batch file (./mybatch) that need to run few programs at a sequnece but i need a command like the DOS call command in order to return to the main batch file to proceed the sequence example: cd /dir1/path/dir2 invoke program1 cd /dir3/path2/ <--- i want to return here (2 Replies)
Discussion started by: eynkesef
2 Replies

3. UNIX for Dummies Questions & Answers

AWK Program File Help

I have some .dat files that I cannot open and read the data. It is an awk program file, and my question would be to you all is there a way to convert this awk file to ascii text? Thanks (10 Replies)
Discussion started by: ryangfm
10 Replies

4. UNIX for Dummies Questions & Answers

Script to open program and send/execute command in program

Hi, i want to write a script that executes a program (exec?) . this program then requires a filename as input. how do i give it this input in the script so the program will be complete run and close by the script. e.g. exec prog.exe program then asks for filename "enter filename:"... (1 Reply)
Discussion started by: tuathan
1 Replies

5. Shell Programming and Scripting

awk program for file comparison

Hello there, I'm trying to write an awk program in bash shell with the following three input files: File 1 1001 1 2 3 1002 4 5 6 1003 7 8 9 1004 10 11 12 File 2 1001 11 22 33 1002 44 55 66 1004 100 111 122 ... (4 Replies)
Discussion started by: kbirde
4 Replies

6. Programming

urgent help with file manipulation program

Hey, i am trying to write a program that takes multiple files as command line arguments, then outputs them to a single file. i also need the option to read them back out again. essentially what i am trying to create is an archiver, however, a very simple one. The program i have accomplished so far... (1 Reply)
Discussion started by: wezzyb
1 Replies

7. Shell Programming and Scripting

Short program to select lines from a file based on a second file

Hello, I use UBUNTU 12.04. I want to write a short program using awk to select some lines in a file based on a second file. My first file has this format with about 400,000 lines and 47 fields: SNP1 1 12.1 SNP2 1 13.2 SNP3 1 45.2 SNP4 1 23.4 My second file has this format: SNP2 SNP3... (1 Reply)
Discussion started by: Homa
1 Replies

8. Shell Programming and Scripting

Run a program-print parameters to output file-replace op file contents with max 4th col

Hi Friends, This is the only solution to my task. So, any help is highly appreciated. I have a file cat input1.bed chr1 100 200 abc chr1 120 300 def chr1 145 226 ghi chr2 567 600 unix Now, I have another file by name input2.bed (This file is a binary file not readable by the... (7 Replies)
Discussion started by: jacobs.smith
7 Replies

9. Programming

File Program issue in c

B17 -> B19 ; B17 -> B21 ; B18 -> B19 ; Can any one help with the pointer solution to check for this -> symbol and one it finds the symbol it should move behind 4 characters and store the string B17 in an array and then move 4 characters ahead and similarly save B21 likewise for each line... (7 Replies)
Discussion started by: zinat
7 Replies

10. UNIX for Advanced & Expert Users

Last touched file by a specific program ?

i have a directory where all .csv files are available. i have 3 perl programs(ex: a.pl,b.pl,c.pl) which continuously runs every 1 minute to scan all files in that directory. now i have 2 questions 1) how can i write an app lock on that particular folder to make sure only one program will scan... (4 Replies)
Discussion started by: sbjv
4 Replies
JE::Object::Function(3pm)				User Contributed Perl Documentation				 JE::Object::Function(3pm)

NAME
JE::Object::Function - JavaScript function class SYNOPSIS
use JE::Object::Function; # simple constructors: $f = new JE::Object::Function $scope, @argnames, $function; $f = new JE::Object::Function $scope, $function; # constructor that lets you do anything: $f = new JE::Object::Function { name => $name, scope => $scope, length => $number_of_args, argnames => [ @argnames ], function => $function, function_args => [ $arglist ], constructor => sub { ... }, constructor_args => [ $arglist ], downgrade => 0, }; $f->(@args); $f->call_with($obj, @args); DESCRIPTION
All JavaScript functions are instances of this class. If you want to call a JavaScript function from Perl, just treat is as a coderef ("$f->()") or use the "call_with" method ("$f->call_with($obj, @args)") if you want to specify the invocant (the 'this' value). OBJECT CREATION
new Creates and returns a new function (see the next few items for its usage). The new function will have a "prototype" property that is an object with a "constructor" property that refers to the function itself. The return value of the function will be upgraded if necessary (see UPGRADING VALUES in the JE::Types man page), which is why "new" has to be given a reference to the global object or the scope chain. (But see also "new_function" in JE and "new_method" in JE.) A function written in Perl can return an lvalue if it wants to. Use "new JE::LValue($object, 'property name')" to create it. To create an lvalue that refers to a variable visible within the function's scope, use "$scope->var('varname')" (this assumes that you have shifted the scope object off @_ and called it $scope; you also need to call "new" with hashref syntax and specify the "function_args" [see below]). new JE::Object::Function $scope_or_global, @argnames, $function; new JE::Object::Function $scope_or_global, $function; $scope_or_global is one of the following: - a global (JE) object - a scope chain (JE::Scope) object @argnames is a list of argument names, that JavaScript functions use to access the arguments. $function is one of - a string containing the body of the function (JavaScript code) - a JE::Code object - a coderef new JE::Object::Function { ... }; This is the big fancy way of creating a function that lets you do anything. The elements of the hash ref passed to "new" are as follows (they are all optional, except for "scope"): name The name of the function. This is used only by "toString". scope A global object or scope chain object. length The number of arguments expected. If this is omitted, the number of elements of "argnames" will be used. If that is omitted, 0 will be used. Note that this does not cause the argument list to be checked. It only provides the "length" property (and possibly, later, an "arity" property) for inquisitive scripts to look at. argnames An array ref containing the variable names that a JS function uses to access the arguments. function A coderef, string of JS code or JE::Code object (the body of the function). This will be run when the function is called from JavaScript without the "new" keyword, or from Perl via the "call" method. function_args This only applies when "function" is a code ref. "function_args" is an array ref, the elements being strings that indicated what arguments should be passed to the Perl subroutine. The strings, and what they mean, are as follows: self the function object itself scope the scope chain global the global object this the invocant args the arguments passed to the function (as individual arguments) [args] the arguments passed to the function (as an array ref) If "function_args" is omitted, 'args' will be assumed. constructor A code ref that creates and initialises a new object. This is called when the "new" keyword is used in JavaScript, or when the "construct" method is used in Perl. If this is omitted, when "new" or "construct" is used, a new empty object will be created and passed to the sub specified under "function" as its 'this' value. The return value of the sub will be returned if it is an object; the (possibly modified) object originally passed to the function will be returned otherwise. constructor_args Like "function_args", but the 'this' string does not apply. If "constructor_args" is omitted, the arg list will be set to "[ qw( scope args ) ]" (this might change). This is completely ignored if "constructor" is omitted. downgrade (not yet implemented) This applies only when "function" or "constructor" is a code ref. This is a boolean indicating whether the arguments to the function should have their "value" methods called automatically.; i.e., as though "map $_->value, @args" were used instead of @args. no_proto If this is set to true, the returned function will have no "prototype" property. METHODS
new JE::Object::Function See "OBJECT CREATION". call_with ( $obj, @args ) Calls a function with the given arguments. The $obj becomes the function's invocant. This method is intended for general use from the Perl side. The arguments (including $obj) are automatically upgraded. call ( @args ) This method, intended mainly for internal use, calls a function with the given arguments, without upgrading them. The invocant (the 'this' value) will be the global object. This is just a wrapper around "apply". This method is very badly named and will probably be renamed in a future version. Does anyone have any suggestions? construct This method, likewise intended mainly for internal use, calls the constructor, if this function has one (functions written in JS don't have this). Otherwise, an object will be created and passed to the function as its invocant. The return value of the function will be discarded, and the object (possibly modified) will be returned instead. apply ( $obj, @args ) This method, intended mainly for internal use just like the two above, calls the function with $obj as the invocant and @args as the args. No upgrading occurs. This method is very badly named and will probably be renamed in a future version. Does anyone have any suggestions? typeof This returns the string 'function'. class This returns the string 'Function'. value Not yet implemented. OVERLOADING
You can use a JE::Object::Function as a coderef. The sub returned simply invokes the "call" method, so the following are equivalent: $function->call( $function->global->upgrade(@args) ) $function->(@args) The stringification, numification, boolification, and hash dereference ops are also overloaded. See JE::Object, which this class inherits from. SEE ALSO
JE JE::Object JE::Types JE::Scope JE::LValue perl v5.14.2 2012-03-18 JE::Object::Function(3pm)
All times are GMT -4. The time now is 11:13 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy