paths, esp. ds-print-pagesize

David Relson <[email protected]>
Newsgroups gmane.mail.bogofilter.devel
Organization Osage Software Systems, Inc.
Message-ID <[email protected]>
Matthias,

Looking at paths.c, I see function get_directory_from_path(), but no
get_file_from_path().  Any reason not to add one?  With it, the 
db-print-pagesize code becomes (roughly):

    case M_PAGESIZE:
    {
        u_int32_t s;
        char *f;
        f = get_file_from_path(ds_file);
        ds_minit(bogohome, f);
        s = ds_pagesize(bogohome, f);
        if (s == 0xffffffff)
            fprintf(stderr, "%s: error getting page size.\n", ds_file);
        else if (s == 0)
            printf("UNKNOWN\n");
        else
            printf("%lu\n", (unsigned long)s);
        xfree(f);
    }

I'm noticing how many functions are called with directory & filename
parameters and how many different functions we have for working with
paths and how many different places use those functions.  I wonder if
we can do better than that?
_______________________________________________
Bogofilter-dev mailing list
[email protected]
http://www.bogofilter.org/mailman/listinfo/bogofilter-dev
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.