Changeset 4 for trunk/common_functions
- Timestamp:
- Jul 13, 2017, 5:17:57 AM (8 years ago)
- Location:
- trunk/common_functions
- Files:
-
- 4 added
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/common_functions/helper.c
r2 r4 70 70 void HlpWriteToTrapLog(const char* chrFormat, ...); 71 71 72 #if 073 /****************************************************74 * *75 * This funktion returns the running OS version: *76 * *77 * 30: Warp 3, 40 Warp 4 *78 * *79 ****************************************************/80 ULONG cwQueryOSRelease()81 {82 static ULONG ulVersionMinor=0;83 84 if(!ulVersionMinor)85 if(DosQuerySysInfo(QSV_VERSION_MINOR, QSV_VERSION_MINOR, &ulVersionMinor, sizeof(ulVersionMinor)))86 ulVersionMinor=30;/* Default Warp 3 */87 88 return ulVersionMinor;89 90 }91 #endif92 72 93 73 void removeLog(void) … … 564 544 } 565 545 #endif 566 546 #if 0 547 if(SysQueryHomeDir(chrHomeDir, sizeof(chrHomeDir))) { 548 strcpy(chrPath, chrHomeDir); 549 strncat(chrPath, "\\WPSWIZZ.INI", size-strlen(chrPath)-1);/* Default is INI file in users home dir */ 550 return; 551 } 552 553 strcpy(chrPath, queryHelpPath()); 554 if((ptrChar=strrchr(chrPath, '\\'))!=NULLHANDLE) { 555 *ptrChar=0; 556 if((ptrChar=strrchr(chrPath, '\\'))!=NULLHANDLE) 557 *ptrChar=0; 558 } 559 strncat(chrPath, "\\WPSWIZZ.INI", size-strlen(chrPath)-1); 560 chrPath[size-1]=0; 561 #endif 562 563 /* 564 Query the path to the INI file used by the MM progs to store the private data. 565 If a home dir exists on the users system the INI file will be create there otherwise 566 in the directory where the calling EXE is located. 567 */ 567 568 BOOL HlpBuildMMProgIniFileName(char* chrProgname, char * chrBuffer, ULONG ulBufferSize) 568 569 { 569 570 char * chrPtr; 570 strncpy(chrBuffer, chrProgname,ulBufferSize); 571 chrBuffer[ulBufferSize-1]=0; 571 572 /* Default is INI file in users home dir */ 573 if(SysQueryHomeDir(chrBuffer, ulBufferSize)) { 574 strlcat(chrBuffer, MMCLS_INI_FILE_NAME, ulBufferSize); /* MMCLS_INI_FILE_NAME = "\\CWMM.INI" */ 575 return TRUE; 576 } 577 578 /* No HOME dir for some reason */ 579 strlcpy(chrBuffer, chrProgname, ulBufferSize); 572 580 573 581 if((chrPtr=strrchr(chrBuffer,'\\'))==NULLHANDLE) 574 return FALSE; 582 return FALSE; // This shouldn't happen! 575 583 576 584 *chrPtr=0; 577 str ncat(chrBuffer,INI_FILE_NAME, ulBufferSize-strlen(chrBuffer)-1);585 strlcat(chrBuffer, MMCLS_INI_FILE_NAME, ulBufferSize); 578 586 579 587 return TRUE; -
trunk/common_functions/img_funcs.c
r2 r4 2 2 This file conatins functions for loading image files. 3 3 */ 4 4 5 #define INCL_PM 6 #define INCL_OS2MM 5 7 #define INCL_MMIOOS2 6 8 … … 18 20 /* This function loads a supported image file. */ 19 21 /* Every format for which MMOS2 has an IO procedure */ 20 /* may be used here. */ 22 /* may be used here. In contrast to */ 23 /* ImgLoadImageFile() a provided BMPINFOHEADER2 */ 24 /* structure is filled with data. */ 25 /* */ 21 26 /* */ 22 27 /* @@RETURNS */ … … 24 29 /* HBITMAP hBitmap */ 25 30 /* */ 26 /* HAndle to the bitmap of NULL. */ 31 /* Handle to the bitmap or NULL. */ 32 /* */ 33 /* @@PARAM */ 34 /* */ 35 /* PSZ pszFileName input */ 36 /* */ 37 /* Name of the image file to load. */ 38 /* */ 39 /* @@PARAM */ 40 /* */ 41 /* PBITMAPINFOHEADER2 pBMPInfoHeader2 in/out */ 42 /* */ 43 /* Pointer to a BITMAPINFOHEADER2 structure. */ 44 /* */ 45 /* */ 46 /* @@REMARKS */ 47 /* */ 48 /* The caller must free the bitmap handle after */ 49 /* use. */ 27 50 /* */ 28 51 /*!!*************************************************/ 29 HBITMAP ImgLoadImageFile ( PSZ pszFileName)52 HBITMAP ImgLoadImageFileAndHeader( PSZ pszFileName, PBITMAPINFOHEADER2 pBMPInfoHeader2) 30 53 { 31 54 HBITMAP hbm; 32 HBITMAP hbmTarget;33 55 MMIOINFO mmioinfo; 34 56 MMFORMATINFO mmFormatInfo; 35 57 HMMIO hmmio; 36 37 58 ULONG ulImageHeaderLength; 59 MMIMAGEHEADER mmImgHdr; 38 60 ULONG ulBytesRead; 39 61 ULONG dwNumRowBytes; … … 131 153 return (0L); 132 154 } 133 /* 134 memcpy(pBMPInfoHeader2, &mmImgHdr.mmXDIBHeader.BMPInfoHeader2, 135 sizeof(BITMAPINFOHEADER2)+256*sizeof(RGB2) ); 136 */ 155 137 156 /*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/ 157 *pBMPInfoHeader2=mmImgHdr.mmXDIBHeader.BMPInfoHeader2; 138 158 139 159 /* … … 226 246 NULL); 227 247 228 #if 0229 hbm = GpiCreateBitmap ( hps,230 pBMPInfoHeader2,231 0L,232 NULL,233 NULL);234 #endif235 236 248 if ( !hbm ) 237 249 { … … 250 262 return(0L); 251 263 } 252 /* 253 // *************************************************** 254 // Select the bitmap into the memory device context. 255 // ***************************************************/ 264 /**************************************************** 265 Select the bitmap into the memory device context. 266 ***************************************************/ 256 267 hbReturnCode = GpiSetBitmap ( hps, 257 268 hbm ); 258 /* 259 //*************************************************************** 260 // LOAD THE BITMAP DATA FROM THE FILE 261 // One line at a time, starting from the BOTTOM 262 //*************************************************************** */ 269 /*************************************************************** 270 LOAD THE BITMAP DATA FROM THE FILE 271 One line at a time, starting from the BOTTOM 272 ****************************************************************/ 263 273 264 274 for ( dwRowCount = 0; dwRowCount < dwHeight; dwRowCount++ ) … … 294 304 295 305 296 BOOL ImgGetBmpInfoHeader(PBITMAPINFOHEADER2 bmpih2, PSZ pszFileName /*, char* procName, ULONG ulLength*/) 306 /*!**************************************************/ 307 /* */ 308 /* @@DESC */ 309 /* */ 310 /* This function loads a supported image file. */ 311 /* Every format for which MMOS2 has an IO procedure */ 312 /* may be used here. */ 313 /* */ 314 /* @@PARAM */ 315 /* */ 316 /* PSZ pszFileName input */ 317 /* */ 318 /* Name of the image file to load. */ 319 /* */ 320 /* @@RETURNS */ 321 /* */ 322 /* HBITMAP hBitmap */ 323 /* */ 324 /* Handle to the bitmap of NULL. */ 325 /* */ 326 /*!!*************************************************/ 327 HBITMAP ImgLoadImageFile ( PSZ pszFileName ) 328 { 329 BITMAPINFOHEADER2 bmpih2; 330 331 return ImgLoadImageFileAndHeader ( pszFileName, &bmpih2 ); 332 } 333 334 335 336 /*!**************************************************/ 337 /* */ 338 /* @@DESC */ 339 /* */ 340 /* Build a BITMAPINFOHEADER2 for the given file. */ 341 /* */ 342 /* @@PARAM */ 343 /* */ 344 /* PSZ pszFileName input */ 345 /* */ 346 /* Name of the image file. */ 347 /* */ 348 /* @@PARAM */ 349 /* */ 350 /* PBITMAPINFOHEADER2 pBMPInfoHeader2 in/out */ 351 /* */ 352 /* Pointer to a BITMAPINFOHEADER2 structure. */ 353 /* */ 354 /* @@RETURNS */ 355 /* */ 356 /* TRUE on success, FALSE otherwise */ 357 /* */ 358 /*!!*************************************************/ 359 BOOL ImgGetBmpInfoHeader(PSZ pszFileName, PBITMAPINFOHEADER2 bmpih2) 297 360 { 298 361 MMIOINFO mmioinfo; … … 305 368 ULONG ulReturnCode; 306 369 ULONG ulBytesRead; 307 char *pName;308 370 309 // if(procName)310 // procName[0]=0;311 312 371 /* Check file size */ 313 372 if(SysQueryFileSize(pszFileName)==0) -
trunk/common_functions/include/img_funcs.h
r2 r4 3 3 4 4 HBITMAP ImgLoadImageFile ( PSZ pszFileName ); 5 BOOL ImgGetBmpInfoHeader(PBITMAPINFOHEADER2 bmpih2, PSZ pszFileName /*, char* procName, ULONG ulLength*/); 5 HBITMAP ImgLoadImageFileAndHeader ( PSZ pszFileName, PBITMAPINFOHEADER2 pBMPInfoHeader2); 6 BOOL ImgGetBmpInfoHeader(PSZ pszFileName, PBITMAPINFOHEADER2 bmpih2 /*, char* procName, ULONG ulLength*/); 6 7 7 8 #endif -
trunk/common_functions/include/ini_funcs.h
r2 r4 6 6 #endif 7 7 8 BOOL IniSaveWindowPos(HINI hini, char * iniFile, char* chrApp, char *chrKey, HWND hwnd); 9 BOOL IniRestoreWindowPos(HINI hini, char * iniFile, char* chrApp, char *chrKey, HWND hwnd, ULONG fSize); 8 BOOL PrfSaveWindowPos(HINI hini, char * iniFile, char* chrApp, char *chrKey, HWND hwnd); 9 BOOL PrfRestoreWindowPos(HINI hini, char * iniFile, char* chrApp, char *chrKey, HWND hwnd, ULONG fSize); 10 BOOL PrfWriteString(HINI hini, char * iniFile, char* chrApp, char *chrKey, char* chrString); 11 BOOL PrfQueryString(HINI hini, char * iniFile, char* chrApp, char *chrKey, char* chrDefault, char* chrBuffer, ULONG ulSize); 10 12 11 13 #if __cplusplus -
trunk/common_functions/include/message_funcs.h
r2 r4 9 9 char* title, ULONG ulTitleID, LONG lSizeTitle, 10 10 HMODULE hResource, HWND hwnd, ULONG ulFlags); 11 ULONG showMessageBox2(HWND hwnd, ULONG ulIDTitle, ULONG ulIDText, HMODULE hModule, ULONG ulFlag);11 ULONG MsgShowMessageBox(HWND hwnd, ULONG ulIDTitle, ULONG ulIDText, HMODULE hModule, ULONG ulFlag); 12 12 BOOL getMessage(char* text,ULONG ulID, LONG lSizeText, HMODULE hResource,HWND hwnd); 13 13 BOOL MsgGetMessage(char* text,ULONG ulID, LONG lSizeText, HMODULE hResource,HWND hwnd); 14 15 #if 0 16 ULONG showMessageBox2(HWND hwnd, ULONG ulIDTitle, ULONG ulIDText, HMODULE hModule, ULONG ulFlag); 17 #endif 18 14 19 #ifdef __CPLUSPLUS__ 15 20 } -
trunk/common_functions/include/sys_funcs.h
r2 r4 28 28 ULONG SysQueryDriveType(ULONG ulDriveNum); 29 29 ULONG SysQueryFreeDriveSpace(ULONG ulDriveNum, ULONG *ulTotal, ULONG * ulFree, ULONG* ulBytesUnit); 30 ULONG SysQueryDiskName(ULONG ulDriveNum, ULONG ulSize, char *chrBuffer);30 ULONG SysQueryDiskName(ULONG ulDriveNum, char *chrBuffer, ULONG ulSize); 31 31 BOOL SysQueryHomeDir(char* chrBuf, ULONG ulSize); 32 32 -
trunk/common_functions/ini_funcs.c
r2 r4 1 1 /* 2 * This file is (C) Chris Wohlgemuth 2001-200 42 * This file is (C) Chris Wohlgemuth 2001-2005 3 3 */ 4 5 4 #define INCL_WIN 6 5 7 6 #include <os2.h> 8 7 9 /* 10 hini may be NULL. Then the filename is used to open the ini file. 11 */ 12 /*!**************************************************/ 8 /*!**************************************************/ 9 /* */ 10 /* @@MODULE */ 11 /* */ 12 /* Profile functions */ 13 13 /* */ 14 14 /* @@DESC */ … … 31 31 /* */ 32 32 /*!!*************************************************/ 33 BOOL IniSaveWindowPos(HINI hini, char * iniFile, char* chrApp, char *chrKey, HWND hwnd)33 BOOL PrfSaveWindowPos(HINI hini, char* iniFile, char* chrApp, char* chrKey, HWND hwnd) 34 34 { 35 35 BOOL bError=FALSE; … … 65 65 /*!**************************************************/ 66 66 /* */ 67 /* @@MODULE */ 68 /* */ 69 /* Profile functions */ 70 /* */ 67 71 /* @@DESC */ 68 72 /* */ … … 85 89 /* */ 86 90 /*!!*************************************************/ 87 BOOL IniRestoreWindowPos(HINI hini, char * iniFile, char* chrApp, char *chrKey, HWND hwnd, ULONG fSize)91 BOOL PrfRestoreWindowPos(HINI hini, char * iniFile, char* chrApp, char *chrKey, HWND hwnd, ULONG fSize) 88 92 { 89 93 HINI hiniPriv=hini; … … 115 119 } 116 120 117 118 121 /*!**************************************************/ 122 /* */ 123 /* @@MODULE */ 124 /* */ 125 /* Profile functions */ 126 /* */ 127 /* @@DESC */ 128 /* */ 129 /* Save a string in an INI file. */ 130 /* */ 131 /* . */ 132 /* */ 133 /* @@REMARKS */ 134 /* */ 135 /* If hini is NULL the given file name will be used */ 136 /* for opening the INI file. If hini is not NULL */ 137 /* the file name is ignored. */ 138 /* */ 139 /* @@RETURNS */ 140 /* */ 141 /* BOOL fSuccess */ 142 /* */ 143 /* TRUE: Function succeeded. */ 144 /* FALSE: Error occurred */ 145 /* */ 146 /*!!*************************************************/ 147 BOOL PrfWriteString(HINI hini, char * iniFile, char* chrApp, char *chrKey, char* chrString) 148 { 149 BOOL bError=FALSE; 150 HINI hiniPriv=hini; 151 152 if(!hini && !iniFile) 153 return FALSE; 154 155 do { 156 if(!hiniPriv) { 157 /* Open ini-file */ 158 if((hiniPriv=PrfOpenProfile(WinQueryAnchorBlock(HWND_DESKTOP),(unsigned char *)iniFile)) 159 ==NULLHANDLE) 160 break; 161 }/* end of if(!hiniPriv) */ 162 163 if(!PrfWriteProfileString(hiniPriv, chrApp, chrKey, chrString)) 164 bError=TRUE; 165 166 if(hiniPriv && !hini) 167 PrfCloseProfile(hiniPriv); 168 169 if(bError) 170 break; 171 return TRUE; 172 } while(TRUE); 173 return FALSE; 174 } 175 176 /*!**************************************************/ 177 /* */ 178 /* @@MODULE */ 179 /* */ 180 /* Profile functions */ 181 /* */ 182 /* @@DESC */ 183 /* */ 184 /* Get a string from an INI file. */ 185 /* */ 186 /* . */ 187 /* */ 188 /* @@REMARKS */ 189 /* */ 190 /* If hini is NULL the given file name will be used */ 191 /* for opening the INI file. If hini is not NULL */ 192 /* the file name is ignored. */ 193 /* */ 194 /* @@RETURNS */ 195 /* */ 196 /* ULONG ulLength */ 197 /* */ 198 /* TRUE: Function succeeded. */ 199 /* FALSE: Error occurred */ 200 /* */ 201 /*!!*************************************************/ 202 BOOL PrfQueryString(HINI hini, char * iniFile, char* chrApp, char *chrKey, char* chrDefault, char* chrBuffer, ULONG ulSize) 203 { 204 HINI hiniPriv=hini; 205 ULONG ulRC=0; 206 207 do{ 208 if(!hiniPriv) { 209 if((hiniPriv=PrfOpenProfile(WinQueryAnchorBlock(HWND_DESKTOP),(unsigned char *)iniFile)) 210 ==NULLHANDLE) 211 break; 212 }/* end of if(!hini) */ 213 214 ulRC=PrfQueryProfileString(hiniPriv, chrApp, chrKey, chrDefault, chrBuffer, ulSize); 215 216 if(hiniPriv && !hini) 217 PrfCloseProfile(hiniPriv); 218 219 break; 220 } while(TRUE); 221 return ulRC; 222 } 223 224 -
trunk/common_functions/listbox_funcs.c
r2 r4 14 14 #endif 15 15 16 /*!***********************************************************/ 17 /* */ 18 /* @@DESC */ 19 /* */ 20 /* To be written... */ 21 /* */ 22 /*!!**********************************************************/ 16 23 SHORT LBFindMatch(HWND hwndLB, char *chrMatchText) 17 24 { -
trunk/common_functions/menu_funcs.c
r2 r4 76 76 } 77 77 78 /*!***********************************************************/ 79 /* */ 80 /* @@DESC */ 81 /* */ 82 /* To be written... */ 83 /* */ 84 /*!!**********************************************************/ 78 85 SHORT menuQueryItemCount(HWND hwndMenu) 79 86 { … … 82 89 } 83 90 91 /*!***********************************************************/ 92 /* */ 93 /* @@DESC */ 94 /* */ 95 /* To be written... */ 96 /* */ 97 /*!!**********************************************************/ 84 98 MRESULT menuCheckItem(HWND hwndMenu, USHORT usID, BOOL fIncludeSubMenu, BOOL fCheck) 85 99 { … … 88 102 } 89 103 104 /*!***********************************************************/ 105 /* */ 106 /* @@DESC */ 107 /* */ 108 /* To be written... */ 109 /* */ 110 /*!!**********************************************************/ 90 111 MRESULT menuRemoveItem(HWND hwndMenu, USHORT usID, BOOL fIncludeSubMenu) 91 112 { … … 94 115 } 95 116 117 /*!***********************************************************/ 118 /* */ 119 /* @@DESC */ 120 /* */ 121 /* To be written... */ 122 /* */ 123 /*!!**********************************************************/ 96 124 MRESULT menuCheckForItem(HWND hwndMenu, USHORT usID, BOOL fIncludeSubMenu) 97 125 { -
trunk/common_functions/message.c
r2 r4 4 4 #include <os2.h> 5 5 #include <stdio.h> 6 #include <stdlib.h> 6 7 #include <string.h> 7 8 … … 44 45 /* ULONG ulResult */ 45 46 /* */ 46 /* MBID_ERROR i scase of an error. */47 /* MBID_ERROR in case of an error. */ 47 48 /* :p. */ 48 49 /* Result code from WinMessageBox(). */ … … 82 83 } 83 84 85 #if 0 84 86 /*!**************************************************/ 85 87 /* */ … … 89 91 /* the resource DLL or the EXE file. */ 90 92 /* Unlike messagebox no buffers must be given but */ 91 /* only the string IDs. M Ax title length is 100, */93 /* only the string IDs. Max title length is 256, */ 92 94 /* max text length 256. */ 95 /* :p. */ 96 /* */ 97 /* This function is obsolete. */ 98 /* Use MsgShowMessageBox() instead. */ 93 99 /* */ 94 100 /* @@RETURNS */ … … 96 102 /* ULONG ulResult */ 97 103 /* */ 98 /* MBID_ERROR i scase of an error. */104 /* MBID_ERROR in case of an error. */ 99 105 /* :p. */ 100 106 /* Result code from WinMessageBox(). */ 101 107 /* */ 108 /* @@REMARKS */ 109 /* */ 110 /* This function is obsolete. */ 111 /* Use MsgShowMessageBox() instead. */ 102 112 /* */ 103 113 /*!!*************************************************/ … … 105 115 { 106 116 char text[256]; 107 char title[ 100];117 char title[256]; 108 118 109 119 return mBox( text, ulIDText , sizeof(text), … … 111 121 hModule, hwnd, ulFlag); 112 122 }; 123 #endif 124 125 /*!**************************************************/ 126 /* */ 127 /* @@DESC */ 128 /* */ 129 /* Show a message box with text strings loaded from */ 130 /* the resource DLL or the EXE file. */ 131 /* Unlike messagebox() no buffers must be given but */ 132 /* only the string IDs. Max title length is 256, */ 133 /* max text length 256. */ 134 /* */ 135 /* @@PARAM */ 136 /* */ 137 /* HWND hwnd input */ 138 /* */ 139 /* Handle to a window. This will be the owner of */ 140 /* the message box. */ 141 /* */ 142 /* @@PARAM */ 143 /* */ 144 /* ULONG ulIDTitle input */ 145 /* */ 146 /* ID of the string to be used as the title. */ 147 /* */ 148 /* @@PARAM */ 149 /* */ 150 /* ULONG ulIDText input */ 151 /* */ 152 /* ID of the string to be used as the text. */ 153 /* */ 154 /* @@PARAM */ 155 /* */ 156 /* HMODULE hModule input */ 157 /* */ 158 /* Handle to a ressource DLL or NULLHANDLE. If */ 159 /* this parameter is null the strings will be */ 160 /* taken from ressources bound to the executable. */ 161 /* */ 162 /* @@PARAM */ 163 /* */ 164 /* ULONG ulFlags input */ 165 /* */ 166 /* Flags specifying the appearance of the message */ 167 /* box. See WinMessageBox() for more information. */ 168 /* */ 169 /* @@RETURNS */ 170 /* */ 171 /* ULONG ulResult */ 172 /* */ 173 /* MBID_ERROR in case of an error. This may be */ 174 /* for example if the ressources can't be found. */ 175 /* :p. */ 176 /* Result code from WinMessageBox(). */ 177 /* */ 178 /* @@REMARKS */ 179 /* */ 180 /* The parent of the message box is HWND_DESKTOP. */ 181 /* */ 182 /*!!*************************************************/ 183 ULONG MsgShowMessageBox(HWND hwnd, ULONG ulIDTitle, ULONG ulIDText, HMODULE hModule, ULONG ulFlag) 184 { 185 char* pText; 186 char* pTitle; 187 ULONG rc; 188 189 #define TLENGTH 256L 190 191 if(NULLHANDLE==(pText=malloc(TLENGTH*2*sizeof(char)))) 192 return MBID_ERROR; 193 194 pTitle=pText+TLENGTH*sizeof(char); 195 196 rc=mBox( pText, ulIDText , TLENGTH, 197 pTitle, ulIDTitle, TLENGTH, 198 hModule, hwnd, ulFlag); 199 200 free(pText); 201 return rc; 202 }; 203 113 204 114 205 /*!**************************************************/ … … 125 216 /* TRUE if string was found in the resource DLL or */ 126 217 /* EXE file. FALSE otherwise. */ 218 /* */ 219 /* @@REMARKS */ 220 /* */ 221 /* This function is obsolete. */ 222 /* Use MsgGetMessage() instead. */ 127 223 /* */ 128 224 /*!!*************************************************/ … … 136 232 } 137 233 234 /*!***********************************************************/ 235 /* */ 236 /* Load a message string from a resource DLL or the */ 237 /* EXE file. */ 238 /* */ 239 /* @@RETURNS */ 240 /* */ 241 /* BOOL rc */ 242 /* */ 243 /* TRUE if string was found in the resource DLL or */ 244 /* EXE file. FALSE otherwise. */ 245 /* */ 246 /* @@REMARKS */ 247 /* */ 248 /* If an error occurs an empty string is placed in the */ 249 /* buffer. */ 250 /* */ 251 /*!!**********************************************************/ 138 252 BOOL MsgGetMessage(char* text,ULONG ulID, LONG lSizeText, HMODULE hResource,HWND hwnd) 139 253 { -
trunk/common_functions/rexx_funcs.c
r2 r4 25 25 } RXSTEMDATA; 26 26 27 /*!**************************************************/ 28 /* */ 29 /* @@DESC */ 30 /* */ 31 /* To be written... */ 32 /* */ 33 /*!!*************************************************/ 27 34 LONG RxGetLongFromStemWithoutNumber(RXSTRING args, char * chrTail, ULONG* ulError) 28 35 { … … 74 81 } 75 82 76 /*************************************************************/ 83 /*!***********************************************************/ 84 /* */ 85 /* @@DESC */ 77 86 /* */ 78 87 /* This function returns a string from a stem. The caller */ 79 88 /* must free the returned string with free() */ 80 89 /* */ 81 /* ************************************************************/90 /*!!**********************************************************/ 82 91 PSZ RxGetStringFromStemWithoutNumber(RXSTRING args, char *chrTail, ULONG* ulError) 83 92 { … … 125 134 } 126 135 127 /*************************************************************/ 136 /*!***********************************************************/ 137 /* */ 138 /* @@DESC */ 128 139 /* */ 129 140 /* This function returns a long from a REXX var. */ 130 141 /* */ 131 /* ************************************************************/142 /*!!**********************************************************/ 132 143 LONG RxGetLongFromVar(char * chrVar, ULONG* ulError) 133 144 { … … 175 186 } 176 187 188 /*!***********************************************************/ 189 /* */ 190 /* @@DESC */ 191 /* */ 192 /* To be written... */ 193 /* */ 194 /*!!**********************************************************/ 177 195 LONG RxSetLongInRexxVar(char* chrVar, ULONG ulVal) 178 196 { -
trunk/common_functions/sys_funcs.c
r2 r4 22 22 #endif 23 23 24 /**!**************************************************/25 26 27 28 29 30 31 32 33 34 35 36 37 /**!!*************************************************/24 /*!**************************************************/ 25 /* */ 26 /* @@DESC */ 27 /* */ 28 /* This funktion returns the drive letter of the */ 29 /* boot partition. */ 30 /* */ 31 /* @@RETURNS */ 32 /* */ 33 /* char chrDrive */ 34 /* */ 35 /* Drive from which the system was booted. */ 36 /* */ 37 /*!!*************************************************/ 38 38 char SysQueryBootDriveLetter(void) 39 39 { … … 73 73 } 74 74 75 /**!**************************************************/ 75 /* 76 Documentation script can't handle the const keyword yet!!!! 77 */ 78 /*--->!**************************************************/ 76 79 /* */ 77 80 /* @@DESC */ … … 87 90 /* !parsing is broken at the moment because of const and (...) */ 88 91 /* */ 89 /* *!!*************************************************/92 /*!!*************************************************/ 90 93 void SysWriteToTrapLog(const char* chrFormat, ...) 91 94 { … … 143 146 /* Size of the file. */ 144 147 /* */ 148 /* @@REMARKS */ 149 /* */ 150 /* In case of a nonexistant file 0 is returned. So */ 151 /* it's necessary to first check if the file exists.*/ 152 /* */ 145 153 /*!!*************************************************/ 146 154 ULONG SysQueryFileSize(char* chrFileName) … … 179 187 } 180 188 189 /*!**************************************************/ 190 /* */ 191 /* @@DESC */ 192 /* */ 193 /* To be written... */ 194 /* */ 195 /*!!*************************************************/ 181 196 ULONG SysQueryDriveType(ULONG ulDriveNum) 182 197 { … … 215 230 216 231 // SysWriteToTrapLog("Drive nr.: %d, rc for DSK_BLOCKREMOVABLE-> ERROR_NOT_SUPPORTED\n", ulDriveNum); 217 sprintf(chrDev, "%c:", 'a'+ ulDriveNum-1);232 sprintf(chrDev, "%c:", 'a'+(char)(ulDriveNum-1)); 218 233 cbBuf=sizeof(buf); 219 234 … … 350 365 #endif 351 366 367 /*!**************************************************/ 368 /* */ 369 /* @@DESC */ 370 /* */ 371 /* To be written... */ 372 /* */ 373 /*!!*************************************************/ 352 374 ULONG SysQueryFreeDriveSpace(ULONG ulDriveNum, ULONG *ulTotal, ULONG * ulFree, ULONG* ulBytesUnit) 353 375 { … … 371 393 } 372 394 373 /* 374 The returned volname is always terminated by zero. 375 ulDriveNum: 1...26 376 */ 377 ULONG SysQueryDiskName(ULONG ulDriveNum, ULONG ulSize, char *chrBuffer) 395 /*!**************************************************/ 396 /* */ 397 /* @@DESC */ 398 /* */ 399 /* This function returns the home directory of the */ 400 /* current user. */ 401 /* */ 402 /* @@RETURNS */ 403 /* */ 404 /* ULONG rc */ 405 /* */ 406 /* NO_ERROR is returned if the function succeeds. */ 407 /* */ 408 /* @@PARAM */ 409 /* */ 410 /* ULONG ulDriveNum input */ 411 /* */ 412 /* The number of the drive to be queried (1-26). */ 413 /* */ 414 /* @@PARAM */ 415 /* */ 416 /* char* chrBuffer in/out */ 417 /* */ 418 /* Pointer to a buffer where the volume name will */ 419 /* be placed. */ 420 /* */ 421 /* @@PARAM */ 422 /* */ 423 /* ULONG ulSize input */ 424 /* */ 425 /* Size of the name buffer. */ 426 /* */ 427 /* @@REMARKS */ 428 /* */ 429 /* The returned name is always terminated by zero. */ 430 /* */ 431 /*!!*************************************************/ 432 433 ULONG SysQueryDiskName(ULONG ulDriveNum, char *chrBuffer, ULONG ulSize) 378 434 { 379 435 FSINFO fsIBuf; … … 394 450 } 395 451 452 /*!**************************************************/ 453 /* */ 454 /* @@DESC */ 455 /* */ 456 /* This function returns the home directory of the */ 457 /* current user. */ 458 /* */ 459 /* @@RETURNS */ 460 /* */ 461 /* BOOL fSuccess */ 462 /* */ 463 /* TRUE if the home dir is specified and does exist */ 464 /* */ 465 /* @@PARAM */ 466 /* */ 467 /* char* chrBuf in/out */ 468 /* */ 469 /* Pointer to a buffer where the home directory */ 470 /* name will be placed. */ 471 /* */ 472 /* @@PARAM */ 473 /* */ 474 /* ULONG ulSize input */ 475 /* */ 476 /* Size of the name buffer. */ 477 /* */ 478 /* @@REMARKS */ 479 /* */ 480 /* The returned string is always terminated by zero.*/ 481 /* .p: */ 482 /* If a directory is specified in the HOME */ 483 /* environment variable but doesn't exist FALSE is */ 484 /* returned and a message is written to the apps */ 485 /* exception log. */ 486 /* */ 487 /*!!*************************************************/ 396 488 BOOL SysQueryHomeDir(char* chrBuf, ULONG ulSize) 397 489 { … … 400 492 if(!chrHome || !chrBuf) 401 493 return FALSE; 402 403 #if 0404 SysWriteToTrapLog("r:\\temp: %d , r:\\bla: %d \n",405 SysCheckFileExists("r:\\temp"), SysCheckFileExists("r:\\bla"));406 #endif407 494 408 495 if(strlcpy(chrBuf, chrHome, ulSize)>=ulSize) { -
trunk/common_functions/uptime.c
r2 r4 257 257 } 258 258 259 /*!***********************************************************/ 260 /* */ 261 /* @@DESC */ 262 /* */ 263 /* To be written... */ 264 /* */ 265 /*!!**********************************************************/ 259 266 ULONG SysGetUptimeSecs(BOOL fUseTimer) 260 267 { … … 265 272 } 266 273 274 /*!***********************************************************/ 275 /* */ 276 /* @@DESC */ 277 /* */ 278 /* To be written... */ 279 /* */ 280 /*!!**********************************************************/ 267 281 char* SysGetUptimeString(BOOL fUseTimer, char * chrBuffer, ULONG ulSize) 268 282 {
Note:
See TracChangeset
for help on using the changeset viewer.