def METHOD_NAME(ctx, libname, name, dirname=None):
    """
    Get the path to the example binary.
    On Unix systems, the example binaries are located in the catalog
    "lib + libname/name" and have the same name as .c file.
    If that is not the case, dirname optional argument can be used to
    specify different catalog for the example binary- "lib + libname/dirname".
    """
    if dirname is None:
        dirname = name
    return abspath(join(c.ROOTDIR, '..', 'examples', 'lib' + libname,
                        dirname, name))