View Single Post
Old 10-27-2018, 06:36 PM   #40
NiLuJe
BLAM!
NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.
 
NiLuJe's Avatar
 
Posts: 13,478
Karma: 26012494
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
@frostschutz:

Turns out doing it with NTX's HWConfig thingy is less gnarly than I thought (plus, @pazos did most of the heavy lifting for the Cervantes port anyway ), so that's coming along nicely (as a fallback, because the distinction between some specific devices is harder to make... and of course, among those is one that's already crappy to handle right between the two versions, namely, the H2OČ -_-").


As for your line issue, yep, you have a couple of choices: the -L flag usurps the process exit code to set it to the number of lines printed, while the -l flag does the same the old-fashioned way, by outputting it to stdout (which means it enforces the extra-silent mode of operation).
Yes, I had weird constraints on Kindle where non-zero return codes where a big no-no, hence the crappy workaround .

EDIT: See this for one example of how I'm using that in shell.

It's of course much easier in C, because fbink_print just returns that number, plain and simple, you just have to check for errors, which are always negative .

Last edited by NiLuJe; 10-27-2018 at 06:39 PM.
NiLuJe is offline   Reply With Quote