This file is indexed.

/usr/include/osl/effect_util/effectUtil.h is in libosl-dev 0.4.2-1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
#ifndef _EFFECTUTIL_H
#define _EFFECTUTIL_H

#include "osl/state/numEffectState.h"
#include "osl/misc/carray.h"
#include "osl/container/pieceVector.h"

#include <iosfwd>
#include <cassert>

namespace osl
{
  namespace container
  {
    class PieceVector;
  }

  namespace effect_util
  {
  /**
   * EffectState を活用するためのメソッド
   * NumSimpleEffect などの公開インターフェースで
   * 使って書けるコード
   */
  struct EffectUtil
  {
    /**
     * PtypeO が Square にいると仮定した時にの利きを列挙.
     * 盤面が実際と違うと長い利きが不正確になる
     * @param InterestEmpty 空白のマスに興味があるか
     */
    template <class Function, bool InterestEmpty>
    static void forEachEffectOfPtypeO(const NumEffectState& state, Square, PtypeO,
				      Function& f);
    template <Player P, class Function, bool InterestEmpty>
    static void forEachEffectOfPtypeO(const NumEffectState& state, Square, Ptype,
				      Function& f);
    
    /**
     * 玉の素抜きなしに合法手でtargetに移動可能かを判定
     * @param king 玉 (玉で取る手は考えない)
     * @return 移動可能な駒があれば,安全な駒を一つ.なければ Piece::EMPTY()
     * @see osl::move_classifier::PawnDropCheckmate
     */
    template <Player P>
    static Piece safeCaptureNotByKing(const NumEffectState& state, Square target,
				    Piece king);
    static Piece safeCaptureNotByKing(Player P, const NumEffectState& state, 
				      Square target)
    {
      const Piece king = state.kingPiece(P);
      if (P == BLACK)
	return safeCaptureNotByKing<BLACK>(state, target, king);
      else
	return safeCaptureNotByKing<WHITE>(state, target, king);
    }
    /**
     * forEachEffect の Player のtemplate 引数を通常の引数にしたバージョン
     * @param P 探す対象の駒の所有者
     * @param pos に利きのある駒を探す
     */
    template <class Action>
    static void forEachEffect(Player P, const NumEffectState& state, Square pos, 
			      Action& a)
    {
      if (P == BLACK)
	state.template forEachEffect<BLACK>(pos,a);
      else
	state.template forEachEffect<WHITE>(pos,a);
    }
    /**
     * target に利きのあるPieceをoutに格納する
     */
    static void findEffect(Player P, const NumEffectState& state, Square target,
			   container::PieceVector& out);

    /**
     * state の position に ptypeo があった場合を仮定して,脅威をoutに集める
     */
    template <class EvalT>
    static void findThreat(const NumEffectState& state, Square position,
			   PtypeO ptypeo, PieceVector& out);

    template <class EvalT>
    struct FindThreat;
    struct SafeCapture;
  };

  } // namespace effect_util
  using effect_util::EffectUtil;
} // namespace osl

#endif /* _EFFECTUTIL_H */
// ;;; Local Variables:
// ;;; mode:c++
// ;;; c-basic-offset:2
// ;;; End: