VirtualBox

Changeset 4063 in vbox for trunk


Ignore:
Timestamp:
Aug 7, 2007 2:13:20 PM (17 years ago)
Author:
vboxsync
Message:

Runtime: Added basic RTEnv...(RTENV,..) API.

Location:
trunk
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/iprt/env.h

    r3630 r4063  
    7878/** @todo Add the missing environment APIs: safe, printf like, and various modifications. */
    7979
     80/**
     81 * Creates an empty environment block.
     82 *
     83 * @returns IPRT status code. Typical error is VERR_NO_MEMORY.
     84 *
     85 * @param   pEnv        Where to store the handle of the environment block.
     86 */
     87RTDECL(int) RTEnvCreate(PRTENV pEnv);
     88
     89/**
     90 * Destroys an environment block.
     91 *
     92 * @returns IPRT status code.
     93 *
     94 * @param   Env     Handle of the environment block.
     95 */
     96RTDECL(int) RTEnvDestroy(RTENV Env);
     97
     98/**
     99 * Creates an environment block and fill it with variables from the given
     100 * environment array.
     101 *
     102 * @returns IPRT status code. Typical error is VERR_NO_MEMORY.
     103 *
     104 * @param   pEnv        Where to store the handle of the environment block.
     105 * @param   apszEnv     Pointer to the NULL-terminated array of environment
     106 *                      variables. If NULL, the current process' environment
     107 *                      will be cloned.
     108 */
     109RTDECL(int) RTEnvClone(PRTENV pEnv, char const *const *apszEnv);
     110
     111/** @todo later */
     112/*
     113RTDECL(int) RTEnvCloneEx(PRTENV pEnv, const RTENV Env);
     114
     115RTDECL(int) RTEnvExistEx(RTENV Env, const char *pszVar);
     116RTDECL(int) RTEnvSetEx(RTENV Env, const char *pszVar, const char *pszValue);
     117RTDECL(int) RTEnvGetEx(RTENV Env, const char *pszVar, const char **ppszValue);
     118RTDECL(int) RTEnvCountEx(RTENV Env, size_t *cbCount);
     119*/
     120
     121/**
     122 * Puts a 'variable=value' string into the environment.
     123 *
     124 * The supplied string must be in the current process' codepage.
     125 * This function makes a copy of the supplied string.
     126 *
     127 * @returns IPRT status code. Typical error is VERR_NO_MEMORY.
     128 *
     129 * @param   Env                 Handle of the environment block.
     130 * @param   pszVarEqualValue    The variable '=' value string. If the value and '=' is
     131 *                              omitted, the variable is removed from the environment.
     132 */
     133RTDECL(int) RTEnvPutEx(RTENV Env, const char *pszVarEqualValue);
     134
     135/**
     136 * Returns a raw pointer to the array of environment variables of the given
     137 * environment block where every variable is a string in format
     138 * 'variable=value'.
     139 *
     140 * All returned strings are in the current process' codepage.
     141 *
     142 * @returns Pointer to the raw array of environment variables.
     143 * @returns NULL if Env is NULL or invalid.
     144 *
     145 * @param   Env                 Handle of the environment block.
     146 */
     147RTDECL(char const *const *) RTEnvGetArray(RTENV Env);
     148
    80149#endif /* IN_RING3 */
    81150
  • trunk/include/iprt/types.h

    r3683 r4063  
    935935#define NIL_RTHEAPSIMPLE                            ((RTHEAPSIMPLE)0)
    936936
     937/** Handle to an environment block. */
     938typedef HCPTRTYPE(struct RTENVINTERNAL *)           RTENV;
     939/** Pointer to a handle to an environment block. */
     940typedef RTENV                                      *PRTENV;
     941/** NIL simple heap handle. */
     942#define NIL_RTENV                                   ((RTENV)0)
     943
    937944
    938945/**
  • trunk/src/VBox/Runtime/Makefile.kmk

    r3980 r4063  
    173173        generic/semfastmutex-generic.cpp \
    174174        generic/spinlock-generic.cpp \
     175        generic/env-generic.cpp \
    175176        ldr.cpp \
    176177        ldrFile.cpp \
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette