Skip to content

๐Ÿ“Œ Our project implements a contact management system using a binary file (Contacts.bin) with a Linked Variable-Length Chained (LVC) structure. This design optimizes space and access time, efficiently managing large datasets with quick search and retrieval via indexing.

Notifications You must be signed in to change notification settings

Rahim-444/Project_Sfsd

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

59 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Contact Management

Project Report:

Dependencies: SDL2, gcc.

local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not (vim.uv or vim.loop).fs_stat(lazypath) then
  vim.fn.system({
    "git",
    "clone",
    "--filter=blob:none",
    "https://github.com/folke/lazy.nvim.git",
    "--branch=stable", -- latest stable release
    lazypath,
  })
end
vim.opt.rtp:prepend(lazypath)

How to run :

gcc % -o %< -lm -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/SDL2.framework/Headers -Wl,-rpath,/Library/Frameworks -F/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks -framework SDL2

Theme:

Manipulation of contact management in C language. Pair:

  • Belkacemi Abderrahim โ€“ (Rahim444)
    LinkedIn Profile

  • Aoudia Nour Islam (islam5603)

1. Description:

Our project involves implementing a contact management system using a binary file named 'Contacts.bin'. This file adopts an LVC structure (Chained Organization, variable record format, and overlapping). This approach offers particular flexibility to efficiently manage a large number of contacts.

2.1. Data Structures Used:

  • Contact: The Contact structure is designed to store information about a contact, including an identifier (iD), a name (name), a phone number (phoneNumber), an email address (email), and the possibility to include additional variable-length information (otherInfo). Each field is sized to accommodate the maximum expected size, with margins for string termination characters. The use of a pointer for otherInfo suggests dynamic memory management for storing additional details.

  • Block: The Block structure is intended to organize and store contacts efficiently. Each block is identified by a number (blockNumber) and keeps track of the space occupied in characters (occupiedSpace). A character array named Contacts is used to store contacts, although the specific size is not specified. A pointer to the next block (nextBlock) allows for the creation of a linked list of blocks, facilitating dynamic memory management to store a large number of contacts optimally.

  • FileInfo: The FileInfo structure centrally manages a sequence of blocks, probably organized in a linked list to store contacts. The main elements include a pointer to the first block (firstBlock), the total number of blocks in the sequence (totalSize), the total number of contacts stored (contactSize), as well as statistics on operations performed, such as the number of contacts added (addedContacts) and the number of contacts deleted (deletedContacts).

  • IndexFile: The IndexFile structure is designed to index data blocks in a file. Each index element is associated with a file identifier (id), a pointer to the corresponding block (Pblock), and an offset within the block (offset). The linked list (next) allows for dynamic management of index elements, thus facilitating flexible organization of multiple index entries in a file structure.

2.2. Implemented Modules:

  • SDL2/SDL.h: The <SDL2/SDL.h> library in C language, known as SDL (Simple DirectMedia Layer), offers powerful features for multimedia development. It enables the creation of graphic windows, user input management, graphic rendering, sound and music playback, as well as time and event management. SDL also facilitates working with threads for concurrent task management. Including <SDL2/SDL.h> in the code indicates the use of these features, but also requires linking with the SDL library during compilation for proper functionality.

2.3 Example Test:

  1. After program execution:

    image

  2. Random Insertion: Click on the 'M' key

    image

  3. Insertion with contact details: Click on 'space'.

    image

  4. Deleting a contact: Click on 'delete'

    Before:

    image

    After:

    image

  5. Searching for a contact: Click on 'R'

    image

  6. Contact file:

    image

  7. Sorted contact file:

    image

  8. Dense index file:

    image

  9. Sparse index file:

    image

About

๐Ÿ“Œ Our project implements a contact management system using a binary file (Contacts.bin) with a Linked Variable-Length Chained (LVC) structure. This design optimizes space and access time, efficiently managing large datasets with quick search and retrieval via indexing.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages