Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions .clang-tidy
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# clang-tidy configuration for fsq project
#
# This configuration is used by the CI workflow for static analysis.

Checks: >
-*,
bugprone-*,
clang-analyzer-core.*,
clang-analyzer-deadcode.*,
clang-analyzer-nullability.*,
clang-analyzer-security.FloatLoopCounter,
clang-analyzer-unix.*,
-clang-analyzer-security.insecureAPI.*,
-bugprone-easily-swappable-parameters,
-bugprone-suspicious-include

CheckOptions:
# Allow feature test macros used in this project
- key: bugprone-reserved-identifier.AllowedIdentifiers
value: '_GNU_SOURCE'

# Notes on disabled checks:
#
# bugprone-easily-swappable-parameters:
# Disabled because qsort comparison functions require (const void *, const void *)
# signature per the C standard. These parameters are intentionally of the same type.
#
# bugprone-suspicious-include:
# Disabled because some test files intentionally include .c files to test
# static functions directly. This is a common unit testing pattern.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
style: '' # disable clang-format
tidy-checks: '-*,bugprone-*,clang-analyzer-core.*,clang-analyzer-deadcode.*,clang-analyzer-nullability.*,clang-analyzer-security.FloatLoopCounter,clang-analyzer-unix.*,-clang-analyzer-security.insecureAPI.*'
tidy-checks: '' # use .clang-tidy config file
files-changed-only: ${{ github.event_name == 'pull_request' }}
database: '.'
extensions: 'c'
Expand Down
50 changes: 50 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Autotools generated files
/aclocal.m4
/autom4te.cache/
/compile
/config.guess
/config.sub
/configure
/depcomp
/install-sh
/ltmain.sh
/missing
/m4/libtool.m4
/m4/ltoptions.m4
/m4/ltsugar.m4
/m4/ltversion.m4
/m4/lt~obsolete.m4
Makefile.in

# Configure output
/config.h
/config.h.in
/config.log
/config.status
/libtool
/stamp-h1
Makefile

# Build artifacts
*.o
*.lo
*.la
.deps/
.libs/

# Compiled binaries
/src/fsqc
/src/fsqd
/src/test/test_fsqapi
/src/benchmark/fsqbench

# Editor backup files
*~
*.swp
*.swo

# IDE files
.idea/
.vscode/
*.code-workspace
compile_commands.json
22 changes: 22 additions & 0 deletions src/stubs/ltsm/include/ltsmapi.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/*
* LTSM API stub implementation for static analysis (clang-tidy)
* This provides minimal function implementations to allow parsing without the
* full LTSM library.
*/

#include "ltsmapi.h"

/* Convert off64_t to dsStruct64_t */
static inline dsStruct64_t to_dsStruct64_t(off64_t size)
{
dsStruct64_t ds;
ds.hi = (dsUint32_t)(size >> 32);
ds.lo = (dsUint32_t)(size & 0xFFFFFFFF);
return ds;
}

/* Convert dsStruct64_t to off64_t */
static inline off64_t to_off64_t(dsStruct64_t ds)
{
return ((off64_t)ds.hi << 32) | (off64_t)ds.lo;
}
49 changes: 33 additions & 16 deletions src/stubs/tsm/include/dsmapitd.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,24 +70,41 @@ typedef struct {
dsChar_t mcName[DSM_MAX_MC_NAME_LENGTH + 1];
} ObjAttr;

/* Object ID structure */
typedef struct {
dsUint32_t hi;
dsUint32_t lo;
} ObjID;

/* Restore order extended structure */
typedef struct {
dsUint32_t top;
dsUint32_t hi_hi;
dsUint32_t hi_lo;
dsUint32_t lo_hi;
dsUint32_t lo_lo;
} RestoreOrderExt;

/* Query response for archive data */
typedef struct {
dsUint8_t stVersion;
dsmObjName objName;
dsUint32_t copyGroup;
dsChar_t mcName[DSM_MAX_MC_NAME_LENGTH + 1];
dsChar_t owner[DSM_MAX_OWNER_LENGTH + 1];
dsmDate insDate;
dsmDate expDate;
dsChar_t descr[DSM_MAX_DESCR_LENGTH + 1];
dsUint16_t objInfoLength;
dsStruct64_t sizeEstimate;
dsUint8_t compressType;
dsUint8_t retentionInitiated;
dsUint8_t objHeld;
dsUint8_t encryptionType;
dsmBool_t clientDeduplicated;
char objInfo[DSM_MAX_OBJINFO_LENGTH];
dsUint8_t stVersion;
dsmObjName objName;
dsUint32_t copyGroup;
dsChar_t mcName[DSM_MAX_MC_NAME_LENGTH + 1];
dsChar_t owner[DSM_MAX_OWNER_LENGTH + 1];
dsmDate insDate;
dsmDate expDate;
dsChar_t descr[DSM_MAX_DESCR_LENGTH + 1];
dsUint16_t objInfoLength;
dsStruct64_t sizeEstimate;
dsUint8_t compressType;
dsUint8_t retentionInitiated;
dsUint8_t objHeld;
dsUint8_t encryptionType;
dsmBool_t clientDeduplicated;
char objInfo[DSM_MAX_OBJINFO_LENGTH];
ObjID objId;
RestoreOrderExt restoreOrderExt;
} qryRespArchiveData;

/* Version structures */
Expand Down