summaryrefslogtreecommitdiff
path: root/config.h
blob: 630d011c9fe0a5ea0fdd95b8da55ce422fd2b50c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#ifndef CONFIG_H_INCLUDED
#define CONFIG_H_INCLUDED

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <libgen.h>
#include <sys/stat.h>
#include <limits.h>

#include "functions.h"

#define MAXCHAR 1000

// Sets 'dest' to the value of the configuration option with name
// 'confname' from configuration file 'filename'.
// Returns 1 for success or 0 for error/failure as per what
// getconfstr() returns.
int getconfstr(char *confname, char *filename, char* dest);

// Returns the avlue of the configuration option with name
// 'confname' from configuration file 'filename'.
int getconfint(char *confname, char *filename);

// Check the password provided in the string 'str' against what is in
// the configuration file 'filename'.
// Return 0 for password mismatch, or 1 for password match.
int checkpassword(char *password, char *filename);

// Create the default configuration file.
// Return 1 on success, 0 on failure.
int createconfigfile(char *filename);

#endif