Sponsored Content
Full Discussion: Functions
Top Forums Programming Functions Post 302565118 by uday.sena.m on Monday 17th of October 2011 03:11:19 AM
Old 10-17-2011
Data Functions

Hi All,

Can any one help me.
I am calling in a function2 with string as parameter from function1, the function1 gives 3 values. how i get the 3 values from funciton2 to function1. i have to give a return or something.
thanks in advance.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Regarding functions

Hi, I have a function or script like this. show() { echo "Hi" } | tee -a log show This creates a logfile and prints Hi in it. Now when I try to do the same for sql like this: show() { sqlplus -s scott/tiger<<! select * from details; ! } | tee -a log show Then it gives me a... (2 Replies)
Discussion started by: sendhilmani
2 Replies

2. Shell Programming and Scripting

functions in

hi could anybody please suggest me how to put a function memory for particular user. say i am a user rao. want have a function foo in memory . i have done this .typed the function function in the shell it worked for the session.but next time i do login its not there . i can i have a... (6 Replies)
Discussion started by: Raom
6 Replies

3. Shell Programming and Scripting

Use of functions

Hi my shell is tcsh can I have functions in my shell scripting? Is the below shell script correct. Can I have two functions and call one of them as required. ---------- echo "functions" f1 f1 () { echo "hello" } f2 () (1 Reply)
Discussion started by: amitrajvarma
1 Replies

4. Programming

using c++ and c standard I/O functions

Is it not a healthy practice to mix C and C++ standard I/O functions together e.g. string name; // this is a declared instance of the string class in C++ printf("\nPlease enter your name: "); cin >> name; I did something similar in a program Im designing, and used it several... (1 Reply)
Discussion started by: JamesGoh
1 Replies

5. Shell Programming and Scripting

functions

I have korn shells where I want to create a function passing $1 to a function , determine my $STAT_ENV value, set the paths and return the paths for STATSH,STATPRM,STATSQR,STATSQL,STATCTL TO BE USED IN THE UNIX SCRIPT THE CALLED THE fucnction in the first place. Can someone tell me the best... (2 Replies)
Discussion started by: TimHortons
2 Replies

6. Shell Programming and Scripting

Need a little help with functions

I'm semi new to unix/linux and am trying to convert a program I wrote in C++ to a bash script. It's a program that prints Fibonacci's series. I have found scripts that will do it, but I'm trying persistently to get this one to work. The problem occurs when I try to return a value from the function.... (3 Replies)
Discussion started by: Glowworm
3 Replies

7. UNIX for Dummies Questions & Answers

Help with functions

Hi, I am exploring with defining functions in my BASH shell scripts. However, I am bit confused about how to pass parameters to my functions. I was under the impression that you must do something like the following: Define a function called "sample_function": function sample_function {... (3 Replies)
Discussion started by: msb65
3 Replies

8. Shell Programming and Scripting

i think i need functions ?

Hi, im making a little script but need some help Code i have so far is read -p 'Bot Nickname:' ecnick read -p 'Bot Username:' ecusername read -p 'Bot Realname:' ecrealname read -p 'Your Email:' ecemail echo '' echo Your bots nickname is set to $ecnick echo Your bots username is set to... (2 Replies)
Discussion started by: Gemster
2 Replies

9. UNIX for Dummies Questions & Answers

== vs -eq and functions

Hey I have a question.... what is the difference between using == vs -eq when testing in WHILE loops. I use the following test that only worked with == signs.... if why do i need == and not -eq? 2. I need to re-use some code in a couple places in this script. is functions my best... (5 Replies)
Discussion started by: danieldcc
5 Replies

10. Shell Programming and Scripting

How to execute functions or initiate functions as command line parameters for below requirement?

I have 7 functions those need to be executed as command line inputs, I tried with below code it’s not executing function. If I run the ./script 2 then fun2 should execute , how to initiate that function I tried case and if else also, how to initiate function from command line if then... (8 Replies)
Discussion started by: saku
8 Replies
Glib::Object::Introspection(3pm)			User Contributed Perl Documentation			  Glib::Object::Introspection(3pm)

NAME
Glib::Object::Introspection - Dynamically create Perl language bindings SYNOPSIS
use Glib::Object::Introspection; Glib::Object::Introspection->setup( basename => 'Gtk', version => '3.0', package => 'Gtk3'); # now GtkWindow, to mention just one example, is available as # Gtk3::Window, and you can call gtk_window_new as Gtk3::Window->new ABSTRACT
Glib::Object::Introspection uses the gobject-introspection and libffi projects to dynamically create Perl bindings for a wide variety of libraries. Examples include gtk+, webkit, libsoup and many more. DESCRIPTION
"Glib::Object::Introspection->setup" To allow Glib::Object::Introspection to create bindings for a library, it must have installed a typelib file, for example "$prefix/lib/girepository-1.0/Gtk-3.0.typelib". In your code you then simply call "Glib::Object::Introspection->setup" to set everything up. This method takes a couple of key-value pairs as arguments. These three are mandatory: basename => $basename The basename of the library that should be wrapped. If your typelib is called "Gtk-3.0.typelib", then the basename is 'Gtk'. version => $version The particular version of the library that should be wrapped, in string form. For "Gtk-3.0.typelib", it is '3.0'. package => $package The name of the Perl package where every class and method of the library should be rooted. If a library with basename 'Gtk' contains an object 'GtkWindow', and you pick as the package 'Gtk3', then that object will be available as 'Gtk3::Window'. The rest are optional: search_path => $search_path A path that should be used when looking for typelibs. If you use typelibs from system directories, or if your environment is set up correctly, then this should not be necessary. name_corrections => { auto_name => new_name, ... } A hash ref that is used to rename functions and methods. Use this if you don't like the automatically generated mapping for a function or method. For example, if "g_file_hash" is automatically represented as "Glib::IO::file_hash" but you want "Glib::IO::File::hash" then pass name_corrections => { 'Glib::IO::file_hash' => 'Glib::IO::File::hash' } class_static_methods => [ function1, ... ] An array ref of function names that you want to be treated as class-static methods. That is, if you want be able to call "Gtk3::Window::list_toplevels" as "Gtk3::Window->list_toplevels", then pass class_static_methods => [ 'Gtk3::Window::list_toplevels' ] The function names refer to those after name corrections. flatten_array_ref_return_for => [ function1, ... ] An array ref of function names that return an array ref that you want to be flattened so that they return plain lists. For example flatten_array_ref_return_for => [ 'Gtk3::Window::list_toplevels' ] The function names refer to those after name corrections. Functions occuring in "flatten_array_ref_return_for" may also occur in "class_static_methods". handle_sentinel_boolean_for => [ function1, ... ] An array ref of function names that return multiple values, the first of which is to be interpreted as indicating whether the rest of the returned values are valid. This frequently occurs with functions that have out arguments; the boolean then indicates whether the out arguments have been written. With "handle_sentinel_boolean_for", the first return value is taken to be the sentinel boolean. If it is true, the rest of the original return values will be returned, and otherwise an empty list will be returned. handle_sentinel_boolean_for => [ 'Gtk3::TreeSelection::get_selected' ] The function names refer to those after name corrections. Functions occuring in "handle_sentinel_boolean_for" may also occur in "class_static_methods". "Glib::Object::Introspection->invoke" To invoke specific functions manually, you can use the low-level "Glib::Object::Introspection->invoke". Glib::Object::Introspection->invoke( $basename, $namespace, $function, @args) o $basename is the basename of a library, like 'Gtk'. o $namespace refers to a namespace inside that library, like 'Window'. Use undef here if you want to call a library-global function. o $function is the name of the function you want to invoke. It can also refer to the name of a constant. o @args are the arguments that should be passed to the function. For a method, this should include the invocant. For a constructor, this should include the package name. "Glib::Object::Introspection->invoke" returns whatever the function being invoked returns. Overrides To override the behavior of a specific function or method, create an appropriately named sub in the correct package and have it call "Glib::Object::Introspection->invoke". Say you want to override "Gtk3::Window::list_toplevels", then do this: sub Gtk3::Window::list_toplevels { # ...do something... my $ref = Glib::Object::Introspection->invoke ( 'Gtk', 'Window', 'list_toplevels', @_); # ...do something... return wantarray ? @$ref : $ref->[$#$ref]; } The sub's name and package must be those after name corrections. Converting a Perl variable to a GValue If you need to marshal into a GValue, then Glib::Object::Introspection cannot do this automatically because the type information is missing. If you do have this information in your module, however, you can use Glib::Object::Introspection::GValueWrapper to do the conversion. In the wrapper for a function that expects a GValue, do this: ... my $type = ...; # somehow get the package name that # corresponds to the correct GType my $real_value = Glib::Object::Introspection::GValueWrapper->new ($type, $value); # now use Glib::Object::Introspection->invoke and # substitute $real_value where you'd use $value ... SEE ALSO
gobject-introspection: <http://live.gnome.org/GObjectIntrospection> libffi: <http://sourceware.org/libffi/> AUTHORS
Emmanuele Bassi <ebassi at linux intel com> muppet <scott asofyet org> Torsten Schoenfeld <kaffeetisch at gmx de> LICENSE
This library is free software; you can redistribute it and/or modify it under the terms of the Lesser General Public License (LGPL). For more information, see http://www.fsf.org/licenses/lgpl.txt perl v5.14.2 2012-05-21 Glib::Object::Introspection(3pm)
All times are GMT -4. The time now is 12:53 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy