Advertisement
ZoriaRPG

LoggingIntermediate.zh

Feb 18th, 2017
231
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 4.34 KB | None | 0 0
  1. // tango.zh
  2. // Version 1.0.0
  3.  
  4.  
  5. // Verbose message logging.
  6.  
  7. void __Tango_LogMessage(int msg, float data)
  8. {
  9.     // Ignore it
  10. }
  11.  
  12. void __Tango_LogError(int errorNum, int data)
  13. {
  14.     int str[]="tango.zh error: ";
  15.     TraceS(str);
  16.    
  17.     if(errorNum==__TANGO_ERROR_OVERFLOW)
  18.     {
  19.         int str2[]="String too large for buffer";
  20.         TraceS(str2);
  21.         TraceNL();
  22.     }
  23.     else if(errorNum==__TANGO_ERROR_INVALID_CHARACTER)
  24.     {
  25.         int dataBuf[12];
  26.         __Tango_FloatToASCII(dataBuf, data, true);
  27.         int str2[]="Invalid character encountered: %s\n";
  28.         printf(str2, dataBuf);
  29.     }
  30.     else if(errorNum==__TANGO_ERROR_UNDEFINED_FUNCTION)
  31.     {
  32.         int str2[]="Undefined function encountered: %f\n";
  33.         printf(str2, data);
  34.     }
  35.     else if(errorNum==__TANGO_ERROR_TOO_MANY_ARGS)
  36.     {
  37.         int str2[]="More than %d arguments given to a function\n";
  38.         printf(str2, __TANGO_MAX_FUNCTION_ARGS);
  39.        
  40.         int str3[]="(%d is the maximum, not necessarily the correct number)\n";
  41.         printf(str3, __TANGO_MAX_FUNCTION_ARGS);
  42.     }
  43.     else if(errorNum==__TANGO_ERROR_INVALID_STYLE)
  44.     {
  45.         int str2[]="Invalid style specified.";
  46.         TraceS(str2);
  47.         TraceNL();
  48.        
  49.         int dataBuf[12];
  50.         __Tango_FloatToASCII(dataBuf, data, true);
  51.         int str3[]="Style was %s; valid styles are integers from 0 to %d\n";
  52.         printf(str3, dataBuf, __TANGO_NUM_STYLES-1);
  53.     }
  54.     else if(errorNum==__TANGO_ERROR_INVALID_SLOT)
  55.     {
  56.         int str2[]="Invalid slot specified.";
  57.         TraceS(str2);
  58.         TraceNL();
  59.        
  60.         int dataBuf[12];
  61.         __Tango_FloatToASCII(dataBuf, data, true);
  62.         int str3[]="Slot was %s; valid slots are integers from 0 to %d\n";
  63.         printf(str3, dataBuf, __TANGO_NUM_SLOTS-1);
  64.     }
  65.     else if(errorNum==__TANGO_ERROR_INVALID_FUNCTION)
  66.     {
  67.         int str2[]="The string contains an invalid or incomplete function call.";
  68.         TraceS(str2);
  69.         TraceNL();
  70.        
  71.         int str3[]="Error occurred at position %d\n";
  72.         printf(str3, data);
  73.     }
  74.     else if(errorNum==__TANGO_ERROR_INVALID_CHARACTER_CODE)
  75.     {
  76.         int str2[]="The string contains an invalid or incomplete character code.";
  77.         TraceS(str2);
  78.         TraceNL();
  79.        
  80.         int str3[]="Error occurred at position %d\n";
  81.         printf(str3, data);
  82.     }
  83.     else if(errorNum==__TANGO_ERROR_INVALID_ARGUMENT)
  84.     {
  85.         int str2[]="The string contains an invalid function argument.";
  86.         TraceS(str2);
  87.         TraceNL();
  88.        
  89.         int str3[]="Error occurred at position %d\n";
  90.         printf(str3, data);
  91.     }
  92.     else if(errorNum==__TANGO_ERROR_INVALID_STRING_ARG)
  93.     {
  94.         int str2[]="The argument to @string() was not a valid string.";
  95.         TraceS(str2);
  96.         TraceNL();
  97.        
  98.         int dataBuf[12];
  99.         __Tango_FloatToASCII(dataBuf, data, true);
  100.         int str3[]="Pointer value was %s\n";
  101.         printf(str3, dataBuf);
  102.     }
  103.     else if(errorNum==__TANGO_ERROR_LOAD_INVALID_STRING)
  104.     {
  105.         int str2[]="Attempted to load an invalid string.";
  106.         TraceS(str2);
  107.         TraceNL();
  108.        
  109.         int dataBuf[12];
  110.         __Tango_FloatToASCII(dataBuf, data, true);
  111.         int str3[]="Pointer value was %s\n";
  112.         printf(str3, dataBuf);
  113.     }
  114.     else if(errorNum==__TANGO_ERROR_LOAD_INVALID_MESSAGE)
  115.     {
  116.         int str2[]="Attempted to load an invalid message.";
  117.         TraceS(str2);
  118.         TraceNL();
  119.        
  120.         int dataBuf[12];
  121.         __Tango_FloatToASCII(dataBuf, data, true);
  122.         int str3[]="Message number was was %s\n";
  123.         printf(str3, dataBuf);
  124.     }
  125.     else if(errorNum==__TANGO_ERROR_UNDEFINED_VAR)
  126.     {
  127.         int str2[]="An undefined variable was referenced.";
  128.         TraceS(str2);
  129.         TraceNL();
  130.     }
  131.     else if(errorNum==__TANGO_ERROR_INCOMPLETE_SCC)
  132.     {
  133.         int str2[]="The message contains an incomplete string control code.";
  134.         TraceS(str2);
  135.         TraceNL();
  136.    
  137.         int str3[]="Error occurred at position %d\n";
  138.         printf(str3, data);
  139.     }
  140.     else if(errorNum==__TANGO_ERROR_SCC_DISABLED)
  141.     {
  142.         int str2[]="The message contains a string control code, but string control codes are disabled.";
  143.         TraceS(str2);
  144.         TraceNL();
  145.     }
  146. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement