ふつうにsscanf()使えばいいじゃん。
あとはstrtol()とかさ。

if (sscanf(s, "%d", &n) == 1) {
  /* OK */
} else {
  /* NG */
}