Sponsored Content
Top Forums Programming [ C ] multidemensional array pass to functions Post 302265304 by shamrock on Saturday 6th of December 2008 01:20:36 PM
Old 12-06-2008
Most of the source code looks alright with the exception of one statement. Dual-level pointer crc_s cannot be equated to uni-level pointer argv[i] as they are incompatible in terms of the pointer levels. crc_s is of type char** while argv[i] is of type char*.
Quote:
Originally Posted by VRoemer
Code:
int crcSpoof( char* file, char* fileOut, char* fileOutTmp, ulong* nRecovered, ulong* bytesRecovered, int** CRC_Array )

...

int main( int argc, char** argv )
{
    int i = 3; // start with the 3rd value of argv
    int** crc_s; 
    
    // Some argument testing here

    while( argv[ i ] )
       crc_s = argv[ i ]; /* the compiler will complain about this line */ 
    
    crcSpoof( argv[1], argv[2], "fileOutTmp", NULL, NULL, crc_s );

 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Pass by reference in shell functions

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

How To Pass an Array Variable

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

Tricky array substitution in functions

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

How to pass array as an arguement ?

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

Passing array to functions in ksh script

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

Pass parameters to a function and running functions in parallel

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

Need help on Assigning a Array variable from Background Functions

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

Pass array to a function and display the array

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

How to pass first array value?

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

Code review: recursion in circular array, reduce two functions to one?

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
Font::TTF::Silf(3)					User Contributed Perl Documentation					Font::TTF::Silf(3)

NAME
Font::TTF::Silf - The main Graphite table DESCRIPTION
The Silf table holds the core of the Graphite rules for a font. A Silf table has potentially multiple silf subtables, although there is usually only one. Within a silf subtable, there are a number of passes which contain the actual finite state machines to match rules and the constraint and action code to be executed when a rule matches. INSTANCE VARIABLES
Version Silf table format version Compiler Lowest compiler version necessary to fully support the semantics expressed in this Graphite description SILF An array of Silf subtables maxGlyphID The maximum glyph id referenced including pseudo and non glyphs Ascent Extra ascent to be added to the font ascent. Descent Extra descent to be added to the font descent. Both values are assumed to be positive for a descender below the base line. substPass Pass index into PASS of the first substitution pass. posPass Pass index into PASS of the first positioning pass. justPass Pass index into PASS of the first justification pass. bidiPass Pass index of the pass before which the bidirectional processing pass will be executed. 0xFF indicates that there is no bidi pass to be executed. Flags A bitfield of flags: 0 - Indicates there are line end contextual rules in one of the passes maxPreContext Maximum length of a context preceding a cross line boundary contextualisation. maxPostContext Maximum length of a context following a cross line boundary contextualsation. attrPseudo Glyph attribute for the actual glyph id associated with a pseudo glyph. attrBreakWeight Glyph attribute number of the attribute holding the default breakweight associated with a glyph. attrDirectionality Glyph attribute number of the attribute holding the default directionality value associated with a glyph. JUST The may be a number of justification levels each with their own property values. This points to an array of hashes, one for each justification level. attrStretch Glyph attribute number for the amount of stretch allowed before this glyph. attrShrink Glyph attribute number for the amount of shrink allowed before this glyph. attrStep Glyph attribute number specifying the minimum granularity of actual spacing associated with this glyph at this level. attrWeight Glyph attribute number giving the weight associated with spreading space across a run of glyphs. runto Which level starts the next stage. numLigComp Number of initial glyph attributes that represent ligature components numUserAttr Number of user defined slot attributes referenced. Tells the engine how much space to allocate to a slot for user attributes. maxCompPerLig Maximum number of components per ligature. direction Supported directions for this writing system CRIT_FEATURE Array of critical features. scripts Array of script tags that indicate which set of GDL rules to execute if there is more than one in a font. lbGID Glyph ID of the linebreak pseudo glyph. pseudos Hash of Unicode values to pseduo glyph ids. classes This is an array of classes, each of which is an array of glyph ids in class order. PASS The details of rules and actions are stored in passes. This value is an array of pass subobjects one for each pass. flags This is a bitfield: 0 - If true, this pass makes no change to the slot stream considered as a sequence of glyph ids. Only slot attributes are expected to change (for example during positioning). maxRuleLoop How many times the engine will allow rules to be tested and run without the engine advancing through the input slot stream. maxRuleContext Number of slots of input needed to run this pass. maxBackup Number of slots by which the following pass needs to trail this pass (i.e. the maximum this pass is allowed to back up). numRules Number of action code blocks, and so uncompressed rules, in this pass. numRows Number of rows in the finite state machine. numTransitional Number of rows in the finite state machine that are not final states. This specifies the number of rows in the fsm element. numSuccess Number of success states. A success state may also be a transitional state. numColumns Number of columns in the finite state machine. colmap A hash, indexed by glyphid, that gives the fsm column number associated with that glyphid. If not present, then the glyphid is not part of the fsm and will finish fsm processing if it occurs. rulemap An array of arrays, one for each success state. Each array holds a list of rule numbers associated with that state. minRulePreContext Minimum number of items in a rule's precontext. maxRulePreContext The maximum number of items in any rule's precontext. startStates Array of starting state numbers dependeing on the length of actual precontext. There are maxRulePreContext - minRulePreContext + 1 of these. ruleSortKeys An array of sort keys one for each rule giving the length of the rule without its precontext. rulePreContexts An array of precontext lengths for each rule. fsm A two dimensional array such that $p->{'fsm'}[$row][$col] gives the row of the next node to try in the fsm. passConstraintLen Length in bytes of the passConstraint code. passConstraintCode A byte string holding the pass constraint code. constraintCode An array of byte strings holding the constraint code for each rule. actionCode An array of byte strings holding the action code for each rule. @opcodes Each array holds the name of the opcode, the number of operand bytes and a string describing the operands. The characterse in the string have the following meaning: c - lsb of class id C - msb of class id f - feature index g - lsb of glyph attribute id G - msb of glyph attribute id l - lsb of a 32-bit extension to a 16-bit number L - msb of a 32-bit number m - glyph metric id n - lsb of a number N - msb of a 16-bit number o - offset (jump) s - slot reference S - slot attribute id v - variable number of following arguments read Reads the Silf table into the internal data structure out Outputs a Silf data structure to a font file in binary format perl v5.16.3 2012-05-19 Font::TTF::Silf(3)
All times are GMT -4. The time now is 02:54 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy