Skip to content

Header file names/directories #36

@phil-levis-google

Description

@phil-levis-google

One of the advantages of Tock's supporting processes written in C is that you can take existing C code and (comparatively) easily port it into Tock. This has been fine so far for some simpler chunks of C (like the first RF233 stack). I'm porting a whole U2F application, however, and name collisions are becoming a problem. In particular, the fact that libtock-c defines names like "timer.h", "console.h", and "crc.h" causes name collisions for #include directives which are frustrating to track down (and then change many includes in many files).

Here are three options:

  1. Continue as now and have process writers suck it up. This makes sense if we want to strongly prioritize greenfield process writing over porting, such that the benefits of simpler names to greenfield apps outweigh the costs to ports.
  2. Change all of the tock include files to be tock_, e.g., tock_timer.h. This allows us to keep the current directory structure and include directives.
  3. Change all of the tock include files to be included as #include tock/, e.g., #include tock/timer.h. This allows us to keep the current file names but will require a slightly different directory structure.

The second two options also relate to the syscall names themselves. For example, I'm running into a case when I need to run AES with different modes than what the current Tock syscalls provide. In this particular case, it's not too difficult to avoid conflicts because the AES functions are very descriptively named, but requiring different timer abstractions for 64 bit timestamps is a bit trickier.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions