2N/A * The contents of this file are subject to the terms of the 2N/A * Common Development and Distribution License (the "License"). 2N/A * You may not use this file except in compliance with the License. 2N/A * See the License for the specific language governing permissions 2N/A * and limitations under the License. 2N/A * When distributing Covered Code, include this CDDL HEADER in each 2N/A * If applicable, add the following below this CDDL HEADER, with the 2N/A * fields enclosed by brackets "[]" replaced with your own identifying 2N/A * information: Portions Copyright [yyyy] [name of copyright owner] 2N/A * Copyright 2006 Sun Microsystems, Inc. All rights reserved. 2N/A * Use is subject to license terms. 2N/A#
pragma ident "%Z%%M% %I% %E% SMI" 2N/A// functions to place bit data properly. 2N/A // move the bit data into place 2N/A // create a mask to clear the old data. 2N/A // get the data out of the byte array. 2N/A // clear the old data 2N/A // put in the new data. 2N/A // write the data back to the buffer. 2N/A // get the data out of the byte array. 2N/A// =========================================================================== 2N/A// caller is to be sure elemDef is contained by recDef. 2N/A// =========================================================================== 2N/A// return -1 on error. 2N/A // For reading they are oposite. 2N/A // abs is negative here 2N/A// =========================================================================== 2N/A// return -1 on error. 2N/A // read the iteration control bytes first because we may ONLY need 2N/A // the '+' symbol on anything is an error here 2N/A // check assumptions for next calls. 2N/A // don't forget to skip the iteration control bytes!!! 2N/A // error set by calcOffset 2N/A// =========================================================================== 2N/A// Iff onlyFindingIterThereFlag is set data is ignored and dataLen will be set 2N/A// to the number of iterations which are actually in the seeprom. 2N/A // alway go ahead and do the iterated thing. If we are not a 2N/A // field then the onlyFindingIterThereFlag should be set. 2N/A // Check this afterward. 2N/A // zzz altering the length things again... 2N/A// zzz still have to figure out the bit offsets for bit iterations... 2N/A // done but this thing was not an iteration!!! 2N/A // now make sure we have a field. 2N/A // allocate and copy. 2N/A // iterated bit field adjust acordingly. 2N/A /* copy the correct number of bytes to eData */ 2N/A // At this point we know the entry is some sort of record. 2N/A// zzz still have to figure out the bit offsets for bit iterations... 2N/A// =========================================================================== 2N/A// will send the data back in (data,dataLen) 2N/A// =========================================================================== 2N/A // update the iteration control information 2N/A // This never changes. 2N/A // Remember that when the iteration is added the head and the tail both 2N/A // equal 0 (ie point to 0). So if we are empty when we are updating 2N/A // then we don't have to alter the head or tail values. We simply add 2N/A // one to the numThere. 2N/A // this will flag an error when Linear can't 2N/A // if we are not at the end move the tail. 2N/A // this is the same except LIFO is read 2N/A // if the tail hits the end wrap around. 2N/A // if tail catches head move the head. 2N/A // if head hits the end wrap around. 2N/A // add one IFF we are not full 2N/A// =========================================================================== 2N/A // Delay checking for Records until after this which will 2N/A // allow for [+] notation for Iterated Records. 2N/A // if this is updating an iteration AND we are adding one... 2N/A // zzz altering the length things again... 2N/A// zzz still have to figure out the bit offsets 2N/A // once again convert enums for the user again. 2N/A // iterated bit field adjust acordingly. 2N/A // copy into and return. 2N/A// zzz still have to figure out the bit offsets 2N/A// =========================================================================== 2N/A// will update the data in payload which can then be written back. 2N/A // verify the user data first before doing any major work. 2N/A // unless we are updateing with [+] symbol 2N/A // (which means we don't have any data length at all.) 2N/A // the sizeof the data for Binary or Enumeration MUST 2N/A // all others must be shorter than the space available.