c language please!!! and can you also come up with the proposed function that could add to the interface ( don't need to write it) and explain what it would do and how it is useful. thank you
This programming aseigntment will talos the fint few dailykotsewoek aseignments and combine their behayiors to make an opaque object wrapper that allows for all the behaviors we want in a bit collection data structure callexd BIT FL.AGS. \#ifndef BIT.FLAGS.H \#define BIT FLAGS.H \#include "status . h" typedef void: BIT.FI.AGS; /tentionally teaving out a default init fmnction to foree axer to /at leant gues, at the size needed. If ome WBRE to be wed it would /have the following prototype: //BIT FLAGS bit.ftagkinit.default (roid): / Precandition: number of bitn is a ponitiee integer- //Postcondition: Retarns the handle to a ralid Bit-flags object that // has the ability to store up to number_of,bits bits 5 ut currently 1/ all flagn are sef at zero. Returns NiLL on failare. The canfainer is assumed to hold size=number-of-bits after the init function ravs. BIT.FLACS bit.flags.iait _ummber_of.bits (iat aumber -of.bits): //Precondition: flag-position is a Non-negatiee integer and hB it-flags // is a handle to a valid Bit.flags object. Ponteondition: The flag (l at the flag-position indre in set te t. Functien will attempt to // resiae the internul representation if the flag-position is too // large initead of faiting for out of bownds. Retwrns SUCCESS if the operation is successful and FALURE if the / operation fails a needed resizc. This operation is considered to // be expensive if flag-position is censtontly going ost of bounds /1. by a smoll amosnt because the resize almags attempts to minimize // the amount of space required to store the bits. AIl new flags // created in a resize eperation (exeept the ene bring set) will be l/ set as zero. Status bit-flags-set-flag (BTT.FLAGS hBituflags, int flag-position): //Precondition: flag-ponition is a not-negaliee integer and hBitflag s is a handle to a valid Bit-flags abject. / Posteondition: The flag at the flag-penition index is set to O. Function will attempt to resite the infernat repreaentatioa /. if the fleg-pesition is toe large instead of failing for out of // bounds. Return. SUCCESS if the eperation is success ful and FALLLRE if the operetion fails a necded resize. This operation is considered to be expensiee if fleg-position is constantly // going out of beundn by a small amosnt becaune the resize alwayn // attempts to minimize the amount of space required to store the / bits. All new flags ereated in a resiae aperatian urill be set as zero. Status bit flags-anset,flag (BTT FLAGs hBit_flags, int flag-position): //Precondition: fiag-penition is a non-negatiee integer and A Bit-flag* / is a handle to a valid Bit. Jlags object. //Posteondition returns the value of the f lag at index flag-position if it in in beunds or 1 otherwine. int bit-flagsi-check-flag (BIT.FLAGS hBit_flags, int flag-positiou); //Precondition: hBit-flags is a handle to a valid Bit.flags object. /Postconditionz returas tae number of bits currently held by the data structus int bit flags-get-size (BIT.FLAGS hBit_flags): //Precondition: hBit.flags is a handle to a valid Bit.flags object. //Posteondition: returns the number of bitn the object CAN hald. int bit-flags - get -capacity (BIT FLAGS hBit flags): //Precondition phBit.flags is the addrens of a hendte to a valial Bit.flags ob //Postcondition: The memory for the ebject referred to by the handle /s free'd and the handle is set to NULL. void bit-flags-destroy (BIT.FLAGS* phBit-flags); \#endif Turn in only your bit flags.h and bit flags.e files for grading. The graders will use their own main program to test your data structure but you should test it as well as you can yourself with your own driver. The graders will also assume you are using the statusih we created in class. Please note that you may not change prototype of any of these functions as the functions must work with our driver you can only use these. In the comments section of your code think about your data structure and what might be missing. Come up with one proposed function that you could add to the interface (you do not have to write it) and explain why you think it should be added (what it would do and how it would be useful). At the top of your code you should have a comment soction that hes the following format: Author: Date: Purpose