Commit dff40d4e authored by Michal Vrabel's avatar Michal Vrabel
Browse files

Premenovanie misc -> options, presunutie FatalError do copymaster.c

parent 3c0f6739
CC = gcc
CFLAGS = -std=gnu11 -Wall -Wextra
LDFLAGS =
SOURCES = copymaster.c misc.c
HEADERS = misc.h
SOURCES = copymaster.c options.c
HEADERS = options.h
OBJDIR = obj
EXECUTABLE = copymaster
......
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <string.h>
#include "misc.h"
#include "options.h"
void FatalError(char c, const char* msg, int exit_status);
int main(int argc, char* argv[])
......@@ -90,3 +95,12 @@ int main(int argc, char* argv[])
return 0;
}
void FatalError(char c, const char* msg, int exit_status)
{
fprintf(stderr, "%c:%d\n", c, errno);
fprintf(stderr, "%c:%s\n", c, strerror(errno));
fprintf(stderr, "%c:%s\n", c, msg);
exit(exit_status);
}
#include <stdio.h>
#include <stdlib.h>
#include <stdlib.h>
#include <fcntl.h>
#include <unistd.h>
#include <getopt.h>
#include <errno.h>
#include <string.h>
#include "misc.h"
#include "options.h"
struct CopymasterOptions ParseCopymaterOptions(int argc, char *argv[]) {
struct CopymasterOptions ParseCopymaterOptions(int argc, char *argv[])
{
extern int optind;
extern char* optarg;
......@@ -161,10 +159,3 @@ struct CopymasterOptions ParseCopymaterOptions(int argc, char *argv[]) {
return cpm_options;
}
void FatalError(char c, const char* msg, int exit_status)
{
fprintf(stderr, "%c:%d\n", c, errno);
fprintf(stderr, "%c:%s\n", c, strerror(errno));
fprintf(stderr, "%c:%s\n", c, msg);
exit(exit_status);
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment