Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

4
  • reg_handler() in config.cis the constructor for extern imageHandler *imagehandlers[]; declared in handlers.h. Commented Jul 23, 2017 at 9:18
  • I'm not a c programmer, but it seems this code is designed explicitly to import one or more implementations and loading them dynamically. What would happen if the file were empty? Is your program dependent upon them? Commented Jul 23, 2017 at 9:29
  • If config.txt is empty, then, printf(" We cannot handle this kind of files\n"); executes, shown here So, if config.txt is empty, then application cannot support any image file as there is no corresponding service injected, on restart of my application ), for any input(image file) by user. So, if config.txt is empty, then application cannot support any image file as there is no corresponding service injected, on restart of my application Commented Jul 23, 2017 at 9:41
  • 2
    If that's the purpose of the app, and nothing else gets done without a handler in the config file, then it could be considered dependency injection. After all, this is similar to the methods used by some IoC containers, where dependencies can be registered in config files. Commented Jul 23, 2017 at 9:42