From d68d656a97f42a542fd7e955d216a471f9bad221 Mon Sep 17 00:00:00 2001 From: Matthew Fernandez Date: Sun, 13 Mar 2022 17:36:55 -0700 Subject: [PATCH] remove now-unused 'pathgetlink' --- ci/clang_format.py | 1 - lib/ast/CMakeLists.txt | 1 - lib/ast/Makefile.am | 2 +- lib/ast/ast.h | 1 - lib/ast/ast.vcxproj | 1 - lib/ast/ast.vcxproj.filters | 3 --- lib/ast/pathgetlink.c | 49 ------------------------------------- 7 files changed, 1 insertion(+), 57 deletions(-) delete mode 100644 lib/ast/pathgetlink.c diff --git a/ci/clang_format.py b/ci/clang_format.py index fc9c5f3b4..7201ea2fd 100644 --- a/ci/clang_format.py +++ b/ci/clang_format.py @@ -243,7 +243,6 @@ EXCLUDE = ( "lib/ast/pathcanon.c", "lib/ast/pathcat.c", "lib/ast/pathfind.c", - "lib/ast/pathgetlink.c", "lib/ast/pathpath.c", "lib/ast/sfstr.h", "lib/ast/strcopy.c", diff --git a/lib/ast/CMakeLists.txt b/lib/ast/CMakeLists.txt index 1c3a670ac..1814b337d 100644 --- a/lib/ast/CMakeLists.txt +++ b/lib/ast/CMakeLists.txt @@ -16,7 +16,6 @@ add_library(ast STATIC pathcanon.c pathcat.c pathfind.c - pathgetlink.c strcopy.c stresc.c strmatch.c diff --git a/lib/ast/Makefile.am b/lib/ast/Makefile.am index 68f8cc415..0fac1f3e7 100644 --- a/lib/ast/Makefile.am +++ b/lib/ast/Makefile.am @@ -7,7 +7,7 @@ noinst_LTLIBRARIES = libast_C.la libast_C_la_SOURCES = pathpath.c sfstr.h chresc.c chrtoi.c error.c \ fmtbuf.c fmtesc.c pathaccess.c pathcanon.c pathcat.c \ - pathfind.c pathgetlink.c \ + pathfind.c \ strcopy.c stresc.c strmatch.c EXTRA_DIST = compat_unistd.h ast.vcxproj* diff --git a/lib/ast/ast.h b/lib/ast/ast.h index 02f0a8522..27783c540 100644 --- a/lib/ast/ast.h +++ b/lib/ast/ast.h @@ -64,7 +64,6 @@ extern "C" { const char *, int); extern const char *pathcat(char *, const char *, int, const char *, const char *); - extern size_t pathgetlink(const char *, char *, size_t); extern int chresc(const char *, char **); extern int chrtoi(const char *); diff --git a/lib/ast/ast.vcxproj b/lib/ast/ast.vcxproj index 3ff940c97..ac8117e76 100644 --- a/lib/ast/ast.vcxproj +++ b/lib/ast/ast.vcxproj @@ -91,7 +91,6 @@ - diff --git a/lib/ast/ast.vcxproj.filters b/lib/ast/ast.vcxproj.filters index 3f3bc9e3e..14ee6c957 100644 --- a/lib/ast/ast.vcxproj.filters +++ b/lib/ast/ast.vcxproj.filters @@ -59,9 +59,6 @@ Source Files - - Source Files - Source Files diff --git a/lib/ast/pathgetlink.c b/lib/ast/pathgetlink.c deleted file mode 100644 index 5e0bcd13e..000000000 --- a/lib/ast/pathgetlink.c +++ /dev/null @@ -1,49 +0,0 @@ -/************************************************************************* - * Copyright (c) 2011 AT&T Intellectual Property - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Details at https://graphviz.org - *************************************************************************/ - -/* -* Glenn Fowler -* AT&T Bell Laboratories -*/ - -#include "config.h" -#include - -#include -#ifdef HAVE_UNISTD_H -#include -#else -#include -#endif -#include -#include - -/* - * return external representation for symbolic link text of name in buf - * the link text string length is returned - */ - -size_t pathgetlink(const char *name, char *buf, size_t siz) -{ -#ifdef _WIN32 - return SIZE_MAX; -#else - ssize_t n; - - if ((n = readlink(name, buf, siz)) < 0) - return SIZE_MAX; - if ((size_t)n >= siz) { - errno = EINVAL; - return SIZE_MAX; - } - buf[n] = 0; - return (size_t)n; -#endif -} -- 2.40.0