<?php

/* ----------------------------------------------------------------------------
 * This file was automatically generated by SWIG (http://www.swig.org).
 * Version 1.3.40
 * 
 * This file is not intended to be easily readable and contains a number of 
 * coding conventions designed to improve portability and efficiency. Do not make
 * changes to this file unless you know what you are doing--modify the SWIG 
 * interface file instead. 
 * ----------------------------------------------------------------------------- */

// Try to load our extension if it's not already loaded.
if (!extension_loaded('digium_register')) {
  if (strtolower(substr(PHP_OS, 0, 3)) === 'win') {
    if (!dl('php_digium_register.dll')) return;
  } else {
    // PHP_SHLIB_SUFFIX gives 'dylib' on MacOS X but modules are 'so'.
    if (PHP_SHLIB_SUFFIX === 'dylib') {
      if (!dl('digium_register.so')) return;
    } else {
      if (!dl('digium_register.'.PHP_SHLIB_SUFFIX)) return;
    }
  }
}



abstract class digium_register {
	const MAX_USERFIELD_SIZE = MAX_USERFIELD_SIZE;

	const MAX_HOSTID_SIZE = MAX_HOSTID_SIZE;

	static function dreg_is_poundkey() {
		return dreg_is_poundkey();
	}

	static function dreg_get_hostid() {
		return dreg_get_hostid();
	}

	static function dreg_find_category_by_id($category_list,$id) {
		$r=dreg_find_category_by_id($category_list,$id);
		if (is_resource($r)) {
			$c=substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3));
			if (!class_exists($c)) {
				return new dreg_product_category($r);
			}
			return new $c($r);
		}
		return $r;
	}

	static function dreg_find_category_by_index($category_list,$index) {
		$r=dreg_find_category_by_index($category_list,$index);
		if (is_resource($r)) {
			$c=substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3));
			if (!class_exists($c)) {
				return new dreg_product_category($r);
			}
			return new $c($r);
		}
		return $r;
	}

	static function dreg_find_product_by_id($product_list,$id) {
		$r=dreg_find_product_by_id($product_list,$id);
		if (is_resource($r)) {
			$c=substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3));
			if (!class_exists($c)) {
				return new dreg_product($r);
			}
			return new $c($r);
		}
		return $r;
	}

	static function dreg_find_product_by_index($product_list,$index) {
		$r=dreg_find_product_by_index($product_list,$index);
		if (is_resource($r)) {
			$c=substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3));
			if (!class_exists($c)) {
				return new dreg_product($r);
			}
			return new $c($r);
		}
		return $r;
	}

	static function dreg_get_product_categories() {
		$r=dreg_get_product_categories();
		if (is_resource($r)) {
			$c=substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3));
			if (!class_exists($c)) {
				return new dreg_product_category_list($r);
			}
			return new $c($r);
		}
		return $r;
	}

	static function dreg_get_products($category) {
		$r=dreg_get_products($category);
		if (is_resource($r)) {
			$c=substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3));
			if (!class_exists($c)) {
				return new dreg_product_list($r);
			}
			return new $c($r);
		}
		return $r;
	}

	static function dreg_verify_key($product,$host,$key,$os,$status) {
		return dreg_verify_key($product,$host,$key,$os,$status);
	}

	static function dreg_get_eula($product,$key,$lang) {
		return dreg_get_eula($product,$key,$lang);
	}

	static function dreg_get_product_reg_requirements($product,$lang) {
		$r=dreg_get_product_reg_requirements($product,$lang);
		if (is_resource($r)) {
			$c=substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3));
			if (!class_exists($c)) {
				return new dreg_userfield_list($r);
			}
			return new $c($r);
		}
		return $r;
	}

	static function dreg_register_product($product,$userfield_list,$host,$key,$os,$is_poundkey) {
		$r=dreg_register_product($product,$userfield_list,$host,$key,$os,$is_poundkey);
		if (is_resource($r)) {
			$c=substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3));
			if (!class_exists($c)) {
				return new dreg_license_list($r);
			}
			return new $c($r);
		}
		return $r;
	}

	static function dreg_set_proxy($proxy,$proxy_user,$proxy_pass) {
		dreg_set_proxy($proxy,$proxy_user,$proxy_pass);
	}

	static function dreg_get_entitlements($hostid) {
		return dreg_get_entitlements($hostid);
	}
}

/* PHP Proxy Classes */
class dreg_product_category_list {
	public $_cPtr=null;
	protected $_pData=array();

	function __set($var,$value) {
		if ($var === 'first') return dreg_product_category_list_first_set($this->_cPtr,$value);
		if ($var === 'last') return dreg_product_category_list_last_set($this->_cPtr,$value);
		if ($var === 'thisown') return swig_digium_register_alter_newobject($this->_cPtr,$value);
		$this->_pData[$var] = $value;
	}

	function __isset($var) {
		if (function_exists('dreg_product_category_list_'.$var.'_set')) return true;
		if ($var === 'thisown') return true;
		return array_key_exists($var, $this->_pData);
	}

	function __get($var) {
		$func = 'dreg_product_category_list_'.$var.'_get';
		if (function_exists($func)) {
			$r = call_user_func($func,$this->_cPtr);
			if (!is_resource($r)) return $r;
			$c=substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3));
			return new $c($r);
		}
		if ($var === 'thisown') return swig_digium_register_get_newobject($this->_cPtr);
		return $this->_pData[$var];
	}

	public function __construct($res=null) {
		if (is_resource($res) && get_resource_type($res) === '_p_dreg_product_category_list') {
			$this->_cPtr=$res;
			return;
		}
		$this->_cPtr=new_dreg_product_category_list();
	}
}

class dreg_product_category {
	public $_cPtr=null;
	protected $_pData=array();

	function __set($var,$value) {
		if ($var === 'name') return dreg_product_category_name_set($this->_cPtr,$value);
		if ($var === 'id') return dreg_product_category_id_set($this->_cPtr,$value);
		if ($var === 'thisown') return swig_digium_register_alter_newobject($this->_cPtr,$value);
		$this->_pData[$var] = $value;
	}

	function __isset($var) {
		if (function_exists('dreg_product_category_'.$var.'_set')) return true;
		if ($var === 'thisown') return true;
		return array_key_exists($var, $this->_pData);
	}

	function __get($var) {
		$func = 'dreg_product_category_'.$var.'_get';
		if (function_exists($func)) {
			$r = call_user_func($func,$this->_cPtr);
			if (!is_resource($r)) return $r;
			$c=substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3));
			return new $c($r);
		}
		if ($var === 'thisown') return swig_digium_register_get_newobject($this->_cPtr);
		return $this->_pData[$var];
	}

	public function __construct($res=null) {
		if (is_resource($res) && get_resource_type($res) === '_p_dreg_product_category') {
			$this->_cPtr=$res;
			return;
		}
		$this->_cPtr=new_dreg_product_category();
	}
}

class dreg_product_category_entry {
	public $_cPtr=null;
	protected $_pData=array();

	function __set($var,$value) {
		if ($var === 'next') return dreg_product_category_entry_next_set($this->_cPtr,$value);
		if ($var === 'thisown') return swig_digium_register_alter_newobject($this->_cPtr,$value);
		$this->_pData[$var] = $value;
	}

	function __isset($var) {
		if (function_exists('dreg_product_category_entry_'.$var.'_set')) return true;
		if ($var === 'thisown') return true;
		return array_key_exists($var, $this->_pData);
	}

	function __get($var) {
		$func = 'dreg_product_category_entry_'.$var.'_get';
		if (function_exists($func)) {
			$r = call_user_func($func,$this->_cPtr);
			if (!is_resource($r)) return $r;
			$c=substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3));
			return new $c($r);
		}
		if ($var === 'thisown') return swig_digium_register_get_newobject($this->_cPtr);
		return $this->_pData[$var];
	}

	public function __construct($res=null) {
		if (is_resource($res) && get_resource_type($res) === '_p_dreg_product_category_entry') {
			$this->_cPtr=$res;
			return;
		}
		$this->_cPtr=new_dreg_product_category_entry();
	}
}

class dreg_product_list {
	public $_cPtr=null;
	protected $_pData=array();

	function __set($var,$value) {
		if ($var === 'first') return dreg_product_list_first_set($this->_cPtr,$value);
		if ($var === 'last') return dreg_product_list_last_set($this->_cPtr,$value);
		if ($var === 'thisown') return swig_digium_register_alter_newobject($this->_cPtr,$value);
		$this->_pData[$var] = $value;
	}

	function __isset($var) {
		if (function_exists('dreg_product_list_'.$var.'_set')) return true;
		if ($var === 'thisown') return true;
		return array_key_exists($var, $this->_pData);
	}

	function __get($var) {
		$func = 'dreg_product_list_'.$var.'_get';
		if (function_exists($func)) {
			$r = call_user_func($func,$this->_cPtr);
			if (!is_resource($r)) return $r;
			$c=substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3));
			return new $c($r);
		}
		if ($var === 'thisown') return swig_digium_register_get_newobject($this->_cPtr);
		return $this->_pData[$var];
	}

	public function __construct($res=null) {
		if (is_resource($res) && get_resource_type($res) === '_p_dreg_product_list') {
			$this->_cPtr=$res;
			return;
		}
		$this->_cPtr=new_dreg_product_list();
	}
}

class dreg_product {
	public $_cPtr=null;
	protected $_pData=array();

	function __set($var,$value) {
		$func = 'dreg_product_'.$var.'_set';
		if (function_exists($func)) return call_user_func($func,$this->_cPtr,$value);
		if ($var === 'thisown') return swig_digium_register_alter_newobject($this->_cPtr,$value);
		$this->_pData[$var] = $value;
	}

	function __isset($var) {
		if (function_exists('dreg_product_'.$var.'_set')) return true;
		if ($var === 'thisown') return true;
		return array_key_exists($var, $this->_pData);
	}

	function __get($var) {
		$func = 'dreg_product_'.$var.'_get';
		if (function_exists($func)) {
			$r = call_user_func($func,$this->_cPtr);
			if (!is_resource($r)) return $r;
			$c=substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3));
			return new $c($r);
		}
		if ($var === 'thisown') return swig_digium_register_get_newobject($this->_cPtr);
		return $this->_pData[$var];
	}

	public function __construct($res=null) {
		if (is_resource($res) && get_resource_type($res) === '_p_dreg_product') {
			$this->_cPtr=$res;
			return;
		}
		$this->_cPtr=new_dreg_product();
	}
}

class dreg_product_entry {
	public $_cPtr=null;
	protected $_pData=array();

	function __set($var,$value) {
		if ($var === 'next') return dreg_product_entry_next_set($this->_cPtr,$value);
		if ($var === 'thisown') return swig_digium_register_alter_newobject($this->_cPtr,$value);
		$this->_pData[$var] = $value;
	}

	function __isset($var) {
		if (function_exists('dreg_product_entry_'.$var.'_set')) return true;
		if ($var === 'thisown') return true;
		return array_key_exists($var, $this->_pData);
	}

	function __get($var) {
		$func = 'dreg_product_entry_'.$var.'_get';
		if (function_exists($func)) {
			$r = call_user_func($func,$this->_cPtr);
			if (!is_resource($r)) return $r;
			$c=substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3));
			return new $c($r);
		}
		if ($var === 'thisown') return swig_digium_register_get_newobject($this->_cPtr);
		return $this->_pData[$var];
	}

	public function __construct($res=null) {
		if (is_resource($res) && get_resource_type($res) === '_p_dreg_product_entry') {
			$this->_cPtr=$res;
			return;
		}
		$this->_cPtr=new_dreg_product_entry();
	}
}

class dreg_userfield_list {
	public $_cPtr=null;
	protected $_pData=array();

	function __set($var,$value) {
		if ($var === 'first') return dreg_userfield_list_first_set($this->_cPtr,$value);
		if ($var === 'last') return dreg_userfield_list_last_set($this->_cPtr,$value);
		if ($var === 'thisown') return swig_digium_register_alter_newobject($this->_cPtr,$value);
		$this->_pData[$var] = $value;
	}

	function __isset($var) {
		if (function_exists('dreg_userfield_list_'.$var.'_set')) return true;
		if ($var === 'thisown') return true;
		return array_key_exists($var, $this->_pData);
	}

	function __get($var) {
		$func = 'dreg_userfield_list_'.$var.'_get';
		if (function_exists($func)) {
			$r = call_user_func($func,$this->_cPtr);
			if (!is_resource($r)) return $r;
			$c=substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3));
			return new $c($r);
		}
		if ($var === 'thisown') return swig_digium_register_get_newobject($this->_cPtr);
		return $this->_pData[$var];
	}

	public function __construct($res=null) {
		if (is_resource($res) && get_resource_type($res) === '_p_dreg_userfield_list') {
			$this->_cPtr=$res;
			return;
		}
		$this->_cPtr=new_dreg_userfield_list();
	}
}

class dreg_userfield {
	public $_cPtr=null;
	protected $_pData=array();

	function __set($var,$value) {
		$func = 'dreg_userfield_'.$var.'_set';
		if (function_exists($func)) return call_user_func($func,$this->_cPtr,$value);
		if ($var === 'thisown') return swig_digium_register_alter_newobject($this->_cPtr,$value);
		$this->_pData[$var] = $value;
	}

	function __isset($var) {
		if (function_exists('dreg_userfield_'.$var.'_set')) return true;
		if ($var === 'thisown') return true;
		return array_key_exists($var, $this->_pData);
	}

	function __get($var) {
		$func = 'dreg_userfield_'.$var.'_get';
		if (function_exists($func)) {
			$r = call_user_func($func,$this->_cPtr);
			if (!is_resource($r)) return $r;
			$c=substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3));
			return new $c($r);
		}
		if ($var === 'thisown') return swig_digium_register_get_newobject($this->_cPtr);
		return $this->_pData[$var];
	}

	public function __construct($res=null) {
		if (is_resource($res) && get_resource_type($res) === '_p_dreg_userfield') {
			$this->_cPtr=$res;
			return;
		}
		$this->_cPtr=new_dreg_userfield();
	}
}

class dreg_userfield_entry {
	public $_cPtr=null;
	protected $_pData=array();

	function __set($var,$value) {
		if ($var === 'next') return dreg_userfield_entry_next_set($this->_cPtr,$value);
		if ($var === 'thisown') return swig_digium_register_alter_newobject($this->_cPtr,$value);
		$this->_pData[$var] = $value;
	}

	function __isset($var) {
		if (function_exists('dreg_userfield_entry_'.$var.'_set')) return true;
		if ($var === 'thisown') return true;
		return array_key_exists($var, $this->_pData);
	}

	function __get($var) {
		$func = 'dreg_userfield_entry_'.$var.'_get';
		if (function_exists($func)) {
			$r = call_user_func($func,$this->_cPtr);
			if (!is_resource($r)) return $r;
			$c=substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3));
			return new $c($r);
		}
		if ($var === 'thisown') return swig_digium_register_get_newobject($this->_cPtr);
		return $this->_pData[$var];
	}

	public function __construct($res=null) {
		if (is_resource($res) && get_resource_type($res) === '_p_dreg_userfield_entry') {
			$this->_cPtr=$res;
			return;
		}
		$this->_cPtr=new_dreg_userfield_entry();
	}
}

class dreg_license_list {
	public $_cPtr=null;
	protected $_pData=array();

	function __set($var,$value) {
		if ($var === 'first') return dreg_license_list_first_set($this->_cPtr,$value);
		if ($var === 'last') return dreg_license_list_last_set($this->_cPtr,$value);
		if ($var === 'thisown') return swig_digium_register_alter_newobject($this->_cPtr,$value);
		$this->_pData[$var] = $value;
	}

	function __isset($var) {
		if (function_exists('dreg_license_list_'.$var.'_set')) return true;
		if ($var === 'thisown') return true;
		return array_key_exists($var, $this->_pData);
	}

	function __get($var) {
		$func = 'dreg_license_list_'.$var.'_get';
		if (function_exists($func)) {
			$r = call_user_func($func,$this->_cPtr);
			if (!is_resource($r)) return $r;
			$c=substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3));
			return new $c($r);
		}
		if ($var === 'thisown') return swig_digium_register_get_newobject($this->_cPtr);
		return $this->_pData[$var];
	}

	public function __construct($res=null) {
		if (is_resource($res) && get_resource_type($res) === '_p_dreg_license_list') {
			$this->_cPtr=$res;
			return;
		}
		$this->_cPtr=new_dreg_license_list();
	}
}

class dreg_license {
	public $_cPtr=null;
	protected $_pData=array();

	function __set($var,$value) {
		$func = 'dreg_license_'.$var.'_set';
		if (function_exists($func)) return call_user_func($func,$this->_cPtr,$value);
		if ($var === 'thisown') return swig_digium_register_alter_newobject($this->_cPtr,$value);
		$this->_pData[$var] = $value;
	}

	function __isset($var) {
		if (function_exists('dreg_license_'.$var.'_set')) return true;
		if ($var === 'thisown') return true;
		return array_key_exists($var, $this->_pData);
	}

	function __get($var) {
		$func = 'dreg_license_'.$var.'_get';
		if (function_exists($func)) {
			$r = call_user_func($func,$this->_cPtr);
			if (!is_resource($r)) return $r;
			$c=substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3));
			return new $c($r);
		}
		if ($var === 'thisown') return swig_digium_register_get_newobject($this->_cPtr);
		return $this->_pData[$var];
	}

	public function __construct($res=null) {
		if (is_resource($res) && get_resource_type($res) === '_p_dreg_license') {
			$this->_cPtr=$res;
			return;
		}
		$this->_cPtr=new_dreg_license();
	}
}

class dreg_license_entry {
	public $_cPtr=null;
	protected $_pData=array();

	function __set($var,$value) {
		if ($var === 'next') return dreg_license_entry_next_set($this->_cPtr,$value);
		if ($var === 'thisown') return swig_digium_register_alter_newobject($this->_cPtr,$value);
		$this->_pData[$var] = $value;
	}

	function __isset($var) {
		if (function_exists('dreg_license_entry_'.$var.'_set')) return true;
		if ($var === 'thisown') return true;
		return array_key_exists($var, $this->_pData);
	}

	function __get($var) {
		$func = 'dreg_license_entry_'.$var.'_get';
		if (function_exists($func)) {
			$r = call_user_func($func,$this->_cPtr);
			if (!is_resource($r)) return $r;
			$c=substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3));
			return new $c($r);
		}
		if ($var === 'thisown') return swig_digium_register_get_newobject($this->_cPtr);
		return $this->_pData[$var];
	}

	public function __construct($res=null) {
		if (is_resource($res) && get_resource_type($res) === '_p_dreg_license_entry') {
			$this->_cPtr=$res;
			return;
		}
		$this->_cPtr=new_dreg_license_entry();
	}
}

class status {
	public $_cPtr=null;
	protected $_pData=array();

	function __set($var,$value) {
		if ($var === 'code') return status_code_set($this->_cPtr,$value);
		if ($var === 'message') return status_message_set($this->_cPtr,$value);
		if ($var === 'thisown') return swig_digium_register_alter_newobject($this->_cPtr,$value);
		$this->_pData[$var] = $value;
	}

	function __isset($var) {
		if (function_exists('status_'.$var.'_set')) return true;
		if ($var === 'thisown') return true;
		return array_key_exists($var, $this->_pData);
	}

	function __get($var) {
		$func = 'status_'.$var.'_get';
		if (function_exists($func)) {
			$r = call_user_func($func,$this->_cPtr);
			if (!is_resource($r)) return $r;
			$c=substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3));
			return new $c($r);
		}
		if ($var === 'thisown') return swig_digium_register_get_newobject($this->_cPtr);
		return $this->_pData[$var];
	}

	public function __construct($res=null) {
		if (is_resource($res) && get_resource_type($res) === '_p_status') {
			$this->_cPtr=$res;
			return;
		}
		$this->_cPtr=new_status();
	}
}


?>
