X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=src%2Fzoom-opt.c;h=a1ba28bbbd234483c8048d066485fc87b3414c16;hb=7bfdd9cdcbfd12d6690278c9b56a7ac26b2457e9;hp=c199e89cc8d12d36d44f9f9bde0a4e2641b0e92f;hpb=0e664fbee06e451911bf53d2df4e541cbcecd495;p=yaz-moved-to-github.git diff --git a/src/zoom-opt.c b/src/zoom-opt.c index c199e89..a1ba28b 100644 --- a/src/zoom-opt.c +++ b/src/zoom-opt.c @@ -1,18 +1,36 @@ -/* - * Copyright (C) 1995-2007, Index Data ApS +/* This file is part of the YAZ toolkit. + * Copyright (C) 1995-2011 Index Data * See the file LICENSE for details. - * - * $Id: zoom-opt.c,v 1.8 2007-05-05 11:53:26 adam Exp $ */ /** * \file zoom-opt.c * \brief Implements ZOOM options handling */ +#if HAVE_CONFIG_H +#include +#endif + #include #include "zoom-p.h" #include +struct ZOOM_options_entry { + char *name; + char *value; + int len; /* of `value', which may contain NULs */ + struct ZOOM_options_entry *next; +}; + +struct ZOOM_options_p { + int refcount; + void *callback_handle; + ZOOM_options_callback callback_func; + struct ZOOM_options_entry *entries; + ZOOM_options parent1; + ZOOM_options parent2; +}; + static void set_value(struct ZOOM_options_entry **e, const char *value, int len) { @@ -171,7 +189,11 @@ ZOOM_API(const char *) if (!opt) return 0; if (opt->callback_func) + { v = (*opt->callback_func)(opt->callback_handle, name); + if (v) + *lenp = strlen(v); + } if (!v) { struct ZOOM_options_entry *e; @@ -230,6 +252,7 @@ ZOOM_options_set_int(ZOOM_options opt, const char *name, int value) /* * Local variables: * c-basic-offset: 4 + * c-file-style: "Stroustrup" * indent-tabs-mode: nil * End: * vim: shiftwidth=4 tabstop=8 expandtab