<feed xmlns='http://www.w3.org/2005/Atom'>
<title>dome-key-map/Makefile, branch v0.1.0</title>
<subtitle>DomeKey core library</subtitle>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/dome-key-map/'/>
<entry>
<title>Makefile: Organise targets a bit</title>
<updated>2018-11-05T00:47:47+00:00</updated>
<author>
<name>Teddy Wing</name>
</author>
<published>2018-11-05T00:47:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/dome-key-map/commit/?id=0c6ad19a5e1c6b331df04f95b804de35cc2ef52e'/>
<id>0c6ad19a5e1c6b331df04f95b804de35cc2ef52e</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Makefile: Remove `includer` and `moder` targets</title>
<updated>2018-11-05T00:45:30+00:00</updated>
<author>
<name>Teddy Wing</name>
</author>
<published>2018-11-05T00:41:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/dome-key-map/commit/?id=44119ce51728254e0a925f63ac87029043f7321f'/>
<id>44119ce51728254e0a925f63ac87029043f7321f</id>
<content type='text'>
Don't need these programs any more, so the build recipes for them don't
really make sense to keep.

Also remove the `clean` target since it only relates to `includer` and
`moder`.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Don't need these programs any more, so the build recipes for them don't
really make sense to keep.

Also remove the `clean` target since it only relates to `includer` and
`moder`.
</pre>
</div>
</content>
</entry>
<entry>
<title>Makefile: Add targets for release build</title>
<updated>2018-11-04T16:50:06+00:00</updated>
<author>
<name>Teddy Wing</name>
</author>
<published>2018-11-04T16:50:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/dome-key-map/commit/?id=7d3c563b129acff2502cb480e07ca68db097c742'/>
<id>7d3c563b129acff2502cb480e07ca68db097c742</id>
<content type='text'>
* Release targets for 'dome_key_event_source_simulator'
* Add `release` target
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* Release targets for 'dome_key_event_source_simulator'
* Add `release` target
</pre>
</div>
</content>
</entry>
<entry>
<title>Makefile: Use `:=` instead of `=` on `SOURCE_FILES`</title>
<updated>2018-10-29T21:58:12+00:00</updated>
<author>
<name>Teddy Wing</name>
</author>
<published>2018-10-29T21:58:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/dome-key-map/commit/?id=52ee9fc272d3cbc19a47b6903c884a58b171d043'/>
<id>52ee9fc272d3cbc19a47b6903c884a58b171d043</id>
<content type='text'>
MadScientist (https://stackoverflow.com/users/939557/madscientist) on
Stack Overflow says:

&gt; Also you should always use := not = for shell (and wildcard, for that
&gt; matter) for performance reasons.

(https://stackoverflow.com/questions/26694249/makefiles-using-wildcard-vs-find-for-specifying-source-files/26694693#26694693)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
MadScientist (https://stackoverflow.com/users/939557/madscientist) on
Stack Overflow says:

&gt; Also you should always use := not = for shell (and wildcard, for that
&gt; matter) for performance reasons.

(https://stackoverflow.com/questions/26694249/makefiles-using-wildcard-vs-find-for-specifying-source-files/26694693#26694693)
</pre>
</div>
</content>
</entry>
<entry>
<title>Makefile: Fix error when `make build`ing without a `target` directory</title>
<updated>2018-10-29T01:35:22+00:00</updated>
<author>
<name>Teddy Wing</name>
</author>
<published>2018-10-29T01:35:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/dome-key-map/commit/?id=1620b731f3c5fd1865caf176f552ee2a9055d081'/>
<id>1620b731f3c5fd1865caf176f552ee2a9055d081</id>
<content type='text'>
The `make build` target requires the `target/debug/deps` directory to
exists so it can copy the media key simulator library into it.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The `make build` target requires the `target/debug/deps` directory to
exists so it can copy the media key simulator library into it.
</pre>
</div>
</content>
</entry>
<entry>
<title>Compile and link 'libdome_key_event_source_simulator'</title>
<updated>2018-10-14T19:42:41+00:00</updated>
<author>
<name>Teddy Wing</name>
</author>
<published>2018-10-14T19:42:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/dome-key-map/commit/?id=2be00cdf66ab965bdb5edf5902b4ec8b83229704'/>
<id>2be00cdf66ab965bdb5edf5902b4ec8b83229704</id>
<content type='text'>
Turn this into a build dependency with Make.

Use Vladimir Matveev (https://stackoverflow.com/users/788207/vladimir-matveev)
and Shepmaster's
(https://stackoverflow.com/users/155423/shepmaster) answer on Stack
Overflow to sort out getting Cargo the search path for the static
library:
https://stackoverflow.com/questions/26246849/how-to-i-tell-rust-where-to-look-for-a-static-library/26254062#26254062

For some reason I wasn't able to get it to work by just putting the
library into `./target/debug/deps/`. I had to explicitly tell Cargo to
put that in the search path.

Also, we need to use `std::env` instead of the `env!` macro to get the
`PROFILE` environment variable, otherwise it won't be initialised at the
right time, as described in the Rust docs:

&gt; Because these variables are not yet set when the build script is
&gt; compiled, the above example using env! won't work and instead you'll
&gt; need to retrieve the values when the build script is run

(https://doc.rust-lang.org/cargo/reference/environment-variables.html#environment-variables-cargo-sets-for-build-scripts)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Turn this into a build dependency with Make.

Use Vladimir Matveev (https://stackoverflow.com/users/788207/vladimir-matveev)
and Shepmaster's
(https://stackoverflow.com/users/155423/shepmaster) answer on Stack
Overflow to sort out getting Cargo the search path for the static
library:
https://stackoverflow.com/questions/26246849/how-to-i-tell-rust-where-to-look-for-a-static-library/26254062#26254062

For some reason I wasn't able to get it to work by just putting the
library into `./target/debug/deps/`. I had to explicitly tell Cargo to
put that in the search path.

Also, we need to use `std::env` instead of the `env!` macro to get the
`PROFILE` environment variable, otherwise it won't be initialised at the
right time, as described in the Rust docs:

&gt; Because these variables are not yet set when the build script is
&gt; compiled, the above example using env! won't work and instead you'll
&gt; need to retrieve the values when the build script is run

(https://doc.rust-lang.org/cargo/reference/environment-variables.html#environment-variables-cargo-sets-for-build-scripts)
</pre>
</div>
</content>
</entry>
<entry>
<title>Trying to fix pointer lifetime of mode `CKeyActionResult` (WIP)</title>
<updated>2018-09-06T02:03:20+00:00</updated>
<author>
<name>Teddy Wing</name>
</author>
<published>2018-09-03T16:00:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/dome-key-map/commit/?id=84d29715900209b8ab4c600ad40ef99cdad03bd6'/>
<id>84d29715900209b8ab4c600ad40ef99cdad03bd6</id>
<content type='text'>
Can't get this working. Tried a bunch of things. Decided to commit this
at a stopping point before messing any further. Sort of getting there,
with some things that seem like they're pointing in the right direction,
but it's not working out so far. Still getting a segfault. Actually,
with the `Box::into_raw` addition, the lifetime of the mode result
actually lasts for a single call (printf), and then gets freed
(weirdly).

Makefile:
* Add `-W` error flags to see if those would give me any extra
  information about the pointer problems, but didn't get anything. The
  fact that I didn't get errors indicated it was a problem on the Rust
  side.
* Change `clean` dependency to `moder.c` so we don't rebuild if the C
  file (and lib) hasn't changed.

c_run_key_action():
* Add some `println!`s and debug clutter
* Add a separate `let` binding for `run_key_action_for_mode()` because
  that seemed to fix some weirdness in control flow when I was debugging
  the code at one point in `lldb`. Not sure it this change still makes
  sense to keep.
* Changed function/closure version of `in_mode` to `if`/`else` because
  that may have made a difference in some dumb things I was
  experimenting with at some point.
* Unsuccessful tries of `mem::forget()`, ultimately commented out.
* Return a `Box::into_raw` pointer to the `CKeyActionResult` instead of
  the Rust pointer we were previously returning. This allows the value
  to live beyond the function and beyond Rust's control into the calling
  C code. This does, however, mean that the value leaks memory, and will
  need to be freed manually in the calling C code.

run_key_action_for_mode():
* Wrap map handler in a check to verify `in_mode` is `None`. This
  ensures that if we should be returning a `KeyActionResult` for a
  mapping inside a mode, we don't run this code that's meant for
  mappings outside a mode.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Can't get this working. Tried a bunch of things. Decided to commit this
at a stopping point before messing any further. Sort of getting there,
with some things that seem like they're pointing in the right direction,
but it's not working out so far. Still getting a segfault. Actually,
with the `Box::into_raw` addition, the lifetime of the mode result
actually lasts for a single call (printf), and then gets freed
(weirdly).

Makefile:
* Add `-W` error flags to see if those would give me any extra
  information about the pointer problems, but didn't get anything. The
  fact that I didn't get errors indicated it was a problem on the Rust
  side.
* Change `clean` dependency to `moder.c` so we don't rebuild if the C
  file (and lib) hasn't changed.

c_run_key_action():
* Add some `println!`s and debug clutter
* Add a separate `let` binding for `run_key_action_for_mode()` because
  that seemed to fix some weirdness in control flow when I was debugging
  the code at one point in `lldb`. Not sure it this change still makes
  sense to keep.
* Changed function/closure version of `in_mode` to `if`/`else` because
  that may have made a difference in some dumb things I was
  experimenting with at some point.
* Unsuccessful tries of `mem::forget()`, ultimately commented out.
* Return a `Box::into_raw` pointer to the `CKeyActionResult` instead of
  the Rust pointer we were previously returning. This allows the value
  to live beyond the function and beyond Rust's control into the calling
  C code. This does, however, mean that the value leaks memory, and will
  need to be freed manually in the calling C code.

run_key_action_for_mode():
* Wrap map handler in a check to verify `in_mode` is `None`. This
  ensures that if we should be returning a `KeyActionResult` for a
  mapping inside a mode, we don't run this code that's meant for
  mappings outside a mode.
</pre>
</div>
</content>
</entry>
<entry>
<title>Test mode finder</title>
<updated>2018-09-02T12:12:56+00:00</updated>
<author>
<name>Teddy Wing</name>
</author>
<published>2018-09-02T12:12:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/dome-key-map/commit/?id=4b31eb9b8412e429949aca73ef475787910e4b0b'/>
<id>4b31eb9b8412e429949aca73ef475787910e4b0b</id>
<content type='text'>
Add a new `moder.c` based on `includer.c` to test getting a mode and
then getting an action for a mode mapping.

Doesn't completely work currently. Right now all I get is this output:

    $ ./moder
    2
    Segmentation fault: 11

Clearly I'm messing up something with the pointer in
`c_run_key_action()`. Not sure what it is yet.

Changed `CKeyActionResult.in_mode` to be a `Trigger` instead of a
`HeadphoneButton` list. That allows us to pass it directly into the
second argument of `c_run_key_action()` without converting.

But maybe the pointer value isn't living long enough? Not sure what the
problem is yet.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add a new `moder.c` based on `includer.c` to test getting a mode and
then getting an action for a mode mapping.

Doesn't completely work currently. Right now all I get is this output:

    $ ./moder
    2
    Segmentation fault: 11

Clearly I'm messing up something with the pointer in
`c_run_key_action()`. Not sure what it is yet.

Changed `CKeyActionResult.in_mode` to be a `Trigger` instead of a
`HeadphoneButton` list. That allows us to pass it directly into the
second argument of `c_run_key_action()` without converting.

But maybe the pointer value isn't living long enough? Not sure what the
problem is yet.
</pre>
</div>
</content>
</entry>
<entry>
<title>Makefile: Add target for library</title>
<updated>2018-08-27T20:15:16+00:00</updated>
<author>
<name>Teddy Wing</name>
</author>
<published>2018-08-27T20:15:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/dome-key-map/commit/?id=d610aab64b2505b2ee7cd37be5b3d1b8097c3a64'/>
<id>d610aab64b2505b2ee7cd37be5b3d1b8097c3a64</id>
<content type='text'>
A new Make target to build the Rust library. This facilitates handling
of other targets that depend on the library.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
A new Make target to build the Rust library. This facilitates handling
of other targets that depend on the library.
</pre>
</div>
</content>
</entry>
<entry>
<title>Makefile: Always rebuild `includer`</title>
<updated>2018-08-26T06:46:07+00:00</updated>
<author>
<name>Teddy Wing</name>
</author>
<published>2018-08-26T06:46:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/dome-key-map/commit/?id=47efec1164a5cb4b93161b3fedd999401b190e80'/>
<id>47efec1164a5cb4b93161b3fedd999401b190e80</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
</feed>
