Check out the latest documentation.

Getting Started

Both the Pattern and Trie detection methods can be used via the standard streams stdin and stdout. The following instructions explain how to download the required project files and then build programs which take input and return output via the standard streams.

The 51Degrees C API is not distributed with any binaries, it must be compiled with the following environment and compilers:

  • Visual Studio 2010 or greater
  • GCC compiler for Windows from either MinGW or Cygwin (Ensure your PATH variable is configured so GCC can be called from the command line)
  • GCC compiler on Linux
  • GCC or Clang on Mac OS X

Other C89 compliant compilers should work, but the API is only supported on these platforms.

The API can be downloaded as a zip archive from our SourceForge page . Decompress the zip into a working directory.

The above download contains free device data properties such as IsMobile, supported browser technologies and screen size in pixels. If you require weekly updates and rich device data download the Premium versions of the above files from the device data download page after purchasing a licence key .

Trie Data File Note: The Lite version of trie data provides 97% matching accuracy. The Premium version provides more than 99% accuracy and has a much larger file size. Premium trie data will require 64 bit versions of the following programs.

Once you've extracted the zip file use the following steps to build the executable for your platform.

Windows

Visual Studio

  • Locate the batch file Win32build.bat or Win64build.bat in the root folder.
  • Start the appropriate batch file for the target architecture required.
  • Wait for the batch file to complete compilation. Note that PerfTrie will not be built as it requires the GCC compiler.

GCC Compiler

  • Locate the batch file WinGCCbuild.bat in the root folder.
  • Start the batch file and wait for it to complete compilation. This may take a few minutes.

You will now have executable files called ProcPat.exe and ProcTrie.exe in the root folder. PerfPat is used to test performance of the C API. See Performance Evaluation for more information.

Linux and Mac OS X

  • Navigate to the root folder from a terminal session.
  • Type make followed by return. The makefile contained in the root folder will be used to build the executable.

You will now have executable files called ProcPat and ProcTrie in the root folder. PerfPat and PerfTrie is used to test performance of the C API. See Performance Evaluation for more information.