Changeset 4 for trunk/common_functions/sys_funcs.c
- Timestamp:
- Jul 13, 2017, 5:17:57 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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) {
Note:
See TracChangeset
for help on using the changeset viewer.