I'm trying to assign variables where vpSec0 points.
Expand|Select|Wrap|Line Numbers
- void * vpSec0 = NULL;
- CreateHVFESection0(vpSec0);
Expand|Select|Wrap|Line Numbers
- void CreateHVFESection0(void * vpSec0)
- {
- int hSec0;
- size_t * nbytes = (size_t *) malloc(sizeof(size_t));
- hSec0 = bitio_o_open();
- /* 'B','U','F','R' */
- bitio_o_append(hSec0,66,8);
- bitio_o_append(hSec0,85,8);
- bitio_o_append(hSec0,70,8);
- bitio_o_append(hSec0,82,8);
- /* Total length of BUFR message in bytes */
- bitio_o_append(hSec0,0,24);
- /* BUFR Edition Number = 4 */
- bitio_o_append(hSec0,4,8);
- vpSec0 = bitio_o_close(hSec0, nbytes);
- free(nbytes);
- nbytes = NULL;
- }
Expand|Select|Wrap|Line Numbers
- vpSec0 = bitio_o_close(hSec0, nbytes);
Expand|Select|Wrap|Line Numbers
- void *bitio_o_close (handle, nbytes)
- int handle;
- size_t *nbytes;
- /* This function closes a output-bitstream identified by HANDLE and returns
- a pointer to the memory-area holding the bit-stream.
- parameters:
- HANDLE: Bit-stream-handle
- NBYTES: number of bytes in the bitstream.
- The funcion returns a pointer to the memory-area holding the bit-stream or
- NULL if an invalid handle was specified. The memory area must be freed by
- the calling function.
- */
- {
- if (!bios[handle].used) return NULL;
- /******* Fill up the last byte with 0-bits */
- while (bios[handle].nbits % 8 != 0) bitio_o_append (handle, 0, 1);
- *nbytes = (size_t) ((bios[handle].nbits - 1) / 8 + 1);
- bios[handle].used = 0;
- return (void *) bios[handle].buf;
- }
- void *bitio_o_close (handle, nbytes)
- int handle;
- size_t *nbytes;
- /* This function closes a output-bitstream identified by HANDLE and returns
- a pointer to the memory-area holding the bit-stream.
- parameters:
- HANDLE: Bit-stream-handle
- NBYTES: number of bytes in the bitstream.
- The funcion returns a pointer to the memory-area holding the bit-stream or
- NULL if an invalid handle was specified. The memory area must be freed by
- the calling function.
- */
- {
- if (!bios[handle].used) return NULL;
- /******* Fill up the last byte with 0-bits */
- while (bios[handle].nbits % 8 != 0) bitio_o_append (handle, 0, 1);
- *nbytes = (size_t) ((bios[handle].nbits - 1) / 8 + 1);
- bios[handle].used = 0;
- return (void *) bios[handle].buf;
- }
Expand|Select|Wrap|Line Numbers
- return (void *) bios[handle].buf
Please help.
Thanx.