  The rich variety of crystalline symmetries in solids leads to a plethora of
topological crystalline insulators (TCIs) featuring distinct physical
properties, which are conventionally understood in terms of bulk invariants
specialized to the symmetries at hand. While isolated examples of TCI have been
identified and studied, the same variety demands a unified theoretical
framework. In this work, we show how the surfaces of TCIs can be analyzed
within a general surface theory with multiple flavors of Dirac fermions, whose
mass terms transform in specific ways under crystalline symmetries. We identify
global obstructions to achieving a fully gapped surface, which typically lead
to gapless domain walls on suitably chosen surface geometries. We perform this
analysis for all 32 point groups, and subsequently for all 230 space groups,
for spin-orbit-coupled electrons. We recover all previously discussed TCIs in
this symmetry class, including those with "hinge" surface states. Finally, we
make connections to the bulk band topology as diagnosed through symmetry-based
indicators. We show that spin-orbit-coupled band insulators with nontrivial
symmetry indicators are always accompanied by surface states that must be
gapless somewhere on suitably chosen surfaces. We provide an explicit mapping
between symmetry indicators, which can be readily calculated, and the
characteristic surface states of the resulting TCIs.
