90 lines
1.5 KiB
C++
90 lines
1.5 KiB
C++
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
#include <unistd.h>
|
|
#include <errno.h>
|
|
#include <stdint.h>
|
|
#include <string.h>
|
|
#include <assert.h>
|
|
|
|
#include "linked-list.h"
|
|
|
|
/*******************************************************/
|
|
|
|
/**
|
|
* \brief The data to be stored in the list
|
|
*/
|
|
struct Student
|
|
{
|
|
uint32_t nmec; ///< Student number
|
|
char *name; ///< Student name
|
|
};
|
|
|
|
/**
|
|
* \brief The linked-list support data structure:
|
|
*/
|
|
struct SllNode
|
|
{
|
|
Student reg; ///< Student data
|
|
struct SllNode *next; ///< Pointer to next node
|
|
};
|
|
|
|
/*******************************************************/
|
|
|
|
static SllNode *list = NULL;
|
|
|
|
/*******************************************************/
|
|
|
|
void sllDestroy()
|
|
{
|
|
}
|
|
|
|
/*******************************************************/
|
|
|
|
void sllPrint(FILE *fout)
|
|
{
|
|
}
|
|
|
|
/*******************************************************/
|
|
|
|
void sllInsert(uint32_t nmec, const char *name)
|
|
{
|
|
assert(name != NULL && name[0] != '\0');
|
|
assert(!sllExists(nmec));
|
|
|
|
}
|
|
|
|
/*******************************************************/
|
|
|
|
bool sllExists(uint32_t nmec)
|
|
{
|
|
return false;
|
|
}
|
|
|
|
/*******************************************************/
|
|
|
|
void sllRemove(uint32_t nmec)
|
|
{
|
|
assert(sllExists(nmec));
|
|
}
|
|
|
|
/*******************************************************/
|
|
|
|
const char *sllGetName(uint32_t nmec)
|
|
{
|
|
assert(sllExists(nmec));
|
|
|
|
return NULL;
|
|
}
|
|
|
|
/*******************************************************/
|
|
|
|
bool sllLoad(FILE *fin)
|
|
{
|
|
assert(fin != NULL);
|
|
|
|
return false;
|
|
}
|
|
|
|
/*******************************************************/
|
|
|