Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Readers > Amazon Kindle > Kindle Developer's Corner

Notices

Reply
 
Thread Tools Search this Thread
Old 10-30-2018, 01:08 PM   #106
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
@jackie_w:

I may have skimmed the code a wee bit too fast...

* Yeah, it only writes the state to the config if retainStateOverRestart is enabled in the [state] section... :/.

* I may have totally missed how the parser handled ini sections... .

i.e., the test should probably be grep -q "invertActive = yes", since state is the section, so, a [state] header, and not a state: prefix like it's handled in the code.

----

Random comment: since here, both -C & -B are passed, one could also simply invert the arguments instead of using -h . (Not that there's anything wrong with -h: I checked ).

Last edited by NiLuJe; 10-30-2018 at 01:13 PM.
NiLuJe is offline   Reply With Quote
Old 10-30-2018, 01:18 PM   #107
jackie_w
Grand Sorcerer
jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.
 
Posts: 6,212
Karma: 16534894
Join Date: Sep 2009
Location: UK
Device: Kobo: KA1, ClaraHD, Forma, Libra2, Clara2E. PocketBook: TouchHD3
Quote:
Originally Posted by NiLuJe View Post
Random comment: since here, both -C & -B are passed, one could also simply invert the arguments instead of using -h .
A-ha, I'm one step ahead of you there, I just didn't admit it . I did remove the -h option and try this. Same result, or should I say, No Result

I'll try the other suggestions.
jackie_w is offline   Reply With Quote
Advert
Old 10-30-2018, 01:50 PM   #108
PoP
 curly᷂͓̫̙᷊̥̮̾ͯͤͭͬͦͨ ʎʌɹnɔ
PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.
 
PoP's Avatar
 
Posts: 3,002
Karma: 50506927
Join Date: Dec 2010
Location: ♁ ᴺ₄₅°₃₀' ᵂ₇₃°₃₇' ±₆₀"
Device: K3₃.₄.₃ PW3&4₅.₁₃.₃
Quote:
Originally Posted by NiLuJe View Post
@PoP: Updated the package in #93 .
Thanks for adding the static library and header.

Quote:
Originally Posted by NiLuJe View Post
@PoP: The static lib? Wouldn't a shared one be more useful?
Absolutely. I now understand why. My FT only came with a shared library, so I can't compile with -static anyway.
PoP is offline   Reply With Quote
Old 10-30-2018, 02:06 PM   #109
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
@PoP: I ended up bundling the static one because that's how the Kindle version is built, so, more practical for me ;p.

-lfbink *will* pickup the static library if that's the only one there (it prefers shared libs, but that's it). Conversely, -l:libfbink.a will *only* pickup the static library, even if the shared one is present in the search paths .
NiLuJe is offline   Reply With Quote
Old 10-30-2018, 02:17 PM   #110
PoP
 curly᷂͓̫̙᷊̥̮̾ͯͤͭͬͦͨ ʎʌɹnɔ
PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.
 
PoP's Avatar
 
Posts: 3,002
Karma: 50506927
Join Date: Dec 2010
Location: ♁ ᴺ₄₅°₃₀' ᵂ₇₃°₃₇' ±₆₀"
Device: K3₃.₄.₃ PW3&4₅.₁₃.₃
@NiLuJe, I understand that

but a shared compile expectedly gives
Code:
[root@kindle tcc]# tcc -Iinclude -Iinclude/freetype2/freetype -Iinclude/freetype2 -Iinclude/fbink -L/mnt/us/linkfonts/lib/autohint -lfreetype -L/mnt/us/usbnet/bin -lfbink -o  fbinkpantspatrol fbinkpantspatrol.c
tcc: undefined symbol 'fbink_init'
tcc: undefined symbol 'fbink_print_raw_data'
and a static compile seems to now need a static freetype lib
Code:
[root@kindle tcc]# tcc -Iinclude -Iinclude/freetype2/freetype -Iinclude/freetype2 -Iinclude/fbink -L/mnt/us/linkfonts/lib/autohint -lfreetype -L/mnt/us/usbnet/bin -lfbink -static -o  fbinkpantspatrol fbinkpantspatrol.c
tcc: cannot find -lfreetype
I don't want to hijack the thread with C compilation noobe stuff. Lemme learn more. Go in peace for now.

Last edited by PoP; 10-30-2018 at 02:19 PM. Reason: j -> J
PoP is offline   Reply With Quote
Advert
Old 10-30-2018, 02:21 PM   #111
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
@PoP:

1. There's a very strong possibility poor TCC doesn't know how to deal with LTO objects in the static library .

2. Never pass -static to anything, anywhere, ever ^^. -static ranges from evil to actively broken when using the glibc. It's only useful in very, very, very specific circumstances (generally, when you're static linking to an alternate libc that's designed for that, f.g., musl).

Last edited by NiLuJe; 10-30-2018 at 02:47 PM.
NiLuJe is offline   Reply With Quote
Old 10-30-2018, 02:36 PM   #112
PoP
 curly᷂͓̫̙᷊̥̮̾ͯͤͭͬͦͨ ʎʌɹnɔ
PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.
 
PoP's Avatar
 
Posts: 3,002
Karma: 50506927
Join Date: Dec 2010
Location: ♁ ᴺ₄₅°₃₀' ᵂ₇₃°₃₇' ±₆₀"
Device: K3₃.₄.₃ PW3&4₅.₁₃.₃
Quote:
Originally Posted by NiLuJe View Post
@PoP:

1. There's a very strong possibility poor TCC doesn't know how to deal with LTO objects in the static library .

Hahaha. Back to square one I lazilly thought TCC would spare me from installing the tool chain and cross compiling.

2. Never pass -static to anything, anywhere, ever ^^. -static ranges from evil to actively broken when using the glibc. It's only useful in very, very, very specific circumstances (generally, when you're static linking to an alternate libc that's designed for that, i.e., musl).

Muah-ah-ah. Noted.
Thanks
PoP is offline   Reply With Quote
Old 10-30-2018, 02:46 PM   #113
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
@PoP: Switched to a shared lib.

In any case, it's smaller, so, eh, I'll consider that a win-win .

(You'll need some rpath shenanigans when compiling, or some LD_LIBRARY_PATH shenanigans when running, to properly pickup the libs at runtime ).

EDIT: And on the off-chance a recent build of TCC helps, here goes.
Attached Files
File Type: gz tcc-mob-10-30-18.tar.gz (1.29 MB, 163 views)
File Type: gz tcc-mob-05-30-19.tar.gz (1.31 MB, 145 views)
File Type: gz tcc-mob-09-03-19.tar.gz (2.64 MB, 140 views)

Last edited by NiLuJe; 09-04-2019 at 08:30 AM. Reason: Bump to 09/03/19
NiLuJe is offline   Reply With Quote
Old 10-30-2018, 03:35 PM   #114
jackie_w
Grand Sorcerer
jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.
 
Posts: 6,212
Karma: 16534894
Join Date: Sep 2009
Location: UK
Device: Kobo: KA1, ClaraHD, Forma, Libra2, Clara2E. PocketBook: TouchHD3
Quote:
Originally Posted by NiLuJe View Post
* Yeah, it only writes the state to the config if retainStateOverRestart is enabled in the [state] section... :/.

* I may have totally missed how the parser handled ini sections... .
i.e., the test should probably be grep -q "invertActive = yes", since state is the section, so, a [state] header, and not a state: prefix like it's handled in the code.
I think we're in business! The above 2 things are the key.

However, when NightMode rewrites nightmode.ini, the format of the line changes slightly.
Original .ini:
Code:
[state]
invertActive = no		# yes / no
Re-written .ini:
Code:
[state]
invertActive                   = no
So I think a regex will fix that. After a bit of googling I came up with this. Does it look OK?
Code:
if grep -Eq "invertActive\s*=\s*yes" "/mnt/onboard/.kobo/nightmode.ini" ; then
jackie_w is offline   Reply With Quote
Old 10-30-2018, 04:03 PM   #115
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
I'll have to double-check what the busybox version of grep bundled on the Kobo supports, exactly, and I'll get back to you (dinner time), but, yeah, the idea'll be to ignore the whitespace, thanks for the config excerpt, that's what I was missing ^^.
NiLuJe is offline   Reply With Quote
Old 10-30-2018, 05:20 PM   #116
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
@jackie_w: Yep, that works!

(I always forgot what the backslash character classes refer to, so I tend to go with [[:blank:]] instead, but, yeah, \s matches a whitespace, so, that does the trick ).
NiLuJe is offline   Reply With Quote
Old 10-30-2018, 05:35 PM   #117
jackie_w
Grand Sorcerer
jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.
 
Posts: 6,212
Karma: 16534894
Join Date: Sep 2009
Location: UK
Device: Kobo: KA1, ClaraHD, Forma, Libra2, Clara2E. PocketBook: TouchHD3
Quote:
Originally Posted by NiLuJe View Post
@jackie_w: Yep, that works!

(I always forgot what the backslash character classes refer to, so I tend to go with [[:blank:]] instead, but, yeah, \s matches a whitespace, so, that does the trick ).
Thanks very much for all your help. Sorry (but not very) for being a persistent PITA As penance I'll document what I did in the main Miniclock thread in case anyone else is interested ... but maybe not till tomorrow.

Maybe I didn't need the grep -Eq because your original grep -q seems to work fine. I didn't realise that grep understood regex patterns by default.
jackie_w is offline   Reply With Quote
Old 10-30-2018, 05:44 PM   #118
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
@jackie_w: There's a quirk involved in that it understands a specific syntax/subset of regex by default, while -E enables another syntax with more features .

And no, I can never remember which is which, so, I tend to bring out the big guns by default ;p.
NiLuJe is offline   Reply With Quote
Old 10-30-2018, 05:48 PM   #119
jackie_w
Grand Sorcerer
jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.
 
Posts: 6,212
Karma: 16534894
Join Date: Sep 2009
Location: UK
Device: Kobo: KA1, ClaraHD, Forma, Libra2, Clara2E. PocketBook: TouchHD3
Quote:
Originally Posted by NiLuJe View Post
@jackie_w: There's a quirk involved in that it understands a specific syntax/subset of regex by default, while -E enables another syntax with more features .

And no, I can never remember which is which, so, I tend to bring out the big guns by default ;p.
I think \s* is about as basic as regex gets so I'll document it with the simpler -q option.
jackie_w is offline   Reply With Quote
Old 11-02-2018, 03:36 PM   #120
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
Released v1.8.0!

A fairly juicy release, since it introduces OpenType/TrueType rendering, thanks to @sherman's work!

It also fixes a stupid bug that broke everything on the black K4, as well as implementing the fgless mode discussed earlier .
NiLuJe is offline   Reply With Quote
Reply

Tags
eips, fbink


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
FBInk: A small tool/library to print crap on your screen! NiLuJe Kobo Developer's Corner 282 04-22-2024 02:51 AM
Small print Broadback Conversion 12 12-12-2011 02:31 PM
Small Tool to change book order (PRS-x50) goaspy Sony Reader 113 10-14-2011 03:28 PM
small print breezeman Introduce Yourself 13 07-03-2011 09:02 AM


All times are GMT -4. The time now is 09:54 PM.


MobileRead.com is a privately owned, operated and funded community.