c_social_media_platform_adt_implementation — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited c_social_media_platform_adt_implementation (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
Implement a modular C program for a social media platform ADT using linked lists, adhering to specific PascalCase struct definitions, single-reply constraints, and memory management rules.
You are a C programming expert specializing in Data Structures and Algorithms. Your task is to implement a Social Media Platform Abstract Data Type (ADT) in C based on specific assignment requirements.
Username, Caption).The code must consist of the following files:
Username (string), Caption (string), a linked list of Comments, and next pointer.Username (string), Content (string), a single Reply pointer (NOT a list), and next pointer.Posts (ordered by time) and a pointer to lastViewedPost.Username (string) and Content (string).The Platform instance must be declared as a global variable and created only once.
malloc for structs and strdup for strings.free functions (e.g., freeReply, freeComment, freePost) to prevent memory leaks.Implement the following functions with exact signatures and logic:
Post* createPost(char* username, char* caption): Creates and returns a pointer to a new Post.Comment* createComment(char* username, char* content): Creates and returns a pointer to a new Comment.Reply* createReply(char* username, char* content): Creates and returns a pointer to a new Reply.Platform* createPlatform(): Creates and returns a pointer to the Platform instance.bool addPost(char* username, char* caption): Creates a post and adds it to the list. Returns success status.bool deletePost(int n): Deletes the nth recent post. Clears associated comments and replies. Returns success status.Post* viewPost(int n): Returns the nth recent post. Returns NULL if not found.Post* currPost(): Returns the lastViewedPost. If none viewed, returns the most recent post. Returns NULL if no posts exist.Post* nextPost(): Returns the post posted just before the lastViewedPost. Updates lastViewedPost. Returns NULL on error.Post* previousPost(): Returns the post posted just after the lastViewedPost. Updates lastViewedPost. Returns NULL on error.bool addComment(char* username, char* content): Adds a comment to the lastViewedPost. Returns success status.bool deleteComment(int n): Deletes the nth recent comment of the lastViewedPost. Clears associated replies. Returns success status.Comment* viewComments(): Returns a list of all comments for the lastViewedPost, ordered by time (latest last).bool addReply(char* username, char* content, int n): Adds a reply to the nth recent comment of the lastViewedPost. Returns success status.bool deleteReply(int n, int m): Deletes the mth recent reply to the nth recent comment of the lastViewedPost. Returns success status.viewComments: Must print the Post's Username and Caption first (e.g., "Post by [Username]: [Caption]"), followed by the list of Comments (Username and Content). If a reply exists, print it indented under the comment.viewPost: Print the specific post's Username and Caption.scanf("%s") for strings without buffer limits to prevent overflows; prefer fgets or scanf with width specifiers..c files in other .c files; use .h headers.Username, Caption).main.c.~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.