Previous     Contents     Index     Next     
Setup Util Programmer's Guide



Chapter 13   Setupapi.h Library Reference


This chapter describes setupapi.h, the library containing common functions shared by Windows NT and UNIX versions of the Setup Util. The chapter is divided into the following sections:



Conversion and Encoding API

NSAPI_EXTERN char *setupSHA1_pw_enc( char *pwd );

NSAPI_EXTERN int setupSHA1_pw_cmp( char *userpwd, char *dbpwd );

NSAPI_EXTERN int setupBase64_decode( char *src, unsigned char *dst
   );

NSAPI_EXTERN int setupBase64_Encode( unsigned char *src, char *dst,
   int srclen, int lenused );

NSAPI_EXTERN char *setupUTF8ToLocal(const char *utf8);

NSAPI_EXTERN char *setupLocalToUtf8(const char *src);

NSAPI_EXTERN int setupIsAsciiBuffer(const char *buf);



Memory Allocation and Freeing

NSAPI_EXTERN void * setupMalloc(unsigned int size);

NSAPI_EXTERN char * setupStrdup(char *src);

NSAPI_EXTERN void setupFree(char *src);



Directory Server Access

NSAPI_EXTERN void setupGetDefaultLdapInfo (const char *sroot,char
   **ldapURL,char **ldapUser,char **adminDomain);

NSAPI_EXTERN char *setupFormConfigLdapURL(const char *ldapURL);

NSAPI_EXTERN char *setupStripConfigLdapURL(const char *configURL);

NSAPI_EXTERN int setupIsValidLdapServer(const char* pszHost, int
   nPort, const char* pszSuffix, const char* pszUserDN, const char*
   pszPassword);

NSAPI_EXTERN int setupIsValidLdapUser(const char* pszHost, int
   nPort, const char* pszSuffix, char** pszUser, const char*
   pszPassword, int bReturnDN);

NSAPI_EXTERN int setupParseLdapUrl(char * szldapURL, char **
   szldapDomain, unsigned int *uldapPort, char ** szldapDN);

NSAPI_EXTERN char *setupFormAdminDomainDN(const char *domain);

NSAPI_EXTERN char *setupStripAdminDomainDN(const char *domainDN);

NSAPI_EXTERN int setupInsertPluginLdifEntries(const char *ldapURL,
   const char *adminDomain,const char *ldapUser, const char
   *ldapPwd, const char *ldifFile);

NSAPI_EXTERN int setupInsertPluginSchemaEntries(const char *ldapURL,
   const char *ldapUser, const char *ldapPwd, const char
   *schemaFile);



Logging and Inf File Access

NSAPI_EXTERN int setupSetLogFile(const char *pszFile);

NSAPI_EXTERN int setupLogMessage(const char *level, const char *who,
   const char *msg, ...);

NSAPI_EXTERN int setupLog(const char *pszFile, const char *pszText);

NSAPI_EXTERN char *setupGetFileString(const char* pszKey, const
   char* sep, const char* pszFileName);

NSAPI_EXTERN int setupGetFileInt(const char* pszKey, const char*
   sep, const char* pszFileName);

NSAPI_EXTERN char *setupGetInfString(const char* pszSection, const
   char* pszKey, const char* pszdefault, const char* pszFileName);

NSAPI_EXTERN int setupGetInfInt(const char* pszSection, const char*
   pszKey, int iDefault, const char* pszFileName);

NSAPI_EXTERN int setupWriteInfString(const char* pszSection, const
   char* pszKey, const char* pszString, const char* pszFileName);

NSAPI_EXTERN int setupWriteInfInt(const char* pszSection, const
   char* pszKey, int i, const char* pszFileName);


setupFindNameInList
Check if given name is already on the list. Takes the following inputs:

  • listValue, a name/value list

  • name, a name to look for

Returns True if the name is in the list, False if the name is not in the list.

NSAPI_EXTERN Bool setupFindNameInList(const char *listValue, const
   char *name);


setupAddNameToList
Add name to a list. If list is not there, it will create new one. If the name is already on the list, it will return a copy of the list. Takes the following inputs:

  • listValue, a name/value list

  • name, a name to add to the list

Returns a new name/value list

NSAPI_EXTERN char * setupAddNameToList(const char *listValue,
   const char *name);



Local File System

NSAPI_EXTERN int setupIsDirEmpty(const char * pszPath);

NSAPI_EXTERN int setupFileExists(const char * pszFileName);

NSAPI_EXTERN int setupDirExists(const char * pszDirName);

NSAPI_EXTERN int setupCreateDir(const char * pszDirName, int mode);

NSAPI_EXTERN int setupDeleteDir(const char *path);

NSAPI_EXTERN int setupConvertPathSlashes(const char * lpszPath,
   char * lpszNewPath, int bType );

NSAPI_EXTERN int setupGetNextFileInDirectory ( long hFile, const
   char * path, char * lpFileName, int lpFileNameLen );

NSAPI_EXTERN int setupGetNextSubDirectory( long hFile, char* path,
   char * lpSubDirectoryName, int lpSubDirectoryNameLen, char *lpSubDirectoryPrefix );

NSAPI_EXTERN int setupDeleteRecursively (const char * path );



Network

NSAPI_EXTERN char *setupGetHostName(void);

NSAPI_EXTERN char *setupGetNetworkDomain(void);

NSAPI_EXTERN unsigned int setupGetRandomNetworkPort(void);

NSAPI_EXTERN int setupIsValidNetworkPort(unsigned int nPort);



Platform

NSAPI_EXTERN int setupIsWindowsNT(void);

NSAPI_EXTERN unsigned int setupExecProgram(const char *program,
   const char *where);

NSAPI_EXTERN void setupGetGmtime(char *buf, int buflen);

#if 0
   NSAPI_EXTERN int setupStartNavigator(const char *pszUrl);

   NSAPI_EXTERN int setupMessageBox(HWND hWnd , const char * lpText,
      const char * lpCaption, unsigned int uType);

   NSAPI_EXTERN void setupSetLastMessage(int iMessage);

   NSAPI_EXTERN int setupGetLastMessage(void);
#endif

#ifdef XP_WIN32
   NSAPI_EXTERN unsigned long setupGetDiskFreeSpace(const char
      *path);



Install Log Error Levels

extern const char *SETUP_LOG_FATAL;

extern const char *SETUP_LOG_INFO;

extern const char *SETUP_LOG_WARN;

extern const char *SETUP_LOG_START;

extern const char *SETUP_LOG_SUCCESS;



InstallLog Class

The Install Log class

class InstallLog


Public API


Constructors
InstallLog (const char *fileName);

~InstallLog ();


Functions
Bool isValid() const;

void logTime(const char *who);

void logMessage (const char *level, const char *who, const char
   *msg, ...);

static void log (const char *fileName, const char *msg);

static char *_logFile;


Previous     Contents     Index     Next     
Copyright (C) 2005 Red Hat, Inc. All rights reserved.
This material may be distributed only subject to the terms and conditions set forth in the Open Publication License, v1.0 or later (the latest version is presently available at http://www.opencontent.org/openpub/

Last Updated September 21, 2001