2015-10-23 19:21:55 +00:00
|
|
|
/* **********************************************************
|
|
|
|
* Copyright 2009 VMware, Inc. All rights reserved.
|
|
|
|
* **********************************************************/
|
|
|
|
|
|
|
|
/*
|
|
|
|
* @VMKAPIMOD_LICENSE@
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
|
|
|
***********************************************************************
|
|
|
|
* Parse */ /**
|
2015-10-23 19:48:45 +00:00
|
|
|
* \addtogroup Lib
|
|
|
|
* @{
|
2015-10-23 19:21:55 +00:00
|
|
|
* \defgroup Parse Parsing Utilities
|
|
|
|
*
|
|
|
|
* @{
|
|
|
|
***********************************************************************
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _VMKAPI_PARSE_H_
|
|
|
|
#define _VMKAPI_PARSE_H_
|
|
|
|
|
|
|
|
/** \cond never */
|
|
|
|
#ifndef VMK_HEADER_INCLUDED_FROM_VMKAPI_H
|
|
|
|
#error This vmkapi file should never be included directly but only via vmkapi.h
|
|
|
|
#endif
|
|
|
|
/** \endcond never */
|
|
|
|
|
|
|
|
/*
|
|
|
|
***********************************************************************
|
|
|
|
* vmk_ParseArgs-- */ /**
|
|
|
|
*
|
|
|
|
* \brief Parse "buf" as a vector of arguments.
|
|
|
|
*
|
|
|
|
* Parse "buf" of length "buflen" as a vector of up to "argc"
|
|
|
|
* arguments delimited by whitespace. Updates "buf" in-place,
|
|
|
|
* replacing whitespace with NULs, and sets elements of "argv" to
|
2015-10-23 19:48:45 +00:00
|
|
|
* the start of each parsed argument.
|
|
|
|
*
|
|
|
|
* \note This function will not block.
|
2015-10-23 19:21:55 +00:00
|
|
|
*
|
|
|
|
* \param[in] buf Source string
|
|
|
|
* \param[in] buflen Length of source string
|
|
|
|
* \param[out] argv Array of parsed tokens
|
|
|
|
* \param[in] argc Count of tokens to be parsed
|
|
|
|
*
|
|
|
|
* \return Returns the number of parsed arguments.
|
|
|
|
*
|
|
|
|
***********************************************************************
|
|
|
|
*/
|
|
|
|
vmk_uint32 vmk_ParseArgs(
|
|
|
|
char *buf,
|
2015-10-23 19:48:45 +00:00
|
|
|
vmk_ByteCount buflen,
|
2015-10-23 19:21:55 +00:00
|
|
|
char *argv[],
|
|
|
|
vmk_uint32 argc);
|
|
|
|
|
|
|
|
#endif /* _VMKAPI_PARSE_H_ */
|
|
|
|
/** @} */
|
2015-10-23 19:48:45 +00:00
|
|
|
/** @} */
|