Name the parse-error status instead of repeating 128

The literal appeared in list.c and diff.c, was spelled out in prose in
both their headers, and collided with an unrelated 128 in
RecordObjectCompare, where it is an ordering sentinel for a NULL argument
rather than a status.

Introduce include/status.h with FSNAP_EPARSE, use it in both commands,
and say in types.h that the value there means something else.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018KyCHPAxWzqa3vHKdXJkgx
This commit is contained in:
Fabio Scotto di Santolo
2026-08-26 15:33:31 +02:00
parent e19378308d
commit cf7db11099
6 changed files with 26 additions and 7 deletions

View File

@@ -1,8 +1,10 @@
#ifndef DIFF_H
#define DIFF_H
#include "status.h"
/* Compare two snapshot files and print added/deleted/modified entries.
Returns 0 on success, -1 on system/IO error, 128 on parse error. */
Returns 0 on success, -1 on system/IO error, FSNAP_EPARSE on parse error. */
int diff(const char *file1, const char *file2);
#endif