comparison src/name/blackcap/exifwasher/exiv2/Initialize.kt @ 2:efd9fe2d70d7

Rationalize exceptions, code whitelist, add command-line tool.
author David Barts <n5jrn@me.com>
date Wed, 01 Apr 2020 14:23:54 -0700
parents 42277ce58ace
children 9ac6136c710c
comparison
equal deleted inserted replaced
1:42277ce58ace 2:efd9fe2d70d7
59 } catch (e: IOException) { 59 } catch (e: IOException) {
60 val message = e.message ?: "I/O error" 60 val message = e.message ?: "I/O error"
61 die("unable to create ${tPath}: ${message}") 61 die("unable to create ${tPath}: ${message}")
62 } 62 }
63 try { 63 try {
64 println("loading: ${tPath}") /* debug */
65 System.load(tPath) 64 System.load(tPath)
66 } catch (e: UnsatisfiedLinkError) { 65 } catch (e: UnsatisfiedLinkError) {
67 val message = e.message ?: "unsatisfied link" 66 val message = e.message ?: "unsatisfied link"
68 die("unable to link ${tPath}: ${message}") 67 die("unable to link ${tPath}: ${message}")
69 } 68 }
70 } 69 }
71 70
72 initialized = true 71 initialized = true
73 System.err.println("libraries loaded") /* debug */
74 } 72 }
75 73
76 private fun die(message: String) { 74 private fun die(message: String) {
77 /* should open a dialog */ 75 /* should open a dialog */
78 System.err.println(message) 76 System.err.println(message)