Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // tango.zh
- // Version 1.0.0
- // Verbose message logging.
- void __Tango_LogMessage(int msg, float data)
- {
- // Ignore it
- }
- void __Tango_LogError(int errorNum, int data)
- {
- int str[]="tango.zh error: ";
- TraceS(str);
- if(errorNum==__TANGO_ERROR_OVERFLOW)
- {
- int str2[]="String too large for buffer";
- TraceS(str2);
- TraceNL();
- }
- else if(errorNum==__TANGO_ERROR_INVALID_CHARACTER)
- {
- int dataBuf[12];
- __Tango_FloatToASCII(dataBuf, data, true);
- int str2[]="Invalid character encountered: %s\n";
- printf(str2, dataBuf);
- }
- else if(errorNum==__TANGO_ERROR_UNDEFINED_FUNCTION)
- {
- int str2[]="Undefined function encountered: %f\n";
- printf(str2, data);
- }
- else if(errorNum==__TANGO_ERROR_TOO_MANY_ARGS)
- {
- int str2[]="More than %d arguments given to a function\n";
- printf(str2, __TANGO_MAX_FUNCTION_ARGS);
- int str3[]="(%d is the maximum, not necessarily the correct number)\n";
- printf(str3, __TANGO_MAX_FUNCTION_ARGS);
- }
- else if(errorNum==__TANGO_ERROR_INVALID_STYLE)
- {
- int str2[]="Invalid style specified.";
- TraceS(str2);
- TraceNL();
- int dataBuf[12];
- __Tango_FloatToASCII(dataBuf, data, true);
- int str3[]="Style was %s; valid styles are integers from 0 to %d\n";
- printf(str3, dataBuf, __TANGO_NUM_STYLES-1);
- }
- else if(errorNum==__TANGO_ERROR_INVALID_SLOT)
- {
- int str2[]="Invalid slot specified.";
- TraceS(str2);
- TraceNL();
- int dataBuf[12];
- __Tango_FloatToASCII(dataBuf, data, true);
- int str3[]="Slot was %s; valid slots are integers from 0 to %d\n";
- printf(str3, dataBuf, __TANGO_NUM_SLOTS-1);
- }
- else if(errorNum==__TANGO_ERROR_INVALID_FUNCTION)
- {
- int str2[]="The string contains an invalid or incomplete function call.";
- TraceS(str2);
- TraceNL();
- int str3[]="Error occurred at position %d\n";
- printf(str3, data);
- }
- else if(errorNum==__TANGO_ERROR_INVALID_CHARACTER_CODE)
- {
- int str2[]="The string contains an invalid or incomplete character code.";
- TraceS(str2);
- TraceNL();
- int str3[]="Error occurred at position %d\n";
- printf(str3, data);
- }
- else if(errorNum==__TANGO_ERROR_INVALID_ARGUMENT)
- {
- int str2[]="The string contains an invalid function argument.";
- TraceS(str2);
- TraceNL();
- int str3[]="Error occurred at position %d\n";
- printf(str3, data);
- }
- else if(errorNum==__TANGO_ERROR_INVALID_STRING_ARG)
- {
- int str2[]="The argument to @string() was not a valid string.";
- TraceS(str2);
- TraceNL();
- int dataBuf[12];
- __Tango_FloatToASCII(dataBuf, data, true);
- int str3[]="Pointer value was %s\n";
- printf(str3, dataBuf);
- }
- else if(errorNum==__TANGO_ERROR_LOAD_INVALID_STRING)
- {
- int str2[]="Attempted to load an invalid string.";
- TraceS(str2);
- TraceNL();
- int dataBuf[12];
- __Tango_FloatToASCII(dataBuf, data, true);
- int str3[]="Pointer value was %s\n";
- printf(str3, dataBuf);
- }
- else if(errorNum==__TANGO_ERROR_LOAD_INVALID_MESSAGE)
- {
- int str2[]="Attempted to load an invalid message.";
- TraceS(str2);
- TraceNL();
- int dataBuf[12];
- __Tango_FloatToASCII(dataBuf, data, true);
- int str3[]="Message number was was %s\n";
- printf(str3, dataBuf);
- }
- else if(errorNum==__TANGO_ERROR_UNDEFINED_VAR)
- {
- int str2[]="An undefined variable was referenced.";
- TraceS(str2);
- TraceNL();
- }
- else if(errorNum==__TANGO_ERROR_INCOMPLETE_SCC)
- {
- int str2[]="The message contains an incomplete string control code.";
- TraceS(str2);
- TraceNL();
- int str3[]="Error occurred at position %d\n";
- printf(str3, data);
- }
- else if(errorNum==__TANGO_ERROR_SCC_DISABLED)
- {
- int str2[]="The message contains a string control code, but string control codes are disabled.";
- TraceS(str2);
- TraceNL();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement