123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119 |
- // stdafx.cpp : 只包括标准包含文件的源文件
- // BurndiscTest.pch 将作为预编译头
- // stdafx.obj 将包含预编译类型信息
- #include "stdafx.h"
- BOOL NERO_CALLBACK_ATTR _IdleCallback (void *pUserData)
- {
- return false;
- }
- NeroUserDlgInOut NERO_CALLBACK_ATTR _UserDialog (void *pUserData, NeroUserDlgInOut type, void *data)
- {
- return DLG_RETURN_EXIT;
- }
- BOOL NERO_CALLBACK_ATTR _ProgressCallback (void *pUserData, DWORD dwProgressInPercent)
- {
- printf ("%03d%%\r", dwProgressInPercent);
- return false;
- }
- BOOL NERO_CALLBACK_ATTR _AbortedCallback (void *pUserData)
- {
- // printf("Abort ?\n");
- return false;
- }
- void NERO_CALLBACK_ATTR _AddLogLine (void *pUserData, NERO_TEXT_TYPE type, const char *text)
- {
- char *header = " ";
- const char *start;
- switch (type) {
- case NERO_TEXT_INFO: /* informative text */
- header = "i ";
- break;
- case NERO_TEXT_STOP: /* some operation stopped prematurely */
- header = "# ";
- break;
- case NERO_TEXT_EXCLAMATION: /* important information */
- header = "! ";
- break;
- case NERO_TEXT_QUESTION: /* a question which requires an answer */
- header = "? ";
- break;
- case NERO_TEXT_DRIVE: /* a message concerning a CD-ROM drive or recorder */
- header = "- ";
- break;
- default:
- break;
- }
- start = text;
- while (start) {
- const char *end = strchr (start, '\n');
- int len = end ? (int)(end - start) : strlen (start);
- fputs (header, stdout);
- fwrite (start, 1, len, stdout);
- // clear rest of line
- len = 79 - strlen (header) - len;
- while (--len >= 0) {
- putchar (' ');
- }
- puts ("");
- start = end ? end + 1 : NULL;
- }
- }
- void NERO_CALLBACK_ATTR _SetPhaseCallback (void *pUserData, const char *text)
- {
- int len;
- printf (" %s", text);
- // clear rest of line
- len = 79 - strlen (text) - 5;
- while (--len >= 0) {
- putchar (' ');
- }
- putchar ('\r');
- }
- void NERO_CALLBACK_ATTR _DisableAbortCallback (void *pUserData, BOOL enableAbort)
- {
- if (!enableAbort)
- puts("The current process cannot be interrupted");
- else puts("The process can be interrupted again");
- }
- void NERO_CALLBACK_ATTR _SetMajorPhaseCallback(void *pUserData,NERO_MAJOR_PHASE phase,void *reserved)
- {
- }
- DWORD NERO_CALLBACK_ATTR _WriteIOCallback (void *pUserData, BYTE *pBuffer, DWORD dwLen)
- {
- return fwrite (pBuffer, 1, dwLen, (FILE *)pUserData);
- }
- BOOL NERO_CALLBACK_ATTR _EOFCallback (void *pUserData)
- {
- return feof ((FILE *)pUserData);
- }
- BOOL NERO_CALLBACK_ATTR _ErrorCallback (void *pUserData)
- {
- return ferror ((FILE *)pUserData);
- }
- DWORD NERO_CALLBACK_ATTR _ReadIOCallback (void *pUserData, BYTE *pBuffer, DWORD dwLen)
- {
- return fread (pBuffer, 1, dwLen, (FILE *)pUserData);
- }
|