Your inner big brother

I got my concept down and I'll try to getit finish in the next hour and testing it tomorrow. It's a pretty complicated concept and I don't want to go too much into it. However, I noticed how fragile it is when calling it in the wrong oder, just like all my other modules. Sure, I'm checking parameters and there's the possibility to accumulate results into something (though I'm not doing that all the time). But this does not prevent me from accidently calling stuff in the wrong order. The idea I'm having to avoid this is to define a tree of possible pathes a program can take from one function to another. Like a state machine which cannot just go from one function to another but has a certain flow. The only problem with this is that the number of possible functions and pathes is huge, simply huge. Bearable for a limited set of functions (you mostly only need to define pathes from one module call to another via some other module's calls), it's impossible for so many functions you don't know or maybe know but not making any rules about their call path. The mechanic behind ignoring the unknown but detecting the unknown is rather irrelevant for me right now. Fact is, that C99 defines __func__ to be a pointer to a function's name, thus beeing a unique string and identifier in overall program. So you can, in fact, just dump out an error if you're not calling the right function. I find this mostly interesting. But now I have to go back my thread pause/resume stuff.

No comments: