modules/portlib/src/main/native/port/shared/hystr.c File Reference


Detailed Description

String utilities.

#include <stdarg.h>
#include <string.h>
#include <stdio.h>
#include "hycomp.h"
#include "hyport.h"
#include "utf8encode.h"

Functions

U_32 VMCALL hystr_printf (struct HyPortLibrary *portLibrary, char *buf, U_32 bufLen, const char *format,...)
 Write characters to a string as specified by format.
U_32 VMCALL hystr_vprintf (struct HyPortLibrary *portLibrary, char *buf, U_32 bufLen, const char *format, va_list args)
 Write characters to a string as specified by format.
void VMCALL hystr_shutdown (struct HyPortLibrary *portLibrary)
 PortLibrary shutdown.
I_32 VMCALL hystr_startup (struct HyPortLibrary *portLibrary)
 PortLibrary startup.


Function Documentation

U_32 VMCALL hystr_printf ( struct HyPortLibrary portLibrary,
char *  buf,
U_32  bufLen,
const char *  format,
  ... 
)

Write characters to a string as specified by format.

Parameters:
[in] portLibrary The port library.
[in,out] buf The string buffer to be written.
[in] bufLen The size of the string buffer to be written.
[in] format The format of the string.
[in] ... Arguments for the format string.
Returns:
The number of characters printed not including the NUL terminator.
Note:
When buf is NULL, the size of the buffer required to print to the string, including the NUL terminator is returned.

void VMCALL hystr_shutdown ( struct HyPortLibrary portLibrary  ) 

PortLibrary shutdown.

This function is called during shutdown of the portLibrary. Any resources that were created by hystr_startup should be destroyed here.

Parameters:
[in] portLibrary The port library.
Note:
Most implementations will be empty.

I_32 VMCALL hystr_startup ( struct HyPortLibrary portLibrary  ) 

PortLibrary startup.

This function is called during startup of the portLibrary. Any resources that are required for the string operations may be created here. All resources created here should be destroyed in hystr_shutdown.

Parameters:
[in] portLibrary The port library.
Returns:
0 on success, negative error code on failure. Error code values returned are
  • HYPORT_ERROR_STARTUP_STR
Note:
Most implementations will simply return success.

U_32 VMCALL hystr_vprintf ( struct HyPortLibrary portLibrary,
char *  buf,
U_32  bufLen,
const char *  format,
va_list  args 
)

Write characters to a string as specified by format.

Parameters:
[in] portLibrary The port library.
[in,out] buf The string buffer to be written.
[in] bufLen The size of the string buffer to be written.
[in] format The format of the string.
[in] args Arguments for the format string.
Returns:
The number of characters printed not including the NUL terminator.
Note:
When buf is NULL, the size of the buffer required to print to the string, including the NUL terminator is returned.


Genereated on Tue Dec 9 14:12:59 2008 by Doxygen.

(c) Copyright 2005, 2008 The Apache Software Foundation or its licensors, as applicable.