Pharos 0.7.23
Modern Web Framework & Web App Hosting Service.
Loading...
Searching...
No Matches
native_migrate_verify.c File Reference

Verifies sqlite migration state natively and emits structured migration verification reports. More...

#include "native_migrate_verify.h"
#include "native_artifact_emit.h"
#include "native_json_config.h"
#include "native_process_capture.h"
#include "native_support.h"
#include "native_yyjson_helpers.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/wait.h>
#include <unistd.h>

Go to the source code of this file.

Macros

#define native_migrate_verify_strdup   strdup

Functions

static char * native_json_literal_dup (const char *value)
 Duplicates a static JSON literal string.
static char * native_json_nullable_string_dup (const char *value)
 Duplicates a string value as JSON string text, or null when absent.
static char * native_json_value_or_literal_dup (yyjson_val *value, const char *fallback)
 Duplicates a borrowed JSON value as compact JSON, or a fallback literal.
static char * native_json_object_string_json_dup (yyjson_val *obj, const char *key, const char *fallback)
 Duplicates an object string field as JSON string text with a default.
static char * native_long_json_dup (long value)
 Converts a long value to owned JSON number text.
static int native_identifier_safe (const char *value)
 Tests whether a string is a safe sqlite identifier.
static char * native_resolve_command_path (const char *command)
 Resolves an executable from PATH.
static int native_command_exists (const char *command)
 Tests whether a required native tool is available.
static char * native_capture_trimmed (char *const argv[], int *code_out)
 Runs a subprocess and trims surrounding whitespace from stdout.
static int native_append_escaped_sql_char (Buffer *buffer, char value)
 Appends one SQL character with sqlite literal escaping.
static char * native_sql_literal_escape (const char *value)
 Escapes a string for safe inclusion in a sqlite string literal.
static int native_write_temp_text_file (const char *text, char **path_out)
 Writes temporary text content to a file.
static char * native_capture_checksum_output (const char *command, const char *arg1, const char *arg2, const char *file_path, int *code_out)
 Captures checksum tool output for a temporary file.
static int native_seed_expectation_satisfied (long row_count, int minimum_present, long minimum_rows, int exact_present, long exact_rows, const char **reason_out)
 Evaluates whether a seed expectation passes.
static int native_json_string_array_contains (yyjson_val *array_value, const char *expected_value)
 Tests whether a JSON string array contains one exact string.
static int native_migration_checksum_matches (int applied, const char *applied_checksum, const char *expected_checksum, const char *legacy_expected_checksum, yyjson_val *accepted_legacy_checksums)
 Tests whether an applied checksum satisfies expected checksum contracts.
static char * native_sqlite_query_value (const char *db_path, const char *sql)
 Executes a sqlite query and captures one trimmed stdout value.
static int native_sqlite_table_exists (const char *db_path, const char *table_name)
 Tests whether a sqlite table exists.
static long native_sqlite_table_row_count (const char *db_path, const char *table_name)
 Counts rows in a sqlite table.
static long native_sqlite_migration_applied_count (const char *db_path, const char *migration_id, const char *backend)
 Counts applied migration ledger rows.
static char * native_sqlite_migration_applied_schema_version (const char *db_path, const char *migration_id, const char *backend)
 Reads the applied schema version for a migration.
static char * native_sqlite_migration_applied_checksum (const char *db_path, const char *migration_id, const char *backend)
 Reads the applied checksum for a migration.
static int native_append_file_to_buffer (Buffer *buffer, const char *file_path)
 Appends a whole file to a growable buffer followed by a newline.
static int native_append_path_marker (Buffer *buffer, const char *file_path)
 Appends a path marker line to a checksum input buffer.
static char * native_checksum_string (const char *value)
 Computes a sha256 checksum string for arbitrary text.
static char * native_resolve_app_path (const char *app_root, const char *value)
 Resolves a path string relative to the app root when needed.
static int native_append_seed_sources_to_buffer (Buffer *buffer, const char *app_root, yyjson_val *seed_sources)
 Appends resolved seed source files into a checksum buffer.
static char * native_append_json_item (Buffer *buffer, const char *json_item, int *first)
 Appends a JSON array item into a buffer-backed array literal.
static int native_append_json_string_item (Buffer *buffer, const char *value, int *first)
 Appends a JSON string item into a buffer-backed array literal.
static char * native_finish_json_array (Buffer *buffer, int first)
 Finalizes a buffer-backed JSON array literal.
static int native_append_forward_sql_bundle (Buffer *combined, const char *app_root, yyjson_val *migration_record, const char *backend)
 Appends forward SQL file contents for one migration/backend pair.
static char * native_expected_migration_checksum (const char *app_root, yyjson_val *migration_record, const char *entity_fixture, const char *query_fixture, const char *backend)
 Computes the current expected checksum for a migration.
static char * native_legacy_expected_migration_checksum (const char *app_root, yyjson_val *migration_record, const char *entity_fixture, const char *query_fixture, const char *backend, yyjson_val *seed_sources)
 Computes the legacy expected checksum for a migration.
static char * native_default_sqlite_path (const AppRuntime *app)
 Returns the default sqlite path for an app.
char * native_capture_migrate_verify_sqlite_report_json (const ServeConfig *config, const AppRuntime *app, char **status_out, char **error_out)
 Captures a sqlite migration verification report for one app.

Detailed Description

Verifies sqlite migration state natively and emits structured migration verification reports.

Definition in file native_migrate_verify.c.

Macro Definition Documentation

◆ native_migrate_verify_strdup

Function Documentation

◆ native_append_escaped_sql_char()

int native_append_escaped_sql_char ( Buffer * buffer,
char value )
static

Appends one SQL character with sqlite literal escaping.

Parameters
bufferDestination buffer.
valueCharacter to append.
Returns
0 on success, otherwise -1.

Definition at line 191 of file native_migrate_verify.c.

References buffer_append().

Referenced by native_sql_literal_escape().

◆ native_append_file_to_buffer()

int native_append_file_to_buffer ( Buffer * buffer,
const char * file_path )
static

Appends a whole file to a growable buffer followed by a newline.

Parameters
bufferDestination buffer.
file_pathFile path to append.
Returns
0 on success, otherwise -1.

Definition at line 590 of file native_migrate_verify.c.

References buffer_append(), and read_file_text().

Referenced by native_append_forward_sql_bundle(), native_append_seed_sources_to_buffer(), and native_expected_migration_checksum().

◆ native_append_forward_sql_bundle()

int native_append_forward_sql_bundle ( Buffer * combined,
const char * app_root,
yyjson_val * migration_record,
const char * backend )
static

Appends forward SQL file contents for one migration/backend pair.

Parameters
combinedDestination checksum input buffer.
app_rootApp root directory.
migration_recordMigration object.
backendBackend name.
Returns
0 on success, otherwise -1.

Definition at line 791 of file native_migrate_verify.c.

References native_append_file_to_buffer(), native_append_path_marker(), native_json_obj_get(), native_json_obj_get_array(), native_resolve_app_path(), yyjson_arr_iter_init(), yyjson_arr_iter_next(), yyjson_get_str(), and yyjson_is_str().

Referenced by native_expected_migration_checksum().

◆ native_append_json_item()

char * native_append_json_item ( Buffer * buffer,
const char * json_item,
int * first )
static

Appends a JSON array item into a buffer-backed array literal.

Parameters
bufferDestination buffer.
json_itemAlready serialized JSON item.
firstTracks whether the array already has an item.
Returns
Buffer data on success, or NULL on failure.

Definition at line 724 of file native_migrate_verify.c.

References buffer_append(), Buffer::data, and Buffer::len.

Referenced by native_append_json_string_item(), and native_capture_migrate_verify_sqlite_report_json().

◆ native_append_json_string_item()

int native_append_json_string_item ( Buffer * buffer,
const char * value,
int * first )
static

Appends a JSON string item into a buffer-backed array literal.

Parameters
bufferDestination buffer.
valuePlain string value.
firstTracks whether the array already has an item.
Returns
0 on success, otherwise -1.

Definition at line 751 of file native_migrate_verify.c.

References json_string_dup_native(), and native_append_json_item().

Referenced by native_capture_migrate_verify_sqlite_report_json().

◆ native_append_path_marker()

int native_append_path_marker ( Buffer * buffer,
const char * file_path )
static

Appends a path marker line to a checksum input buffer.

Parameters
bufferDestination buffer.
file_pathSource file path.
Returns
0 on success, otherwise -1.

Definition at line 610 of file native_migrate_verify.c.

References buffer_append().

Referenced by native_append_forward_sql_bundle(), and native_append_seed_sources_to_buffer().

◆ native_append_seed_sources_to_buffer()

int native_append_seed_sources_to_buffer ( Buffer * buffer,
const char * app_root,
yyjson_val * seed_sources )
static

Appends resolved seed source files into a checksum buffer.

Parameters
bufferDestination buffer.
app_rootApp root used for relative seed paths.
seed_sourcesArray of seed source paths.
Returns
0 on success, otherwise -1.

Definition at line 680 of file native_migrate_verify.c.

References native_append_file_to_buffer(), native_append_path_marker(), native_resolve_app_path(), path_exists(), yyjson_arr_iter_init(), yyjson_arr_iter_next(), yyjson_get_str(), yyjson_is_arr(), and yyjson_is_str().

Referenced by native_legacy_expected_migration_checksum().

◆ native_capture_checksum_output()

char * native_capture_checksum_output ( const char * command,
const char * arg1,
const char * arg2,
const char * file_path,
int * code_out )
static

Captures checksum tool output for a temporary file.

Parameters
commandChecksum command.
arg1Optional first flag.
arg2Optional second flag.
file_pathFile to checksum.
code_outOptional exit code output.
Returns
Newly allocated trimmed stdout, or NULL.

Definition at line 273 of file native_migrate_verify.c.

References native_capture_trimmed(), and native_resolve_command_path().

Referenced by native_checksum_string().

◆ native_capture_migrate_verify_sqlite_report_json()

char * native_capture_migrate_verify_sqlite_report_json ( const ServeConfig * config,
const AppRuntime * app,
char ** status_out,
char ** error_out )

Captures a sqlite migration verification report for one app.

Parameters
configActive serve configuration.
appFinalized app runtime to verify.
status_outOptional destination for an allocated verification status string.
error_outOptional destination for an allocated error message.
Returns
Newly allocated JSON report text, or NULL on failure.

Definition at line 998 of file native_migrate_verify.c.

References AppRuntime::app_id, AppRuntime::app_root, buffer_free(), buffer_init(), Buffer::data, json_string_dup_native(), native_append_json_item(), native_append_json_string_item(), native_command_exists(), native_default_sqlite_path(), native_expected_migration_checksum(), native_finish_json_array(), native_json_doc_free(), native_json_doc_load_file(), native_json_find_backend_by_name(), native_json_find_migration_by_id(), native_json_literal_dup(), native_json_nullable_string_dup(), native_json_obj_get(), native_json_obj_get_array(), native_json_obj_get_long_default(), native_json_obj_get_string_dup(), native_json_object_string_json_dup(), native_json_value_or_literal_dup(), native_legacy_expected_migration_checksum(), native_long_json_dup(), native_migrate_verify_strdup, native_migration_checksum_matches(), native_resolve_app_path(), native_seed_expectation_satisfied(), native_sqlite_migration_applied_checksum(), native_sqlite_migration_applied_count(), native_sqlite_migration_applied_schema_version(), native_sqlite_table_exists(), native_sqlite_table_row_count(), path_exists(), path_join(), streq(), ServeConfig::target_id, yyjson_arr_iter_init(), yyjson_arr_iter_next(), yyjson_doc_get_root(), yyjson_get_str(), yyjson_is_obj(), and yyjson_is_str().

Referenced by capture_migrate_verify_report_json().

◆ native_capture_trimmed()

char * native_capture_trimmed ( char *const argv[],
int * code_out )
static

Runs a subprocess and trims surrounding whitespace from stdout.

Parameters
argvCommand argv vector.
code_outOptional process exit code output.
Returns
Newly allocated trimmed stdout text, or NULL on process failure.

Definition at line 173 of file native_migrate_verify.c.

References run_process_capture_native(), and trim_in_place().

Referenced by native_capture_checksum_output(), and native_sqlite_query_value().

◆ native_checksum_string()

char * native_checksum_string ( const char * value)
static

Computes a sha256 checksum string for arbitrary text.

Parameters
valueInput text.
Returns
Newly allocated checksum hex text, or NULL on failure.

Definition at line 624 of file native_migrate_verify.c.

References native_capture_checksum_output(), native_command_exists(), and native_write_temp_text_file().

Referenced by native_expected_migration_checksum(), and native_legacy_expected_migration_checksum().

◆ native_command_exists()

int native_command_exists ( const char * command)
static

Tests whether a required native tool is available.

Parameters
commandCommand to resolve.
Returns
1 when present, otherwise 0.

Definition at line 160 of file native_migrate_verify.c.

References native_resolve_command_path().

Referenced by native_capture_migrate_verify_sqlite_report_json(), and native_checksum_string().

◆ native_default_sqlite_path()

char * native_default_sqlite_path ( const AppRuntime * app)
static

Returns the default sqlite path for an app.

Parameters
appApp runtime.
Returns
Newly allocated sqlite path.

Definition at line 985 of file native_migrate_verify.c.

References AppRuntime::app_id, conf_lookup_value(), native_migrate_verify_strdup, and AppRuntime::runtime_conf_path.

Referenced by native_capture_migrate_verify_sqlite_report_json().

◆ native_expected_migration_checksum()

char * native_expected_migration_checksum ( const char * app_root,
yyjson_val * migration_record,
const char * entity_fixture,
const char * query_fixture,
const char * backend )
static

Computes the current expected checksum for a migration.

Parameters
app_rootApp root directory.
migration_recordMigration object.
entity_fixtureOptional entity fixture path.
query_fixtureOptional query fixture path.
backendBackend name.
Returns
Newly allocated checksum text, or NULL on failure.

Definition at line 843 of file native_migrate_verify.c.

References buffer_free(), buffer_init(), Buffer::data, native_append_file_to_buffer(), native_append_forward_sql_bundle(), native_checksum_string(), and path_exists().

Referenced by native_capture_migrate_verify_sqlite_report_json(), and native_legacy_expected_migration_checksum().

◆ native_finish_json_array()

char * native_finish_json_array ( Buffer * buffer,
int first )
static

Finalizes a buffer-backed JSON array literal.

Parameters
bufferArray buffer.
firstWhether no items were appended.
Returns
Newly allocated empty array or buffer-owned array text.

Definition at line 769 of file native_migrate_verify.c.

References buffer_append(), buffer_free(), Buffer::data, and native_migrate_verify_strdup.

Referenced by native_capture_migrate_verify_sqlite_report_json().

◆ native_identifier_safe()

int native_identifier_safe ( const char * value)
static

Tests whether a string is a safe sqlite identifier.

Parameters
valueCandidate identifier.
Returns
1 when the identifier is safe, otherwise 0.

Definition at line 96 of file native_migrate_verify.c.

Referenced by native_sqlite_table_exists(), and native_sqlite_table_row_count().

◆ native_json_literal_dup()

char * native_json_literal_dup ( const char * value)
static

Duplicates a static JSON literal string.

Parameters
valueJSON literal text to duplicate.
Returns
Newly allocated copy, or NULL on allocation failure.

Definition at line 29 of file native_migrate_verify.c.

References native_migrate_verify_strdup.

Referenced by native_capture_migrate_verify_sqlite_report_json(), native_json_nullable_string_dup(), and native_json_value_or_literal_dup().

◆ native_json_nullable_string_dup()

char * native_json_nullable_string_dup ( const char * value)
static

Duplicates a string value as JSON string text, or null when absent.

Parameters
valueSource string.
Returns
Newly allocated JSON string payload or null literal.

Definition at line 38 of file native_migrate_verify.c.

References json_string_dup_native(), and native_json_literal_dup().

Referenced by native_capture_migrate_verify_sqlite_report_json().

◆ native_json_object_string_json_dup()

char * native_json_object_string_json_dup ( yyjson_val * obj,
const char * key,
const char * fallback )
static

Duplicates an object string field as JSON string text with a default.

Parameters
objObject to inspect.
keyField name.
fallbackDefault plain string value.
Returns
Newly allocated JSON string text.

Definition at line 67 of file native_migrate_verify.c.

References json_string_dup_native(), and native_json_obj_get_string_dup().

Referenced by native_capture_migrate_verify_sqlite_report_json().

◆ native_json_string_array_contains()

int native_json_string_array_contains ( yyjson_val * array_value,
const char * expected_value )
static

Tests whether a JSON string array contains one exact string.

Parameters
array_valueArray to inspect.
expected_valueExpected string.
Returns
1 when found, otherwise 0.

Definition at line 340 of file native_migrate_verify.c.

References yyjson_arr_iter_init(), yyjson_arr_iter_next(), yyjson_equals_str(), yyjson_is_arr(), and yyjson_is_str().

Referenced by native_legacy_expected_migration_checksum(), and native_migration_checksum_matches().

◆ native_json_value_or_literal_dup()

char * native_json_value_or_literal_dup ( yyjson_val * value,
const char * fallback )
static

Duplicates a borrowed JSON value as compact JSON, or a fallback literal.

Parameters
valueBorrowed JSON value.
fallbackFallback JSON literal.
Returns
Newly allocated JSON text.

Definition at line 51 of file native_migrate_verify.c.

References native_json_literal_dup(), and native_json_serialize_compact_dup().

Referenced by native_capture_migrate_verify_sqlite_report_json().

◆ native_legacy_expected_migration_checksum()

char * native_legacy_expected_migration_checksum ( const char * app_root,
yyjson_val * migration_record,
const char * entity_fixture,
const char * query_fixture,
const char * backend,
yyjson_val * seed_sources )
static

Computes the legacy expected checksum for a migration.

Parameters
app_rootApp root directory.
migration_recordMigration object.
entity_fixtureOptional entity fixture path.
query_fixtureOptional query fixture path.
backendBackend name.
seed_sourcesResolved seed source array.
Returns
Newly allocated checksum text, or NULL on failure.

Definition at line 883 of file native_migrate_verify.c.

References buffer_append(), buffer_free(), buffer_init(), Buffer::data, native_append_seed_sources_to_buffer(), native_checksum_string(), native_expected_migration_checksum(), native_json_obj_get_array(), native_json_obj_get_string_dup(), native_json_string_array_contains(), path_exists(), and read_file_text().

Referenced by native_capture_migrate_verify_sqlite_report_json().

◆ native_long_json_dup()

char * native_long_json_dup ( long value)
static

Converts a long value to owned JSON number text.

Parameters
valueNumeric value to serialize.
Returns
Newly allocated JSON number text, or NULL on allocation failure.

Definition at line 85 of file native_migrate_verify.c.

References native_migrate_verify_strdup.

Referenced by native_capture_migrate_verify_sqlite_report_json().

◆ native_migration_checksum_matches()

int native_migration_checksum_matches ( int applied,
const char * applied_checksum,
const char * expected_checksum,
const char * legacy_expected_checksum,
yyjson_val * accepted_legacy_checksums )
static

Tests whether an applied checksum satisfies expected checksum contracts.

Parameters
appliedWhether the migration is applied.
applied_checksumApplied checksum text.
expected_checksumPrimary expected checksum.
legacy_expected_checksumLegacy expected checksum.
accepted_legacy_checksumsArray of accepted legacy checksums.
Returns
1 when the checksum matches, otherwise 0.

Definition at line 368 of file native_migrate_verify.c.

References native_json_string_array_contains(), and streq().

Referenced by native_capture_migrate_verify_sqlite_report_json().

◆ native_resolve_app_path()

char * native_resolve_app_path ( const char * app_root,
const char * value )
static

Resolves a path string relative to the app root when needed.

Parameters
app_rootApp root directory.
valueRaw path value.
Returns
Newly allocated resolved path, or NULL on failure.

Definition at line 669 of file native_migrate_verify.c.

References resolve_relative_to().

Referenced by native_append_forward_sql_bundle(), native_append_seed_sources_to_buffer(), and native_capture_migrate_verify_sqlite_report_json().

◆ native_resolve_command_path()

char * native_resolve_command_path ( const char * command)
static

Resolves an executable from PATH.

Parameters
commandCommand name or path.
Returns
Newly allocated executable path, or NULL when unavailable.

Definition at line 117 of file native_migrate_verify.c.

References native_migrate_verify_strdup.

Referenced by native_capture_checksum_output(), native_command_exists(), and native_sqlite_query_value().

◆ native_seed_expectation_satisfied()

int native_seed_expectation_satisfied ( long row_count,
int minimum_present,
long minimum_rows,
int exact_present,
long exact_rows,
const char ** reason_out )
static

Evaluates whether a seed expectation passes.

Parameters
row_countObserved row count.
minimum_presentWhether minimum_rows was provided.
minimum_rowsMinimum row threshold.
exact_presentWhether exact_rows was provided.
exact_rowsExact row requirement.
reason_outReceives the failure reason.
Returns
1 when satisfied, otherwise 0.

Definition at line 313 of file native_migrate_verify.c.

Referenced by native_capture_migrate_verify_sqlite_report_json().

◆ native_sql_literal_escape()

char * native_sql_literal_escape ( const char * value)
static

Escapes a string for safe inclusion in a sqlite string literal.

Parameters
valueInput string.
Returns
Newly allocated escaped text, or NULL on allocation failure.

Definition at line 208 of file native_migrate_verify.c.

References buffer_free(), buffer_init(), Buffer::data, and native_append_escaped_sql_char().

Referenced by native_sqlite_migration_applied_checksum(), native_sqlite_migration_applied_count(), native_sqlite_migration_applied_schema_version(), and native_sqlite_table_exists().

◆ native_sqlite_migration_applied_checksum()

char * native_sqlite_migration_applied_checksum ( const char * db_path,
const char * migration_id,
const char * backend )
static

Reads the applied checksum for a migration.

Parameters
db_pathDatabase path.
migration_idMigration id.
backendBackend name.
Returns
Newly allocated checksum text, or NULL on failure.

Definition at line 556 of file native_migrate_verify.c.

References native_sql_literal_escape(), and native_sqlite_query_value().

Referenced by native_capture_migrate_verify_sqlite_report_json().

◆ native_sqlite_migration_applied_count()

long native_sqlite_migration_applied_count ( const char * db_path,
const char * migration_id,
const char * backend )
static

Counts applied migration ledger rows.

Parameters
db_pathDatabase path.
migration_idMigration id.
backendBackend name.
Returns
Count of matching applied rows.

Definition at line 481 of file native_migrate_verify.c.

References native_sql_literal_escape(), and native_sqlite_query_value().

Referenced by native_capture_migrate_verify_sqlite_report_json().

◆ native_sqlite_migration_applied_schema_version()

char * native_sqlite_migration_applied_schema_version ( const char * db_path,
const char * migration_id,
const char * backend )
static

Reads the applied schema version for a migration.

Parameters
db_pathDatabase path.
migration_idMigration id.
backendBackend name.
Returns
Newly allocated schema version text, or NULL on failure.

Definition at line 520 of file native_migrate_verify.c.

References native_sql_literal_escape(), and native_sqlite_query_value().

Referenced by native_capture_migrate_verify_sqlite_report_json().

◆ native_sqlite_query_value()

char * native_sqlite_query_value ( const char * db_path,
const char * sql )
static

Executes a sqlite query and captures one trimmed stdout value.

Parameters
db_pathDatabase path.
sqlSQL statement.
Returns
Newly allocated stdout text, or NULL on failure.

Definition at line 394 of file native_migrate_verify.c.

References native_capture_trimmed(), and native_resolve_command_path().

Referenced by native_sqlite_migration_applied_checksum(), native_sqlite_migration_applied_count(), native_sqlite_migration_applied_schema_version(), native_sqlite_table_exists(), and native_sqlite_table_row_count().

◆ native_sqlite_table_exists()

int native_sqlite_table_exists ( const char * db_path,
const char * table_name )
static

Tests whether a sqlite table exists.

Parameters
db_pathDatabase path.
table_nameTable name.
Returns
1 when present, otherwise 0.

Definition at line 425 of file native_migrate_verify.c.

References native_identifier_safe(), native_sql_literal_escape(), native_sqlite_query_value(), and streq().

Referenced by native_capture_migrate_verify_sqlite_report_json().

◆ native_sqlite_table_row_count()

long native_sqlite_table_row_count ( const char * db_path,
const char * table_name )
static

Counts rows in a sqlite table.

Parameters
db_pathDatabase path.
table_nameTable name.
Returns
Observed row count or 0 on failure.

Definition at line 457 of file native_migrate_verify.c.

References native_identifier_safe(), and native_sqlite_query_value().

Referenced by native_capture_migrate_verify_sqlite_report_json().

◆ native_write_temp_text_file()

int native_write_temp_text_file ( const char * text,
char ** path_out )
static

Writes temporary text content to a file.

Parameters
textText payload.
path_outReceives the created path.
Returns
0 on success, otherwise -1.

Definition at line 228 of file native_migrate_verify.c.

References native_migrate_verify_strdup.

Referenced by native_checksum_string().