ctemp

Set color temperature
git clone git://git.akobets.xyz/ctemp
Log | Files | Refs | README | LICENSE

commit 4644dcb259ac1d0a3cc42211d3b686556a47a3d2
parent c7eb2290f114f40b429962d97408ad40aabb905b
Author: Artem Kobets <artem@akobets.xyz>
Date:   Thu,  5 Mar 2020 15:02:57 +0200

move util.c to ctemp.c

Diffstat:
MMakefile | 6++++--
Mctemp.1 | 2+-
Mctemp.c | 14+++++++++++++-
Dutil.c | 19-------------------
Dutil.h | 3---
5 files changed, 18 insertions(+), 26 deletions(-)

diff --git a/Makefile b/Makefile @@ -5,7 +5,7 @@ include config.mk -SRC = colors.c ctemp.c util.c +SRC = colors.c ctemp.c OBJ = $(SRC:.c=.o) all: ctemp @@ -13,7 +13,9 @@ all: ctemp .c.o: $(CC) -o $@ -c $< $(CFLAGS) -$(OBJ): config.mk util.h +ctemp.o: arg.h + +$(OBJ): config.mk ctemp: $(OBJ) $(CC) -o $@ $(OBJ) $(LDFLAGS) diff --git a/ctemp.1 b/ctemp.1 @@ -23,7 +23,7 @@ define interface to use. .RS .PP .B drm -- use Direct Rendering Manager API. +- use DRM API. .br Use this in console mode (no X11). .PP diff --git a/ctemp.c b/ctemp.c @@ -12,7 +12,6 @@ #include <unistd.h> #include "arg.h" -#include "util.h" #define LEN(x) (sizeof(x) / sizeof(x[0])) #define MAX_INTERFACE_STR_LEN 1024 @@ -35,6 +34,7 @@ static void quartz_handler(int temp); #ifdef X_SUPPORT static void x_handler(int temp); #endif +static void die(const char *fmt, ...); static void usage(); Interface interfaces[] = { @@ -240,6 +240,18 @@ x_handler(int temp) } #endif /* X_SUPPORT */ +void +die(const char *fmt, ...) +{ + va_list ap; + + va_start(ap, fmt); + vfprintf(stderr, fmt, ap); + va_end(ap); + + exit(1); +} + static void usage() { diff --git a/util.c b/util.c @@ -1,19 +0,0 @@ -/* See LICENSE for license details. */ - -#include <stdlib.h> -#include <stdio.h> -#include <stdarg.h> - -#include "util.h" - -void -die(const char *fmt, ...) -{ - va_list ap; - - va_start(ap, fmt); - vfprintf(stderr, fmt, ap); - va_end(ap); - - exit(EXIT_FAILURE); -} diff --git a/util.h b/util.h @@ -1,3 +0,0 @@ -/* See LICENSE for license details. */ - -void die(const char *fmt, ...);