| 93 | } |
| 94 | |
| 95 | extern void LASLIB_DLL byebye() { |
| 96 | // optional: print stats |
| 97 | if (print_log_stats_) { |
| 98 | LASMessage( |
| 99 | LAS_INFO, "Log stats: FE=%lu,E=%lu,SW=%lu,W=%lu,I=%lu", lasmessage_cnt[LAS_FATAL_ERROR], lasmessage_cnt[LAS_ERROR], |
| 100 | lasmessage_cnt[LAS_SERIOUS_WARNING], lasmessage_cnt[LAS_WARNING], lasmessage_cnt[LAS_INFO]); |
| 101 | } |
| 102 | if (wait_on_exit_) { |
| 103 | std::fprintf(stderr, "<press ENTER>\n"); |
| 104 | (void)std::getc(stdin); |
| 105 | } |
| 106 | //duplicate log messages with the number of repeated times. |
| 107 | flush_repeated_logs(); |
| 108 | // |
| 109 | int code = 0; |
| 110 | if (lasmessage_cnt[LAS_FATAL_ERROR] > 0) { |
| 111 | code = 4; |
| 112 | } else if (lasmessage_cnt[LAS_ERROR] > 0) { |
| 113 | code = 3; |
| 114 | } else if (lasmessage_cnt[LAS_SERIOUS_WARNING] > 0) { |
| 115 | code = 2; |
| 116 | } else if (lasmessage_cnt[LAS_WARNING] > 0) { |
| 117 | code = 1; |
| 118 | } |
| 119 | exit(code); |
| 120 | } |
| 121 | |
| 122 | /// Validates whether a given string is UTF-8 encoded. |
| 123 | bool validate_utf8(const char* str, bool restrict_to_two_bytes) noexcept { |
nothing calls this directly
no test coverage detected