Core-level shifts in bulk alloys and surface adlayers.