/***********************************************************************1* *2* This software is part of the ast package *3* Copyright (c) 1998-2011 AT&T Intellectual Property *4* and is licensed under the *5* Eclipse Public License, Version 1.0 *6* by AT&T Intellectual Property *7* *8* A copy of the License is available at *9* http://www.eclipse.org/org/documents/epl-v10.html *10* (with md5 checksum b35adb5213ca9657e911e9befb180842) *11* *12* Information and Software Systems Research *13* AT&T Research *14* Florham Park NJ *15* *16* Glenn Fowler <[email protected]> *17* *18***********************************************************************/19#pragma prototyped2021/*22* initialize a pzip discipline library23*/2425#include "pzlib.h"2627const char*28pzinit(register Pz_t* pz, register const char* name, Pzinit_f initf)29{30const char* options;31const char* usage;32char* id;3334options = pz->disc->options;35if (!(usage = (*initf)(pz, pz->disc)))36{37if (pz->disc && pz->disc->errorf)38{39if (id = strchr((char*)state.id, ':'))40id++;41else42id = (char*)state.id;43(*pz->disc->errorf)(pz, pz->disc, 2, "%s: %s_init: initialization function error", name, id);44}45return 0;46}47optget(NiL, usage);48if (pz->disc->options != options)49{50if (!pz->disc->options)51pz->options = 0;52else if (!(pz->options = vmstrdup(pz->vm, pz->disc->options)))53{54pznospace(pz);55return 0;56}57}58if (pz->options && pzoptions(pz, pz->part, pz->options, 0) < 0)59return 0;60return usage;61}626364