Sponsored Content
Top Forums Shell Programming and Scripting [Bash]Function returning a boolean Post 302311737 by dolphin06 on Wednesday 29th of April 2009 11:31:45 AM
Old 04-29-2009
Alright its working now that i add the comparison operator.
Thanks guys.
 

10 More Discussions You Might Find Interesting

1. Programming

string returning function

I have two string returning function in ESQL/C char *segment_name(lbuffer) char *lbuffer; {..... and char *get_bpdvalue(f_name) char *f_name; {...... both declared above main() char *get_bpdvalue(); char *segment_name(); my problem is segment_name works on sprintf and strcpy... (5 Replies)
Discussion started by: jisc
5 Replies

2. Programming

create a thread from a returning function

hi all, my requirement is to create a thread by calling another function. i.e i dont call pthread_create directly from main, but by calling another function (createThd - below ), from main. Example: void *thread_function(void *arg) { /* thread function */ int i; rc =... (3 Replies)
Discussion started by: wolwy_pete
3 Replies

3. Shell Programming and Scripting

returning from a function

Hi all, I am very new to BASH shell programming. I need to return an integer from a function to the caller function. I did this: but it keeps giving me wrong return: Can someone help me out here, please? Thanks (2 Replies)
Discussion started by: alirezan
2 Replies

4. Shell Programming and Scripting

Returning the name of function used

Hi All In my script, I can call on several functions. I have a logging function that is called by any of these functions. What I would like is some way of identifying which function I am using and pass this to the log function as some parameter. Is there some built in command or way of... (3 Replies)
Discussion started by: kingpin2502
3 Replies

5. Programming

Function Returning Pointer

Hi guys. how a functions such fdopen, ... can return pointer? are these functions use static memory(variables)? (6 Replies)
Discussion started by: majid.merkava
6 Replies

6. Programming

Returning local string value from a function in C

Hi, If I have a code like this, what are the potential problems do you see? const char* const retString() { return "hello"; /* string literal */ } My questions are: a) Since the string literal which is already a constant read only data (cannot be... (4 Replies)
Discussion started by: royalibrahim
4 Replies

7. Shell Programming and Scripting

boolean expression in bash

Can someone, please, help me to make this condition valid/accepted in bash? I really cannot. I'm stuck with the brackets... This one tells me: missing `]' if ]; then # NOTIFY ERROR... fi And... I'd also appreciate a link to bash documents that explain these things. All... (2 Replies)
Discussion started by: mamboknave
2 Replies

8. Programming

Malloc function returning NULL

Hi All, I am using malloc function for allocating dynamic memory. When I am using below code on Linux server its working fine, but When I am trying the same code on HP UNIX server its returning NULL. below is a fragment of code in which it is giving problem. tmp = (format_tree... (4 Replies)
Discussion started by: Taher Saifuddin
4 Replies

9. Shell Programming and Scripting

Using boolean expression Bash script

Hi, Im trying to write a Bash script that calculates the least common subnet for two address. Theoretical: I have to change IP from decimal to binary, then apply XNOR on the two IPs. I tried to write this: #!/bin/bash echo "Ebter the first ip" read ip1 echo "Enter the second ip" read... (7 Replies)
Discussion started by: Miron
7 Replies

10. Shell Programming and Scripting

Returning an exit code from a bash function

How to return a exit code from a function and use it in conditional? I tried the following but it does not seem to work. tests.sh: if test ./load.sh ; then echo "0" else echo "1" fi load.sh: return 1; from command line: $ ./tests.sh 0 I was expecting it to output "1"... (17 Replies)
Discussion started by: wolfv
17 Replies
__gnu_cxx::_Pointer_adapter< _Storage_policy >(3)	     Library Functions Manual		 __gnu_cxx::_Pointer_adapter< _Storage_policy >(3)

NAME
__gnu_cxx::_Pointer_adapter< _Storage_policy > - SYNOPSIS
Inherits _Storage_policy. Public Types typedef std::ptrdiff_t difference_type typedef _Storage_policy::element_type element_type" typedef std::random_access_iterator_tag iterator_category" typedef _Pointer_adapter pointer typedef _Reference_type < element_type >::reference reference" typedef _Unqualified_type < element_type >::type value_type" Public Member Functions _Pointer_adapter (element_type *__arg=0) _Pointer_adapter (const _Pointer_adapter &__arg) template<typename _Up > _Pointer_adapter (_Up *__arg) template<typename _Up > _Pointer_adapter (const _Pointer_adapter< _Up > &__arg) operator __unspecified_bool_type () const bool operator! () const reference operator* () const _Pointer_adapter & operator++ () _Pointer_adapter operator++ (int) _Pointer_adapter & operator+= (short __offset) _Pointer_adapter & operator+= (unsigned short __offset) _Pointer_adapter & operator+= (int __offset) _Pointer_adapter & operator+= (unsigned int __offset) _Pointer_adapter & operator+= (long __offset) _Pointer_adapter & operator+= (unsigned long __offset) template<typename _Up > std::ptrdiff_t operator- (const _Pointer_adapter< _Up > &__rhs) const _Pointer_adapter & operator-- () _Pointer_adapter operator-- (int) _Pointer_adapter & operator-= (short __offset) _Pointer_adapter & operator-= (unsigned short __offset) _Pointer_adapter & operator-= (int __offset) _Pointer_adapter & operator-= (unsigned int __offset) _Pointer_adapter & operator-= (long __offset) _Pointer_adapter & operator-= (unsigned long __offset) element_type * operator-> () const _Pointer_adapter & operator= (const _Pointer_adapter &__arg) template<typename _Up > _Pointer_adapter & operator= (const _Pointer_adapter< _Up > &__arg) template<typename _Up > _Pointer_adapter & operator= (_Up *__arg) reference operator[] (std::ptrdiff_t __index) const Friends _Pointer_adapter operator+ (const _Pointer_adapter &__lhs, short __offset) _Pointer_adapter operator+ (short __offset, const _Pointer_adapter &__rhs) _Pointer_adapter operator+ (const _Pointer_adapter &__lhs, unsigned short __offset) _Pointer_adapter operator+ (unsigned short __offset, const _Pointer_adapter &__rhs) _Pointer_adapter operator+ (const _Pointer_adapter &__lhs, int __offset) _Pointer_adapter operator+ (int __offset, const _Pointer_adapter &__rhs) _Pointer_adapter operator+ (const _Pointer_adapter &__lhs, unsigned int __offset) _Pointer_adapter operator+ (unsigned int __offset, const _Pointer_adapter &__rhs) _Pointer_adapter operator+ (const _Pointer_adapter &__lhs, long __offset) _Pointer_adapter operator+ (long __offset, const _Pointer_adapter &__rhs) _Pointer_adapter operator+ (unsigned long __offset, const _Pointer_adapter &__rhs) _Pointer_adapter operator+ (const _Pointer_adapter &__lhs, unsigned long __offset) std::ptrdiff_t operator- (const _Pointer_adapter &__lhs, element_type *__rhs) std::ptrdiff_t operator- (element_type *__lhs, const _Pointer_adapter &__rhs) template<typename _Up > std::ptrdiff_t operator- (const _Pointer_adapter &__lhs, _Up *__rhs) template<typename _Up > std::ptrdiff_t operator- (_Up *__lhs, const _Pointer_adapter &__rhs) _Pointer_adapter operator- (const _Pointer_adapter &__lhs, short __offset) _Pointer_adapter operator- (const _Pointer_adapter &__lhs, unsigned short __offset) _Pointer_adapter operator- (const _Pointer_adapter &__lhs, int __offset) _Pointer_adapter operator- (const _Pointer_adapter &__lhs, unsigned int __offset) _Pointer_adapter operator- (const _Pointer_adapter &__lhs, long __offset) _Pointer_adapter operator- (const _Pointer_adapter &__lhs, unsigned long __offset) Detailed Description template<typename _Storage_policy>class __gnu_cxx::_Pointer_adapter< _Storage_policy > The following provides an 'alternative pointer' that works with the containers when specified as the pointer typedef of the allocator. The pointer type used with the containers doesn't have to be this class, but it must support the implicit conversions, pointer arithmetic, comparison operators, etc. that are supported by this class, and avoid raising compile-time ambiguities. Because creating a working pointer can be challenging, this pointer template was designed to wrapper an easier storage policy type, so that it becomes reusable for creating other pointer types. A key point of this class is also that it allows container writers to 'assume' Allocator::pointer is a typedef for a normal pointer. This class supports most of the conventions of a true pointer, and can, for instance handle implicit conversion to const and base class pointer types. The only impositions on container writers to support extended pointers are: 1) use the Allocator::pointer typedef appropriately for pointer types. 2) if you need pointer casting, use the __pointer_cast<> functions from ext/cast.h. This allows pointer cast operations to be overloaded as necessary by custom pointers. Note: The const qualifier works with this pointer adapter as follows: _Tp* == _Pointer_adapter<_Std_pointer_impl<_Tp> >; const _Tp* == _Pointer_adapter<_Std_pointer_impl<const _Tp> >; _Tp* const == const _Pointer_adapter<_Std_pointer_impl<_Tp> >; const _Tp* const == const _Pointer_adapter<_Std_pointer_impl<const _Tp> >; Definition at line 281 of file pointer.h. Author Generated automatically by Doxygen for libstdc++ from the source code. libstdc++ Tue Jun 10 2014 __gnu_cxx::_Pointer_adapter< _Storage_policy >(3)
All times are GMT -4. The time now is 11:54 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy