GithubHelp home page GithubHelp logo

Comments (7)

emoon avatar emoon commented on May 27, 2024

Maybe add another function called library_load_fullname/fullpath or something like that where the user has to provide a fully formated path instead.

Of course it's your library so you do as you wish of course :)

from foundation_lib.

mjansson avatar mjansson commented on May 27, 2024

Good catch, that particular code is an migration from another codebase and some legacy got included. Will clean it up.

from foundation_lib.

emoon avatar emoon commented on May 27, 2024

Thanks :)

from foundation_lib.

mjansson avatar mjansson commented on May 27, 2024

I've cleaned up the fallback, which makes sense in that the idea is to be able to call library_load( "foo" ) without having to worry about platform specific prefix/suffix.

The fallback now only triggers if the platform extension is not present, and the fallback adds the prefix/suffix on the file name, preserving paths. It always tries to load the given name first, unmodified.

Check out https://github.com/rampantpixels/foundation_lib/tree/feature/library-load and see if you agree it's a reasonable implementation

from foundation_lib.

emoon avatar emoon commented on May 27, 2024

Looks good. Something that might be worth considering checking is for backslashes in the path here (on Windows)
https://github.com/rampantpixels/foundation_lib/blob/feature/library-load/foundation/library.c#L100

I really don't use that myself but I can see that other people will.

from foundation_lib.

mjansson avatar mjansson commented on May 27, 2024

Merged in 8194e3b

from foundation_lib.

emoon avatar emoon commented on May 27, 2024

Tested this now and works as expected. Thanks!

Might be good to add some more tests to validate the code (as you already have really good tests for most of the code)

from foundation_lib.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.