Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

87 lines
2.4 KiB

  1. /*
  2. * v3stdlib.h - definitions/declarations for shared functions for the V3 catalog
  3. *
  4. * Copyright (c) 1998-1999 Microsoft Corporation. All Rights Reserved.
  5. *
  6. */
  7. #ifndef _INC_V3STDLIB
  8. #define _INC_V3STDLIB
  9. //
  10. // memory management wrappers
  11. //
  12. void *V3_calloc(size_t num, size_t size);
  13. void V3_free(void *p);
  14. void *V3_malloc(size_t size);
  15. void *V3_realloc(void *memblock, size_t size);
  16. BOOL V3_CreateDirectory(LPCTSTR szPath);
  17. BOOL V3_RebootSystem();
  18. //returned a pointer to string 2 within string 1 or a NULL pointer if
  19. //string2 is not found within string1. This function is similar to the
  20. //strstr library function except it works in a case insensitive
  21. //manner.
  22. char *stristr(
  23. const char* string1, //string to search
  24. const char* string2 //string to look for in string 1
  25. );
  26. LPTSTR lstristr(
  27. LPCTSTR string1, //string to search
  28. LPCTSTR string2 //string to look for in string 1
  29. );
  30. //Adds a backslash character to the end of a string if the end ofthe string does
  31. //not already contain a backslash. This function is very usefull in file path
  32. //operations.
  33. void AddBackSlash(LPTSTR szStr);
  34. //This function skips any white space (space, tab, return, life feed characters)
  35. //beginning at the character at ptr up to the end of string. The end of the string
  36. //is assumed to be NULL terminated.
  37. char *SkipSpaces(LPSTR ptr);
  38. //This function takes an ascii string of hex digits and returned the numeric value.
  39. //The function terminates on an invalid hex digit.
  40. int atoh(LPCSTR ptr);
  41. //This function works the same as strncpy except it ensures that that
  42. //the returned string is NULL terminated at count characters. This allows
  43. //a safe way to perform a strcpy since the count can be set to the
  44. //sizeof(strDest).
  45. LPTSTR __cdecl lstrzncpy(
  46. LPTSTR strDest,
  47. LPCTSTR strSource,
  48. size_t count
  49. );
  50. char* __cdecl strzncpy(
  51. char* strDest,
  52. const char* strSource,
  53. size_t count
  54. );
  55. LPCTSTR lstrcpystr(LPCTSTR pszStr, LPCTSTR pszSep, LPTSTR pszTokOut);
  56. const char* strcpystr(const char* pszStr, const char* pszSep, char* pszTokOut);
  57. void GetWindowsUpdateDirectory(LPTSTR pszPath);
  58. void GetCurTime(SYSTEMTIME* pstDateTime);
  59. BOOL FileExists(LPCTSTR szFile);
  60. DWORD LaunchProcess(LPCTSTR pszCmd, LPCTSTR pszDir, UINT uShow, BOOL bWait);
  61. bool DeleteNode(LPCTSTR szDir);
  62. void RemoveLastSlash(LPTSTR szPath);
  63. BOOL ReplaceSingleToken(LPSTR* ppszNewStr, LPCSTR pszStr, LPCSTR pszToken, LPCSTR pszValue);
  64. #endif