13.07.2015 Views

Full Generic System V ABI

Full Generic System V ABI

Full Generic System V ABI

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

The constant m denotes an upper bound of the number of bytes that a string maycontain. If m is not specified, as in the second declaration, it is assumed to be(2**32) - 1, the maximum length. The constant m would normally be found in aprotocol specification. For example, a filing protocol may state that a file namecan be no longer than 255 bytes, as follows:string filename;Which can be illustrated as:A String0 1 2 3 4 5 . . .+ - - - - - + - - - - - + - - - - - + - - - - - + - - - - - + - - - - - + . . . + - - - - - + - - - - - + . . . + - - - - - +| l e n g t h n | b y t e 0 | b y t e 1 | . . . | n - 1 | 0 | . . . | 0 |+ - - - - - + - - - - - + - - - - - + - - - - - + - - - - - + - - - - - + . . . + - - - - - + - - - - - + . . . + - - - - - +| < - - - - - - - 4 b y t e s - - - - - - - > | < - - - - - - n b y t e s - - - - - - > | < - - - r b y t e s - - - > || < - - - - n + r ( w h e r e ( n + r ) m o d 4 = 0 ) - - - - > |It is an error to encode a length greater than the maximum described in thespecification.Fixed-length ArrayDeclarations for fixed-length arrays of homogeneous elements are in the followingform:type-name identifier[n];Fixed-length arrays of elements numbered 0 through n-1 are encoded by individuallyencoding the elements of the array in their natural order, 0 through n-1. Eachelement’s size is a multiple of four bytes. Though all elements are of the sametype, the elements may have different sizes. For example, in a fixed-length arrayof strings, all elements are of ‘‘type string,’’ yet each element will vary in itslength.Fixed-Length Array+ - - - + - - - + - - - + - - - + - - - + - - - + - - - + - - - + . . . + - - - + - - - + - - - + - - - +| e l e m e n t 0 | e l e m e n t 1 | . . . | e l e m e n t n - 1 |+ - - - + - - - + - - - + - - - + - - - + - - - + - - - + - - - + . . . + - - - + - - - + - - - + - - - +| < - - - - - - - - - - - - - - - - - - - - n e l e m e n t s - - - - - - - - - - - - - - - - - - - > |7-16 FORMATS AND PROTOCOLS

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!