# Hook Script API

`get_config(key)` -> `String`
`config(key)` -> `String`

  get a configuration. (e.g. config(`prefix`) for --prefix)

`set_config(key, val)`

  set a configuration KEY to val. (e.g. set_config("prefix", "/usr"))

`curr_srcdir` -> `String`

  the current srcdir.

`curr_objdir` -> `String`

  the current objdir.

`srcdir_root` -> `String`

  the root directory of srcdir. When the hook script is called from setup.rb, this method returns the top directory of each package directory (ARCHIVE_TOP/packages/*/).

`objdir_root` -> `String`

  the root directory of objdir. When the hook script is called from setup.rb, this method returns the top directory of each package directory (OBJDIR/packages/*/).

`srcfile(filename)` -> `String`

  expands relational path FNAME which is in the current srcdir, into the absolute path.

`srcexist?(filename)`

  true if a file FNAME exists in the current srcdir.

`srcdirectory?(filename)`

  true if a directory FNAME exists in the current srcdir.

`srcfile?(filename)`

  true if a normal file FNAME exists in the current srcdir.

`srcentries(relative_path = '.')` -> `[String]`

  returns the list of file entiries in the directory "current srcdir + `/` + relpath"

`srcfiles(relative_path = '.')` -> `[String]`

  returns the list of file names in the directory "current srcdir + `/` + relpath"

`srcdirectories(relative_path = '.')` -> `[String]`

  returns the list of directory names in the directory "current srcdir + `/` + relpath"