#include <stdlib.h>

#include <string.h>
#include <ctype.h>
#include <stdio.h>
#include <time.h>

/*
	All netwin keys stored in common file:
		/etc/netwin_keys.dat
		/winnt/netwin_keys.dat

	Product creates itself a temporary key
	Customer registers via web site, and gives 'no' machine specific info
	Customer is given a 'use once' key
	Customer enter's 'use once key' and software contacts our site and
		gets real key
	If software cannot reach our site (direct or via proxy) then it
	creates email and asks it to be sent/faxed/posted into web page.
	Automatic return email contains key to be loaded.
As Used by a product
	k = nwkey_startup(productid,reason);
	if (!k) {
		Key problem %s,reason
	} else {	
		if (k.istemp)  printf("expires nnn)
		if (k.nusers<nnn) printf("User limit exceeded");
	}
	Once a month or less the startup will attempt to connect to
	netwinsite.com to confirm the key is valid.  If it does connect and
	the key is not valid, then report details and disable and email manager. 
As used by registration utility
	
	

	
	
	
*/


// Library functions:

typedef struct NWKEY {int nusers; int flags; char expires[100]; } NWKey ;
int nwkey_check(char *keystring, NWKey *k, char *reason)
{
	

}
int nwkey_make(
