Question: I am attempting to store css files inside database and call them in the most effective wa using PHP. I know I can include a style.php file and just do a query to get the data; however, not sure if that is the best way or not. I'd prefer to not have 

```
<style>
#blah { }
#blah 2 { }
etc.
</style>

```

show up on every page. I am attempting to make this work similar to how a typical css file would work where it is just a link similar to the way it is below. I have read about people using 
html page:

```
<link rel="stylesheet" type="text/css" href="style.php" />

```

style.php page:

```
header("Content-Type: text/css");

```

however, have also seen that that doesn't work well with IE.

So does anyone have any recommendations on how I can do this in the best way for all browsers?

Answer: 
I would use a combination of structs to rappresent the register and a pair of functions to handle them.

In a `fpga_register.h` you would have something like

```
#define FPGA_READ = 1; 
#define FPGA_WRITE = 2;
typedef struct register_t {
    char permissions;
} FPGARegister;

FPGARegister* fpga_init(void* address, char permissions);

int fpga_write(FPGARegister* register, void* value);

int fpga_read(FPGARegister* register, void* value);

```

with READ and WRITE in xor to express permissions.

Than in the `fpga_register.c` you would define a new struct

```
typedef struct register_t2 {
    char permissions;
    void * address;
} FPGARegisterReal;

```

so that you returns a pointer to it instead of a pointer to `FPGARegister` on `fpga_init`.

Then, on `fpga_read` and `fpga_write` you check the permissions and 

* if the operetion is allowed, cast back the `FPGARegister` from the argument to a `FPGARegisterReal`, execute the desired action (set or read the value) and return a success code
* if the operation is not allowed, just return an error code

This way, no one including the header file will be able to access the `FPGARegisterReal` structure, and thus it will not have direct access to the register address. Obviously, one could hack it, but I'm quite sure that such intentional hacks are not your actual concerns.
Dan Saks has a Youtube presentation, that I couldn't, find where he introduces write-only registers for embedded devices.

Fortunately he wrote an article, that was easier to search, here: <https://www.embedded.com/how-to-enforce-write-only-access/>

This is the code from the article, updated for C++11

```
class write_only_T{
public:
    write_only_T(){}
    write_only_T(T const& v) : m(v){}
    write_only_T(T&& v) : m(std::move(v)){}
    write_only_T& operator=(T const& v){
        m = v;
        return *this;
    }
    write_only_T& operator=(T&& v){
        m = std::move(v);
        return *this;
    }
    write_only_T(write_only_T const&) = delete;
    write_only_T(write_only_T&&) = delete;
    write_only_T& operator=(write_only_T const&) = delete;
    write_only_T& operator=(write_only_T&&) = delete;
private:
    T m;
};

```

I don't think you need a special pointer type if you used this because write-only is a property of the value, but I can imagine a synthetic pointer-type that skips the value type.
Likely you will need to introduce a write-only reference-type and so on.