#!/bin/bash12# This file is part of t8code.3# t8code is a C library to manage a collection (a forest) of multiple4# connected adaptive space-trees of general element classes in parallel.5#6# Copyright (C) 2023 the developers7#8# t8code is free software; you can redistribute it and/or modify9# it under the terms of the GNU General Public License as published by10# the Free Software Foundation; either version 2 of the License, or11# (at your option) any later version.12#13# t8code is distributed in the hope that it will be useful,14# but WITHOUT ANY WARRANTY; without even the implied warranty of15# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the16# GNU General Public License for more details.17#18# You should have received a copy of the GNU General Public License19# along with t8code; if not, write to the Free Software Foundation, Inc.,20# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.2122# This script lists all .c .h .cxx and .hxx23# files in t8code's src/ example/ and test/ subfolders.24#2526#27# This script must be executed from the scripts/ folder.28#29if [ `basename $PWD` != scripts ]30then31if [ -d scripts ]32then33# The directory stack is automatically reset on script exit.34pushd scripts/ > /dev/null35else36echo ERROR: scripts/ directory not found.37exit 138fi39fi4041# All valid file suffixes.42# Separated by '|' in order to be directly used43# as a regex in the find command.4445suffixes="c|cxx|h|hxx"4647# Find a suitable find program. Either 'find' or 'gfind'.48if find --version >/dev/null 2>&1; then49FIND=find50else51echo "GNU find not found, trying gfind..."52if gfind --version >/dev/null 2>&1; then53FIND=gfind54else55echo "Error: GNU find not found."56exit 157fi58fi5960# Find all files with the appropriate suffix in the61# src/, example/, test/, tutorials/, benchmark/, /api and /mesh_handle subfolders.62files=`$FIND ../src ../example ../test ../tutorials ../benchmarks ../api ../mesh_handle -regextype egrep -iregex ".*\.($suffixes)"`6364echo $files656667