Lines Matching refs:cd

170 create_path_helper(char *out, const char *in, config_data_t *cd) {
186 if (cd->splitcnt < 1)
190 cd->splitcnt);
191 strncat(out, (char *) &cd->pathsep, 1);
192 if (cd->splitcnt == 0)
195 (unsigned int) cd->splitcnt)
197 i += cd->splitcnt;
206 if (cd->splitcnt < 1)
209 strncat(out, (char *) &tmpPtr[i], cd->splitcnt);
210 strncat(out, (char *) &cd->pathsep, 1);
211 if (cd->splitcnt == 0)
214 (unsigned int) cd->splitcnt)
216 i += cd->splitcnt;
231 config_data_t *cd, char **path)
240 /* we require a zone & cd parameter */
242 REQUIRE(cd != NULL);
282 pathsize = len + cd->basedirsize +
283 cd->datadirsize + cd->xfrdirsize + 4;
286 if (cd->splitcnt > 0)
287 pathsize += len/cd->splitcnt;
304 strcpy(tmpPath, cd->basedir);
308 result = create_path_helper(tmpPath, zone, cd);
335 strcat(tmpPath, cd->xfrdir);
336 strncat(tmpPath, (char *) &cd->pathsep, 1);
339 strcat(tmpPath, cd->datadir);
344 strncat(tmpPath, (char *) &cd->pathsep, 1);
346 cd)) != ISC_R_SUCCESS)
368 process_dir(isc_dir_t *dir, void *passback, config_data_t *cd,
402 if (cd->splitcnt == 0) {
414 cd->pathsep))
526 ttlStr = strchr(type, cd->separator);
541 data = strchr(ttlStr, cd->separator);
557 /* replace all cd->separator chars with a space. */
561 if (data[i] == cd->separator)
604 config_data_t *cd;
609 cd = (config_data_t *) dbdata;
611 if (create_path(name, NULL, client, cd, &path) != ISC_R_SUCCESS) {
639 config_data_t *cd;
653 cd = (config_data_t *) dbdata;
665 if (create_path(zone, NULL, NULL, cd, &basepath) != ISC_R_SUCCESS) {
697 result = process_dir(&dir, allnodes, cd, dir_list, basepathlen);
722 result = process_dir(&dir, allnodes, cd, dir_list, basepathlen);
866 config_data_t *cd;
909 cd = isc_mem_get(ns_g_mctx, sizeof(config_data_t));
910 if (cd == NULL)
914 memset(cd, 0, sizeof(config_data_t));
916 cd->pathsep = pathsep;
919 cd->basedir = isc_mem_strdup(ns_g_mctx, argv[1]);
920 if (cd->basedir == NULL)
922 cd->basedirsize = strlen(cd->basedir);
925 cd->datadir = isc_mem_strdup(ns_g_mctx, argv[2]);
926 if (cd->datadir == NULL)
928 cd->datadirsize = strlen(cd->datadir);
931 cd->xfrdir = isc_mem_strdup(ns_g_mctx, argv[3]);
932 if (cd->xfrdir == NULL)
934 cd->xfrdirsize = strlen(cd->xfrdir);
937 cd->splitcnt = strtol(argv[4], &endp, 10);
938 if (*endp != '\0' || cd->splitcnt < 0) {
946 cd->separator = *argv[5];
949 isc_mem_attach(ns_g_mctx, &cd->mctx);
952 *dbdata = cd;
961 if (cd != NULL)
962 fs_destroy(NULL, cd);
978 config_data_t *cd;
982 cd = (config_data_t *) dbdata;
988 if (cd->basedir != NULL)
989 isc_mem_free(ns_g_mctx, cd->basedir);
991 if (cd->datadir != NULL)
992 isc_mem_free(ns_g_mctx, cd->datadir);
994 if (cd->xfrdir != NULL)
995 isc_mem_free(ns_g_mctx, cd->xfrdir);
998 mctx = cd->mctx;
1001 isc_mem_put(mctx, cd, sizeof(config_data_t));