12-08-2008
Well there is one major point in your code that I completely missed before. I mistakenly thought crc_s was of type char** when it actually is of type int**. Casting char** to int** won't work (most likely crash the program with a SIGBUS) as char** addresses are not guaranted to be aligned on a word boundary.
10 More Discussions You Might Find Interesting
1. UNIX for Advanced & Expert Users
Hi all,
In windows script, passing arguments can be done in both "call by value" and
"call by reference". Refer
http://www.commandline.co.uk/lib/treeview/index.php
Can we have call by reference in unix too?
Thanks in adavance,
Sonal. (5 Replies)
Discussion started by: sonaluphale
5 Replies
2. UNIX for Dummies Questions & Answers
Hi,
I have a master BASH shell script where I define a bunch of variables:
$var1=why
$var2=is
$var3=(this so hard)
I would then like to call another shell script and pass these variables to it:
$script2 $var1 $var2 $var3
This works fine for var1 and var2. However, var3 is an array,... (9 Replies)
Discussion started by: msb65
9 Replies
3. Shell Programming and Scripting
Hello,
Please tell me if there is a better way to get the number of elements from an array that is passed to a function.
This is what works on Solaris 8 (ksh) but it looks odd:
loop_array() {
array_name=$2
b1='\${\#'
b2='}'
nr_elements=`eval echo... (6 Replies)
Discussion started by: majormark
6 Replies
4. UNIX for Dummies Questions & Answers
Hi experts,
I am here again with another Issue.
I need to pass the array as parameter / argument to another script.
I tried it as follows . ( I got this idea from the link )
$ cat test1.sh
#! /usr/bin/ksh
set -a arr1
echo "...In Test1...."
arr1="APPS_DEV"
arr1="TEST_DEV"
echo... (16 Replies)
Discussion started by: rajavu
16 Replies
5. Shell Programming and Scripting
Let me know if there is a way to pass array to a funtion in ksh script.
function isPresent
{
typeset member
member=$1
dbList=$2
echo '$1:' $1
echo '$2' $dbList
The array will be at the second position....something like this
isPresent 12 <array>
if
then
echo... (3 Replies)
Discussion started by: prasperl
3 Replies
6. Shell Programming and Scripting
Hi ,
I have a script which is using a text file as I/P.
I want a code where it reads n lines from this file and pass the parameters to a function and now this script should run in such a way where a function can be called in parallel with different parameters. Please find below my script, it... (1 Reply)
Discussion started by: Ravindra Swan
1 Replies
7. Shell Programming and Scripting
I have a question on how can I assign a output of a function to a variable which is executed in background.
Here is my example
$ cat sample_program.sh
#!/bin/ksh
exec_func () {
sleep 1
v=`expr $1 + 100`
print $v
}
export OUT_ARR
date
for i in 1 2
do
OUT_ARR=`exec_func $i` &... (1 Reply)
Discussion started by: mohan_kumarcs
1 Replies
8. Shell Programming and Scripting
Hi All
I have multiple arrays like below.
set -A val1 1 2 4 5
set -A val2 a b c d
.
.
.
Now i would like to pass the individual arrays one by one to a function and display/ do some action.
Note : I am using ksh
Can you please advise any solution...
Thanks in advance. (7 Replies)
Discussion started by: Girish19
7 Replies
9. UNIX for Dummies Questions & Answers
Hi,
I am creating filesystem for block device, but I want to pass array value one by one acording to block device count.
$tmp1 = block device count 3
$blockdevice =
So I want to first pass sdb1 alone in loop, how to take only block device seprately from $blockdevice array. (1 Reply)
Discussion started by: stew
1 Replies
10. Programming
Hello,
I think there's an easier way to do this but can't seem to recall but given an array of animals and an initial value is a random index in the array, here it's 3.
3,4,5,4,3,2,1,0,1,2,3,4,5,4,3,2,1,0... inifinite repeat
a quick brute force solution i came up with was two functions, i... (6 Replies)
Discussion started by: f77hack
6 Replies
LEARN ABOUT DEBIAN
xpaclient
xpaclient(3) SAORD Documentation xpaclient(3)
NAME
XPAClient - The XPA Client-side Programming Interface
SYNOPSIS
A description of the XPA client-side programming interface.
DESCRIPTION
Introduction to XPA Client Programming
Sending/receiving data to/from an XPA access point is easy: you generally only need to call the XPAGet() or XPASet() subroutines.
#include <xpa.h>
int XPAGet(XPA xpa,
char *template, char *paramlist, char *mode,
char **bufs, int *lens, char **names, char **messages, int n);
int XPASet(XPA xpa,
char *template, char *paramlist, char *mode,
char *buf, int len, char **names, char **messages, int n);
int XPAInfo(XPA xpa,
char *template, char *paramlist, char *mode,
char **names, char **messages, int n);
int XPAAccess(XPA xpa,
char *template, char *paramlist, char *mode,
char **names, char **messages, int n);
int XPAGetFd(XPA xpa,
char *template, char *paramlist, char *mode,
int *fds, char **names, char **messages, int n);
int XPASetFd(XPA xpa,
char *template, char *paramlist, char *mode,
int fd, char **names, char **messages, int n);
XPA XPAOpen(char *mode);
void XPAClose(XPA xpa);
int XPANSLookup(XPA xpa,
char *template, char *type,
char ***classes, char ***names, char ***methods, char ***infos);
Introduction
To use the XPA application programming interface, a software developer generally will include the xpa.h definitions file:
#include <xpa.h>
in the software module that defines or accesses an XPA access point and then will link against the libxpa.a library:
gcc -o foo foo.c libxpa.a
XPA has been compiled using both C and C++ compilers.
Client communication with XPA public access points generally is accomplished using XPAGet() or XPASet() within a program (or xpaget and
xpaset at the command line). Both routines require specification of the name of the access point. If a template is used to specify the
access point name (e.g., "ds9*"), then communication will take place with all servers matching that template.
SEE ALSO
See xpa(7) for a list of XPA help pages
version 2.1.14 June 7, 2012 xpaclient(3)