Lines Matching defs:cd

161 create_path_helper(char *out, const char *in, config_data_t *cd) {
177 if (cd->splitcnt < 1)
181 cd->splitcnt);
182 strncat(out, (char *) &cd->pathsep, 1);
183 if (cd->splitcnt == 0)
186 (unsigned int) cd->splitcnt)
188 i += cd->splitcnt;
197 if (cd->splitcnt < 1)
200 strncat(out, (char *) &tmpPtr[i], cd->splitcnt);
201 strncat(out, (char *) &cd->pathsep, 1);
202 if (cd->splitcnt == 0)
205 (unsigned int) cd->splitcnt)
207 i += cd->splitcnt;
222 config_data_t *cd, char **path)
231 /* we require a zone & cd parameter */
233 REQUIRE(cd != NULL);
273 pathsize = len + cd->basedirsize +
274 cd->datadirsize + cd->xfrdirsize + 4;
277 if (cd->splitcnt > 0)
278 pathsize += len/cd->splitcnt;
295 strcpy(tmpPath, cd->basedir);
299 result = create_path_helper(tmpPath, zone, cd);
326 strcat(tmpPath, cd->xfrdir);
327 strncat(tmpPath, (char *) &cd->pathsep, 1);
330 strcat(tmpPath, cd->datadir);
335 strncat(tmpPath, (char *) &cd->pathsep, 1);
337 cd)) != ISC_R_SUCCESS)
359 process_dir(isc_dir_t *dir, void *passback, config_data_t *cd,
393 if (cd->splitcnt == 0) {
405 cd->pathsep))
517 ttlStr = strchr(type, cd->separator);
532 data = strchr(ttlStr, cd->separator);
548 /* replace all cd->separator chars with a space. */
552 if (data[i] == cd->separator)
595 config_data_t *cd;
600 cd = (config_data_t *) dbdata;
602 if (create_path(name, NULL, client, cd, &path) != ISC_R_SUCCESS) {
630 config_data_t *cd;
644 cd = (config_data_t *) dbdata;
656 if (create_path(zone, NULL, NULL, cd, &basepath) != ISC_R_SUCCESS) {
688 result = process_dir(&dir, allnodes, cd, dir_list, basepathlen);
713 result = process_dir(&dir, allnodes, cd, dir_list, basepathlen);
863 config_data_t *cd;
906 cd = isc_mem_get(ns_g_mctx, sizeof(config_data_t));
907 if (cd == NULL)
911 memset(cd, 0, sizeof(config_data_t));
913 cd->pathsep = pathsep;
916 cd->basedir = isc_mem_strdup(ns_g_mctx, argv[1]);
917 if (cd->basedir == NULL)
919 cd->basedirsize = strlen(cd->basedir);
922 cd->datadir = isc_mem_strdup(ns_g_mctx, argv[2]);
923 if (cd->datadir == NULL)
925 cd->datadirsize = strlen(cd->datadir);
928 cd->xfrdir = isc_mem_strdup(ns_g_mctx, argv[3]);
929 if (cd->xfrdir == NULL)
931 cd->xfrdirsize = strlen(cd->xfrdir);
934 cd->splitcnt = strtol(argv[4], &endp, 10);
935 if (*endp != '\0' || cd->splitcnt < 0) {
943 cd->separator = *argv[5];
946 isc_mem_attach(ns_g_mctx, &cd->mctx);
949 *dbdata = cd;
958 if (cd != NULL)
959 fs_destroy(NULL, cd);
975 config_data_t *cd;
979 cd = (config_data_t *) dbdata;
985 if (cd->basedir != NULL)
986 isc_mem_free(ns_g_mctx, cd->basedir);
988 if (cd->datadir != NULL)
989 isc_mem_free(ns_g_mctx, cd->datadir);
991 if (cd->xfrdir != NULL)
992 isc_mem_free(ns_g_mctx, cd->xfrdir);
995 mctx = cd->mctx;
998 isc_mem_put(mctx, cd, sizeof(config_data_t));