Sponsored Content
Top Forums Programming Changing value inside function Post 302639823 by kristinu on Sunday 13th of May 2012 09:26:03 AM
Old 05-13-2012
Changing value inside function

I have the following code and want to update shiftDesc inside the function. Is it correct to declare the argument as:

Code:

int shiftDesc
Code:
void prValue_vd(
  FILE*  stream,           // name of output stream
  int  shift,              // amount of shift to the right
  const char*  value,      // value associated with argument action key
  int  shiftDesc,          // additional shift to the description
  const char*  desc ) {    // description

  shiftDesc = shiftDesc + 4;
  const char*  format = "%*s\e[1;32m%s\e[0;37m%*s%s\e[0m\n";
  fprintf( stream, format, shift, " " , value, shiftDesc, " ", desc );

}

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

calling function inside awk

Hi All, My 1.txt contains some functions fun1() .... .... fun2() .... .... I can call these fun from 2.txt inside awk as below value="`fun1 "argument1"`" awk 'BEGIN {printf ("%s", "'"$value"'")}' I need to modify the above code so that without using the variable to store... (2 Replies)
Discussion started by: jisha
2 Replies

2. Shell Programming and Scripting

value inside a function

i have a script like this #!/bin/ksh initialize() { x=20 } ... ... ... x=10 initialize; echo $x (2 Replies)
Discussion started by: trichyselva
2 Replies

3. Programming

Inline function inside Classes

#include <iostream> using namespace std; class A { public: int Getvalue() { return i;} private: int i; }; int main() {} The above code compiles properly in g++ or in any other C++ compiler. BUT, the variable 'i' is used (in 'return i' statement) before it is... (1 Reply)
Discussion started by: deepthi.s
1 Replies

4. Shell Programming and Scripting

Changing value of a variable inside a shell script

I have a continous polling happening inside a shell script on AIX. This actually calls a PL/SQL block. Is there a way I can set up a variable or pass an interrupt to end the script gracefully. I cant read from the config once the job starts running. Ideally I should change value of a variable and... (1 Reply)
Discussion started by: kshyju
1 Replies

5. Shell Programming and Scripting

CHANGING THE TEXT INSIDE A FILE

Hi All, I need a small help in formating a file. I have a file with word like this; ATGHYJIKOLFHJDHDGDYFGFYGRYGFYRHFYHFUED DHDJFDFSJFLFJSKJFSLKJFGHDKLGLDKGLKDNVNV VNLDVLDVDHFJDKDJVNVHSUFNHJFMVJFMVKJMFV ... .... ....like this 75000 words. I want to convert this words into a single... (5 Replies)
Discussion started by: Lucky Ali
5 Replies

6. Shell Programming and Scripting

Last modified time of the folder is changing when I view the file inside the directory

Hi., Last modified time of the folder is changing when I view the file inside the directory. Here is the test on sample directory. I believe that ls -l commands gives the time detail w.r.t last modified time. Pl. suggest. bash-3.2$ mkdir test bash-3.2$ cd test bash-3.2$ touch myfile.txt... (2 Replies)
Discussion started by: IND123
2 Replies

7. Shell Programming and Scripting

Troubles inside an envelope function

Hi all! I have a function (named "orig") that analyze web sites given from an argument, it works very well when by itself: #!/bin/bash chain="$1" echo chain $chain curl "$chaine" -o prop.txt ... and then it perform some analysis on the prop.txt It works flawlessly if I type: orig... (2 Replies)
Discussion started by: Zephyr
2 Replies

8. Shell Programming and Scripting

Call function inside CASE

i have a case statement which branches to different sections based on an input. Each branch needs to call a function. below is the code. FOr some reason, the code inside the function is not getting executed. the code is below for reference. in the below code echo "Function 1" which is there... (2 Replies)
Discussion started by: cvsanthosh
2 Replies

9. Shell Programming and Scripting

Getopts inside a function is not working

Hi All, I am using geopts inside a function in shell script. But it is doesnt seem to read the input args and I always gt empty value in o/p. my code is http://sparshmail.ad.infosys.com/owa/14.2.318.4/themes/base/pgrs-sm.gif This message has not been sent. #!/bin/ksh IFS=' '... (1 Reply)
Discussion started by: prasperl
1 Replies

10. Shell Programming and Scripting

Need help on awk for printing the function name inside each function

Hi, I am having script which contains many functions. Need to print each function name at the starting of the function. Like below, functionname() { echo "functionname" commands.... } I've tried like below, func=`grep "()" scriptname | cut -d "(" -f1` for i in $func do nawk -v... (4 Replies)
Discussion started by: Sumanthsv
4 Replies
mlib_VectorMulShift_U8_U8_Mod(3MLIB)			    mediaLib Library Functions			      mlib_VectorMulShift_U8_U8_Mod(3MLIB)

NAME
mlib_VectorMulShift_U8_U8_Mod, mlib_VectorMulShift_U8_U8_Sat, mlib_VectorMulShift_U8C_U8C_Mod, mlib_VectorMulShift_U8C_U8C_Sat, mlib_Vec- torMulShift_S8_S8_Mod, mlib_VectorMulShift_S8_S8_Sat, mlib_VectorMulShift_S8C_S8C_Mod, mlib_VectorMulShift_S8C_S8C_Sat, mlib_VectorMul- Shift_S16_S16_Mod, mlib_VectorMulShift_S16_S16_Sat, mlib_VectorMulShift_S16C_S16C_Mod, mlib_VectorMulShift_S16C_S16C_Sat, mlib_VectorMul- Shift_S32_S32_Mod, mlib_VectorMulShift_S32_S32_Sat, mlib_VectorMulShift_S32C_S32C_Mod, mlib_VectorMulShift_S32C_S32C_Sat - vector multipli- cation with shifting SYNOPSIS
cc [ flag... ] file... -lmlib [ library... ] #include <mlib.h> mlib_status mlib_VectorMulShift_U8_U8_Mod(mlib_u8 *z, const mlib_u8 *x, const mlib_u8 *y, mlib_s32 n, mlib_s32 shift); mlib_status mlib_VectorMulShift_U8_U8_Sat(mlib_u8 *z, const mlib_u8 *x, const mlib_u8 *y, mlib_s32 n, mlib_s32 shift); mlib_status mlib_VectorMulShift_U8C_U8C_Mod(mlib_u8 *z, const mlib_u8 *x, const mlib_u8 *y, mlib_s32 n, mlib_s32 shift); mlib_status mlib_VectorMulShift_U8C_U8C_Sat(mlib_u8 *z, const mlib_u8 *x, const mlib_u8 *y, mlib_s32 n, mlib_s32 shift); mlib_status mlib_VectorMulShift_S8_S8_Mod(mlib_s8 *z, const mlib_s8 *x, const mlib_s8 *y, mlib_s32 n, mlib_s32 shift); mlib_status mlib_VectorMulShift_S8_S8_Sat(mlib_s8 *z, const mlib_s8 *x, const mlib_s8 *y, mlib_s32 n, mlib_s32 shift); mlib_status mlib_VectorMulShift_S8C_S8C_Mod(mlib_s8 *z, const mlib_s8 *x, const mlib_s8 *y, mlib_s32 n, mlib_s32 shift); mlib_status mlib_VectorMulShift_S8C_S8C_Sat(mlib_s8 *z, const mlib_s8 *x, const mlib_s8 *y, mlib_s32 n, mlib_s32 shift); mlib_status mlib_VectorMulShift_S16_S16_Mod(mlib_s16 *z, const mlib_s16 *x, const mlib_s16 *y, mlib_s32 n, mlib_s32 shift); mlib_status mlib_VectorMulShift_S16_S16_Sat(mlib_s16 *z, const mlib_s16 *x, const mlib_s16 *y, mlib_s32 n, mlib_s32 shift); mlib_status mlib_VectorMulShift_S16C_S16C_Mod(mlib_s16 *z, const mlib_s16 *x, const mlib_s16 *y, mlib_s32 n, mlib_s32 shift); mlib_status mlib_VectorMulShift_S16C_S16C_Sat(mlib_s16 *z, const mlib_s16 *x, const mlib_s16 *y, mlib_s32 n, mlib_s32 shift); mlib_status mlib_VectorMulShift_S32_S32_Mod(mlib_s32 *z, const mlib_s32 *x, const mlib_s32 *y, mlib_s32 n, mlib_s32 shift); mlib_status mlib_VectorMulShift_S32_S32_Sat(mlib_s32 *z, const mlib_s32 *x, const mlib_s32 *y, mlib_s32 n, mlib_s32 shift); mlib_status mlib_VectorMulShift_S32C_S32C_Mod(mlib_s32 *z, const mlib_s32 *x, const mlib_s32 *y, mlib_s32 n, mlib_s32 shift); mlib_status mlib_VectorMulShift_S32C_S32C_Sat(mlib_s32 *z, const mlib_s32 *x, const mlib_s32 *y, mlib_s32 n, mlib_s32 shift); DESCRIPTION
Each of these functions performs a multiplication of two vectors, shifts the result, and puts it into a third vector. For real data, the following equation is used: z[i] = x[i] * y[i] * 2**(-shift) where i = 0, 1, ..., (n - 1). For complex data, the following equation is used: z[2*i] = (x[2*i]*y[2*i] - x[2*i + 1]*y[2*i + 1]) * 2**(-shift) z[2*i + 1] = (x[2*i]*y[2*i + 1] + x[2*i + 1]*y[2*i]) * 2**(-shift) where i = 0, 1, ..., (n - 1). PARAMETERS
Each of the functions takes the following arguments: z Pointer to the first element of the result vector. x Pointer to the first element of the first source vector. y Pointer to the first element of the second source vector. n Number of elements in each vector. shift Right shifting factor. The ranges of valid shift are: 1 <= shift <= 8 for U8, S8, U8C, S8C types 1 <= shift <= 16 for S16, S16C types 1 <= shift <= 31 for S32, S32C types RETURN VALUES
Each of the functions returns MLIB_SUCCESS if successful. Otherwise it returns MLIB_FAILURE. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Interface Stability |Evolving | +-----------------------------+-----------------------------+ |MT-Level |MT-Safe | +-----------------------------+-----------------------------+ SEE ALSO
mlib_VectorMulShift_U8_Mod(3MLIB), attributes(5) SunOS 5.10 10 Nov 2004 mlib_VectorMulShift_U8_U8_Mod(3MLIB)
All times are GMT -4. The time now is 03:18 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy