mirror of
https://github.com/depp/syncfiles.git
synced 2024-11-24 17:31:40 +00:00
Extract common code into //lib package
This commit is contained in:
parent
66d46452ab
commit
617bf831d8
@ -28,15 +28,15 @@ cc_library(
|
||||
"convert.c",
|
||||
"convert_1f.c",
|
||||
"convert_1r.c",
|
||||
"toolbox.c",
|
||||
],
|
||||
hdrs = [
|
||||
"convert.h",
|
||||
"data.h",
|
||||
"defs.h",
|
||||
"test.h",
|
||||
],
|
||||
copts = COPTS,
|
||||
deps = [
|
||||
"//lib",
|
||||
],
|
||||
)
|
||||
|
||||
cc_test(
|
||||
@ -47,5 +47,6 @@ cc_test(
|
||||
copts = COPTS,
|
||||
deps = [
|
||||
":convert",
|
||||
"//lib",
|
||||
],
|
||||
)
|
||||
|
@ -2,7 +2,7 @@
|
||||
#define convert_h
|
||||
/* convert.h - character set conversion routines. */
|
||||
|
||||
#include "convert/defs.h"
|
||||
#include "lib/defs.h"
|
||||
|
||||
/* Error codes. */
|
||||
enum
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* convert_1f.c - Forward conversion from extended ASCII to UTF-8. */
|
||||
#include "convert/convert.h"
|
||||
#include "convert/defs.h"
|
||||
#include "lib/defs.h"
|
||||
|
||||
struct Convert1fData {
|
||||
/* Unicode characters, encoded in UTF-8, and packed MSB first. Always either
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* convert_1r.c - Reverse conversion from UTF-8 to extended ASCII. */
|
||||
#include "convert/convert.h"
|
||||
#include "convert/defs.h"
|
||||
#include "lib/defs.h"
|
||||
|
||||
enum
|
||||
{
|
||||
|
@ -3,7 +3,7 @@
|
||||
|
||||
#include "convert/convert.h"
|
||||
#include "convert/data.h"
|
||||
#include "convert/test.h"
|
||||
#include "lib/test.h"
|
||||
|
||||
#include <errno.h>
|
||||
#include <stdarg.h>
|
||||
|
@ -1,7 +1,7 @@
|
||||
#ifndef data_h
|
||||
#define data_h
|
||||
/* data.h - charmap data, not used for classic Mac OS builds */
|
||||
#include "convert/defs.h"
|
||||
#include "lib/defs.h"
|
||||
|
||||
/* Get the ID of the given character map. Return NULL if no such character map
|
||||
exists. */
|
||||
|
15
lib/BUILD.bazel
Normal file
15
lib/BUILD.bazel
Normal file
@ -0,0 +1,15 @@
|
||||
load("@rules_cc//cc:defs.bzl", "cc_library")
|
||||
load("//bazel:copts.bzl", "COPTS")
|
||||
|
||||
cc_library(
|
||||
name = "lib",
|
||||
srcs = [
|
||||
"toolbox.c",
|
||||
],
|
||||
hdrs = [
|
||||
"defs.h",
|
||||
"test.h",
|
||||
],
|
||||
copts = COPTS,
|
||||
visibility = ["//visibility:public"],
|
||||
)
|
@ -2,7 +2,7 @@
|
||||
#define test_h
|
||||
/* test.h - unit testing definitions. */
|
||||
|
||||
#include "convert/defs.h"
|
||||
#include "lib/defs.h"
|
||||
|
||||
/* Print an error message and exit. */
|
||||
void Dief(const char *msg, ...) __attribute__((noreturn, format(printf, 1, 2)));
|
@ -3,8 +3,8 @@
|
||||
This is used to run conversion tests on non-Mac OS systems to make
|
||||
development easier. These are not intended to make it possible to port the
|
||||
converter to non-Mac OS systems. */
|
||||
#include "convert/defs.h"
|
||||
#include "convert/test.h"
|
||||
#include "lib/defs.h"
|
||||
#include "lib/test.h"
|
||||
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
Loading…
Reference in New Issue
Block a user