#define f_path_present_working_old_length 6
#define f_path_max PATH_MAX
+
+ const static f_string_t f_path_separator_s = f_path_separator;
+ const static f_string_t f_path_separator_current_s = f_path_separator_current;
+ const static f_string_t f_path_separator_variable_s = f_path_separator_variable;
+
+ #define f_path_extension_separator_s f_path_separator_current_s
+
+ const static f_string_t f_path_environment_s = f_path_environment;
+ const static f_string_t f_path_home_wildcard_s = f_path_home_wildcard;
+ const static f_string_t f_path_present_working_s = f_path_present_working;
+ const static f_string_t f_path_present_working_old_s = f_path_present_working_old;
#endif // _di_f_path_defines_
#ifdef __cplusplus
for (f_string_length_t i = 0; i < length; i++) {
- if (path[i] == f_path_separator[0]) {
+ if (path[i] == f_path_separator_s[0]) {
return F_true;
}
} // for
for (; path[at_path]; ++at_path) {
- if (at_path && path[at_path] == f_path_separator[0]) {
+ if (at_path && path[at_path] == f_path_separator_s[0]) {
memcpy(tree, path + at_tree, at_path - at_tree);
tree[at_path] = 0;
for (; i > 0; i--, static_source.used--) {
if (!source[i - 1]) continue;
- if (source[i - 1] == f_path_separator[0]) continue;
+ if (source[i - 1] == f_path_separator_s[0]) continue;
break;
} // for
for (; i > 0; i--, static_destination.used--) {
if (!destination[i - 1]) continue;
- if (destination[i - 1] == f_path_separator[0]) continue;
+ if (destination[i - 1] == f_path_separator_s[0]) continue;
break;
} // for
for (; i > 0; i--, static_source.used--) {
if (!source[i - 1]) continue;
- if (source[i - 1] == f_path_separator[0]) continue;
+ if (source[i - 1] == f_path_separator_s[0]) continue;
break;
} // for
for (; i > 0; i--, static_destination.used--) {
if (!destination[i - 1]) continue;
- if (destination[i - 1] == f_path_separator[0]) continue;
+ if (destination[i - 1] == f_path_separator_s[0]) continue;
break;
} // for
for (; i > 0; i--, static_source.used--) {
if (!source[i - 1]) continue;
- if (source[i - 1] == f_path_separator[0]) continue;
+ if (source[i - 1] == f_path_separator_s[0]) continue;
break;
} // for
for (; i > 0; i--, static_destination.used--) {
if (!destination[i - 1]) continue;
- if (destination[i - 1] == f_path_separator[0]) continue;
+ if (destination[i - 1] == f_path_separator_s[0]) continue;
break;
} // for
for (; i > 0; i--, static_source.used--) {
if (!source[i - 1]) continue;
- if (source[i - 1] == f_path_separator[0]) continue;
+ if (source[i - 1] == f_path_separator_s[0]) continue;
break;
} // for
for (; i > 0; i--, static_destination.used--) {
if (!destination[i - 1]) continue;
- if (destination[i - 1] == f_path_separator[0]) continue;
+ if (destination[i - 1] == f_path_separator_s[0]) continue;
break;
} // for
}
if (first_nulless) {
- if (path->string[i] == f_path_separator[0]) {
+ if (path->string[i] == f_path_separator_s[0]) {
if (null_terminated) {
path->string[i + 1] = 0;
path->used = i + 2;
return status;
}
- if (path->string[j] != f_path_separator[0]) {
+ if (path->string[j] != f_path_separator_s[0]) {
i = j + 1;
break;
}
memcpy(path_destination_sub, destination.string, destination.used);
memcpy(path_destination_sub + destination.used + 1, listing.directory.array[i].string, listing.directory.array[i].used);
- path_source_sub[source.used] = f_path_separator[0];
+ path_source_sub[source.used] = f_path_separator_s[0];
path_source_sub[source_sub.used] = 0;
- path_destination_sub[destination.used] = f_path_separator[0];
+ path_destination_sub[destination.used] = f_path_separator_s[0];
path_destination_sub[destination_sub.used] = 0;
source_sub.string = path_source_sub;
memcpy(path_source, source.string, source.used);
memcpy(path_source + source.used + 1, file.string, file.used);
- path_source[source.used] = f_path_separator[0];
+ path_source[source.used] = f_path_separator_s[0];
path_source[source.used + file.used + 1] = 0;
memcpy(path_destination, destination.string, destination.used);
memcpy(path_destination + destination.used + 1, file.string, file.used);
- path_destination[destination.used] = f_path_separator[0];
+ path_destination[destination.used] = f_path_separator_s[0];
path_destination[destination.used + file.used + 1] = 0;
f_status_t status = f_file_clone(path_source, path_destination, role, recurse.size_block, recurse.exclusive);
memcpy(path_destination_sub, destination.string, destination.used);
memcpy(path_destination_sub + destination.used + 1, listing.directory.array[i].string, listing.directory.array[i].used);
- path_source_sub[source.used] = f_path_separator[0];
+ path_source_sub[source.used] = f_path_separator_s[0];
path_source_sub[source_sub.used] = 0;
- path_destination_sub[destination.used] = f_path_separator[0];
+ path_destination_sub[destination.used] = f_path_separator_s[0];
path_destination_sub[destination_sub.used] = 0;
source_sub.string = path_source_sub;
memcpy(path_source, source.string, source.used);
memcpy(path_source + source.used + 1, file.string, file.used);
- path_source[source.used] = f_path_separator[0];
+ path_source[source.used] = f_path_separator_s[0];
path_source[source.used + file.used + 1] = 0;
memcpy(path_destination, destination.string, destination.used);
memcpy(path_destination + destination.used + 1, file.string, file.used);
- path_destination[destination.used] = f_path_separator[0];
+ path_destination[destination.used] = f_path_separator_s[0];
path_destination[destination.used + file.used + 1] = 0;
f_status_t status = f_file_copy(path_source, path_destination, mode, recurse.size_block, recurse.exclusive);
return status;
}
- if (destination->string[i] == f_path_separator[0]) {
+ if (destination->string[i] == f_path_separator_s[0]) {
if (i - 1 > 0) {
for (j = i - 1; j > 0; j--) {
if (!destination->string[j]) continue;
return status;
}
- if (destination->string[j] == f_path_separator[0]) {
+ if (destination->string[j] == f_path_separator_s[0]) {
destination->used = j + 1;
}
else {
} // for
if (destination->used > 0 && !i) {
- if (destination->string[0] != 0 && destination->string[0] != f_path_separator[0]) {
+ if (destination->string[0] != 0 && destination->string[0] != f_path_separator_s[0]) {
separator_prepend = F_true;
total++;
}
return status;
}
- if (source[i] == f_path_separator[0]) {
+ if (source[i] == f_path_separator_s[0]) {
if (!separator_prepend && destination->used > 0) {
destination->used--;
}
return status;
}
- if (source[j] == f_path_separator[0]) {
+ if (source[j] == f_path_separator_s[0]) {
length_truncated = j + 1;
}
else {
break;
} // for
- if (!i && source[0] != f_path_separator[0]) {
+ if (!i && source[0] != f_path_separator_s[0]) {
separator_append = F_true;
total++;
}
start = i;
- if (source[0] == f_path_separator[0]) {
+ if (source[0] == f_path_separator_s[0]) {
if (i + 1 < length_truncated) {
for (j = i + 1; j < length_truncated; j++) {
if (!source[j]) continue;
return status;
}
- if (source[j] == f_path_separator[0]) {
+ if (source[j] == f_path_separator_s[0]) {
start = j;
}
else {
}
if (separator_prepend) {
- destination->string[destination->used] = f_path_separator[0];
+ destination->string[destination->used] = f_path_separator_s[0];
destination->used++;
total--;
}
if (separator_append) {
if (terminated_null) {
- destination->string[destination->used - 2] = f_path_separator[0];
+ destination->string[destination->used - 2] = f_path_separator_s[0];
destination->string[destination->used - 1] = 0;
}
else {
- destination->string[destination->used - 1] = f_path_separator[0];
+ destination->string[destination->used - 1] = f_path_separator_s[0];
}
}
else if (terminated_null) {
total = i - first;
if (total > 0) {
- if (path[i - 1] == f_path_separator[0]) {
+ if (path[i - 1] == f_path_separator_s[0]) {
f_macro_string_dynamic_t_new(status, part, total);
if (F_status_is_error(status)) return status;
f_macro_string_dynamic_t_new(status, part, total + 1);
if (F_status_is_error(status)) return status;
- part.string[total] = f_path_separator[0];
+ part.string[total] = f_path_separator_s[0];
part.used = total + 1;
}
part.used++;
} // for
- if (part.string[part.used - 1] != f_path_separator[0]) {
+ if (part.string[part.used - 1] != f_path_separator_s[0]) {
f_macro_string_dynamic_t_resize(status, part, total + 1);
if (F_status_is_error(status)) return status;
- part.string[part.used] = f_path_separator[0];
+ part.string[part.used] = f_path_separator_s[0];
part.used++;
}
}
total = last - i;
if (total > 0) {
- if (path[j + total] == f_path_separator[0]) {
+ if (path[j + total] == f_path_separator_s[0]) {
f_macro_string_dynamic_t_new(status, part, total);
if (F_status_is_error(status)) return status;
f_macro_string_dynamic_t_new(status, part, total + 1);
if (F_status_is_error(status)) return status;
- part.string[total] = f_path_separator[0];
+ part.string[total] = f_path_separator_s[0];
part.used = total + 1;
}
total = last - j;
if (total > 0) {
- if (path[last - 1] == f_path_separator[0]) {
+ if (path[last - 1] == f_path_separator_s[0]) {
f_macro_string_dynamic_t_new(status, part, total);
if (F_status_is_error(status)) return status;
if (F_status_is_error(status)) return status;
part.used = total + 1;
- part.string[total] = f_path_separator[0];
+ part.string[total] = f_path_separator_s[0];
}
memcpy(part.string, path, total);
part.used++;
} // for
- if (part.string[part.used - 1] != f_path_separator[0]) {
+ if (part.string[part.used - 1] != f_path_separator_s[0]) {
f_macro_string_dynamic_t_resize(status, part, total + 1);
if (F_status_is_error(status)) return status;
- part.string[part.used] = f_path_separator[0];
+ part.string[part.used] = f_path_separator_s[0];
part.used++;
}
}
part.used++;
} // for
- if (part.string[part.used - 1] != f_path_separator[0]) {
+ if (part.string[part.used - 1] != f_path_separator_s[0]) {
f_macro_string_dynamic_t_resize(status, part, total + 1);
if (F_status_is_error(status)) return status;
- part.string[part.used - 1] = f_path_separator[0];
+ part.string[part.used - 1] = f_path_separator_s[0];
part.used++;
}
}
*
* @return
* FL_fss_found_object on success and object was found (start location is at end of object).
+ * FL_fss_found_object_content_not on success but object ended at the line so there can be no content.
* FL_fss_found_object_not on success and no object was found (start location is after character designating this is not an object).
* F_none_eos on success after reaching the end of the buffer (a valid object is not yet confirmed).
* F_none_stop on success after reaching stopping point (a valid object is not yet confirmed).
*
* @return
* FL_fss_found_object on success and object was found (start location is at end of object).
+ * FL_fss_found_object_content_not on success but object ended at the line so there can be no content.
* FL_fss_found_object_not on success and no object was found (start location is after character designating this is not an object).
* F_none_eos on success after reaching the end of the buffer (a valid object is not yet confirmed).
* F_none_stop on success after reaching stopping point (a valid object is not yet confirmed).
memcpy(path_sub, path, path_length);
memcpy(path_sub + path_length + 1, list[i]->array[j].string, list[i]->array[j].used);
- path_sub[path_length] = f_path_separator[0];
+ path_sub[path_length] = f_path_separator_s[0];
path_sub[length] = 0;
status = f_file_mode_set(path_sub, mode);
memcpy(path_sub, path, path_length);
memcpy(path_sub + path_length + 1, listing.directory.array[i].string, listing.directory.array[i].used);
- path_sub[path_length] = f_path_separator[0];
+ path_sub[path_length] = f_path_separator_s[0];
path_sub[length] = 0;
status = f_directory_exists(path_sub);
memcpy(path_sub, path, path_length);
memcpy(path_sub + path_length + 1, list[i]->array[j].string, list[i]->array[j].used);
- path_sub[path_length] = f_path_separator[0];
+ path_sub[path_length] = f_path_separator_s[0];
path_sub[length] = 0;
status = f_file_role_change(path_sub, uid, gid, dereference);
memcpy(path_sub, path, path_length);
memcpy(path_sub + path_length + 1, listing.directory.array[i].string, listing.directory.array[i].used);
- path_sub[path_length] = f_path_separator[0];
+ path_sub[path_length] = f_path_separator_s[0];
path_sub[length] = 0;
status = f_directory_exists(path_sub);
break;
}
- *status = fl_string_append_assure(f_path_separator, f_path_separator_length, &source_path);
+ *status = fl_string_append_assure(f_path_separator_s, f_path_separator_length, &source_path);
if (F_status_is_error(*status)) {
fll_error_print(data.error, F_status_set_fine(*status), "fl_string_append_assure", F_true);
{
// add the guaranteed environment variables.
const f_string_t variables_name[] = {
- f_path_environment,
- f_path_present_working
+ f_path_environment_s,
+ f_path_present_working_s
};
const f_string_length_t variables_length[] = {
}
if (settings_single_type[i] == 2) {
- *status = fl_string_append_assure(f_path_separator, f_path_separator_length, settings_single_destination[i]);
+ *status = fl_string_append_assure(f_path_separator_s, f_path_separator_length, settings_single_destination[i]);
if (F_status_is_error(*status)) {
fll_error_print(data.error, F_status_set_fine(*status), "fl_string_append_assure", F_true);
break;
break;
}
- *status = fl_string_append_assure(f_path_separator, f_path_separator_length, &destination_path);
+ *status = fl_string_append_assure(f_path_separator_s, f_path_separator_length, &destination_path);
if (F_status_is_error(*status)) {
fll_error_print(data.error, F_status_set_fine(*status), "fl_string_append_assure", F_true);
return F_true;
}
- if (data_make->path_cache.string[data_make->path.stack.array[0].used] == f_path_separator[0]) {
+ if (data_make->path_cache.string[data_make->path.stack.array[0].used] == f_path_separator_s[0]) {
return F_true;
}
}
if (existing) {
memcpy(destination + arguments.array[total].used + 1, arguments.array[i].string, arguments.array[i].used);
- destination[arguments.array[total].used] = f_path_separator[0];
+ destination[arguments.array[total].used] = f_path_separator_s[0];
}
destination[destination_length] = 0;
if (existing) {
memcpy(destination + arguments.array[total].used + 1, arguments.array[i].string, arguments.array[i].used);
- destination[arguments.array[total].used] = f_path_separator[0];
+ destination[arguments.array[total].used] = f_path_separator_s[0];
}
destination[destination_length] = 0;
if (existing) {
memcpy(destination + arguments.array[total].used + 1, arguments.array[i].string, arguments.array[i].used);
- destination[arguments.array[total].used] = f_path_separator[0];
+ destination[arguments.array[total].used] = f_path_separator_s[0];
}
destination[destination_length] = 0;