This is part of the cleanup Campbell wanted :)
authorKent Mein <mein@cs.umn.edu>
Thu, 25 Sep 2008 15:39:46 +0000 (15:39 +0000)
committerKent Mein <mein@cs.umn.edu>
Thu, 25 Sep 2008 15:39:46 +0000 (15:39 +0000)
Just getting rid of license_key stuff.

The project files still need to be updated:
projectfiles_vc7/blender/src/BL_src_cre.vcproj
projectfiles_vc7/blender/blendercompactNG.vcproj

Just search for these files in them.

Kent

intern/SoundSystem/intern/SND_Utils.cpp
source/blender/include/license_key.h [deleted file]
source/blender/src/cre/license.jpeg.c [deleted file]
source/blender/src/cre/license_key.c [deleted file]
source/blender/src/pub/license_key.c [deleted file]

index 7d441964b2436ff2e972454171e0cb6b92290fa1..05101a7e6e63d0ed9cf2aa689587ce4c98efc050 100644 (file)
 #include "SND_Utils.h"
 #include "SoundDefines.h"
 #include "SND_DependKludge.h"
-/*
-extern "C" { 
-#include "license_key.h"
-}
-*/
 #include <stdio.h>
 #include <stdlib.h>
 #include <fcntl.h>
diff --git a/source/blender/include/license_key.h b/source/blender/include/license_key.h
deleted file mode 100644 (file)
index 7dc14f4..0000000
+++ /dev/null
@@ -1,92 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-#ifndef LICENCEKEY_H
-#define LICENCEKEY_H
-
-#define I_AM_PUBLISHER temp_val2
-#define LICENSE_KEY_VALID temp_val
-#define SHOW_LICENSE_KEY rotop
-
-extern int LICENSE_KEY_VALID;
-extern int I_AM_PUBLISHER;
-
-extern char * license_key_name;
-extern void loadKeyboard(char * name);
-extern void checkhome(void);
-extern void SHOW_LICENSE_KEY(void);
-
-#define LICENSE_CHECK_0 (0==0)
-
-// Stuff from the Python files from Strubi
-
-typedef int (*Fptr)(void *);
-
-extern Fptr g_functab[];
-extern Fptr g_ptrtab[];
-
-// TODO: From here on, this should be a generated header file...
-
-// change all KEY_FUNC values 
-// if you change PYKEY_TABLEN or PYKEY_SEED
-// see below
-
-#define PYKEY_TABLEN 21 // don't change this unless needed. Other values
-                        // may yield bad random orders
-
-#define PYKEY_SEED {26,8,1972}
-
-// these values are generated by $HOME/develop/intern/keymaker/makeseed.py
-// from the above seed value. 
-
-// DO NOT EDIT THESE VALUES BY HAND!
-
-#define KEY_FUNC1 12
-#define KEY_FUNC2 8
-#define KEY_FUNC3 1
-#define KEY_FUNC4 16
-#define KEY_FUNC5 20
-#define KEY_FUNC6 18
-#define KEY_FUNC7 13
-#define KEY_FUNC8 6
-#define KEY_FUNC9 9
-#define KEY_FUNC10 7
-#define KEY_FUNC11 14
-#define KEY_FUNC12 0
-#define KEY_FUNC13 5
-#define KEY_FUNC14 10
-#define KEY_FUNC15 19
-#define KEY_FUNC16 2
-#define KEY_FUNC17 11
-#define KEY_FUNC18 3
-#define KEY_FUNC19 17
-#define KEY_FUNC20 15
-#define KEY_FUNC21 4
-
-#endif
-
diff --git a/source/blender/src/cre/license.jpeg.c b/source/blender/src/cre/license.jpeg.c
deleted file mode 100644 (file)
index 6d8f0e3..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-int datatoc_tonize= 0;
-char datatoc_ton[]= {0};
diff --git a/source/blender/src/cre/license_key.c b/source/blender/src/cre/license_key.c
deleted file mode 100644 (file)
index 37b67d4..0000000
+++ /dev/null
@@ -1,194 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#include "license_key.h"
-#include "keyed_functions.h"
-#include "BKE_utildefines.h"
-#include "BIF_screen.h"  // splash
-#include "BIF_toolbox.h"
-#include <stdio.h>
-#include <string.h>
-#include "BLO_readfile.h"
-//#include "BLO_keyStore.h"
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-int LICENSE_KEY_VALID = TRUE;
-int I_AM_PUBLISHER = TRUE;
-
-// Python stuff
-
-#include "Python.h"
-#include "marshal.h" 
-#include "compile.h" /* to give us PyCodeObject */
-#include "eval.h"              /* prototype for PyEval_EvalCode */
-
-#include "BPY_extern.h"
-#include "IMB_imbuf.h"
-
-Fptr g_functab[PYKEY_TABLEN];
-Fptr g_ptrtab[PYKEY_TABLEN];
-
-static int g_seed[3] = PYKEY_SEED;
-static PyObject *g_module_self;
-static PyObject *g_main;
-
-
-// end Python stuff
-
-// **************** PYTHON STUFF **************************
-/* ----------------------------------------------------- */
-/* this is the dummy functions to demonstrate */
-
-int sticky_shoes(void *vp)
-{
-#ifndef NDEBUG
-       printf("feature not enabled: Buy our Key NOW!\n");
-#endif
-       return 0;
-}
-
-/*
-int key_func1(void *vp) {
-       printf("function 1 called\n");
-}
-
-*/
-int key_return_true(void *vp) {
-#ifndef NDEBUG
-       printf("function 2 called (return true)\n");
-#endif
-       return 1;
-}
-
-/* ----------------------------------------------------- */
-
-/* Declarations for objects of type Fplist */
-
-
-#ifndef NDEBUG
-void feature1(void)
-{
-       Fptr f;
-
-       printf("feature 2 called\n");
-       f = g_ptrtab[KEY_FUNC2];
-       if (f) f(0);
-}
-
-void feature2(void)
-{
-       Fptr f;
-
-       printf("feature 3 called\n");
-       f = g_ptrtab[KEY_FUNC3];
-       if (f) f(0);
-}
-
-#endif
-
-
-/* Initialization function for the module (*must* be called initprot) */
-
-static void init_ftable(void)  // initializes functiontable
-{
-       int i;
-
-       g_functab[0] = &key_func1;
-
-       for (i = 1; i < PYKEY_TABLEN; i++)
-       {
-               g_functab[i] = &sticky_shoes;
-       }
-
-       // for debugging perposes
-       /*
-       for (i = 0; i < PYKEY_TABLEN; i++)
-       {
-               g_functab[i] = (Fptr *) (i + 100);
-       }
-       */
-}
-
-
-static void init_ptable(void)  // initializes functiontable
-{
-       int i;
-
-       for (i = 0; i < PYKEY_TABLEN; i++)
-       {
-               g_ptrtab[i] = &sticky_shoes;
-       }
-}
-
-
-#ifdef NDEBUG
-static void print_ptable(void)
-{      
-       int i;
-
-       for (i = 0; i < PYKEY_TABLEN; i++)
-       {
-               printf ("index[%02d] = %08x\n", i, g_ptrtab[i]);
-       }
-}
-#endif
-
-static void insertname(PyObject *m,PyObject *p, char *name)
-{
-}
-
-/* initialisation */
-static void initprot()
-{
-       init_ftable(); // malloc
-       init_ptable(); // malloc
-}
-
-// ******************************* KEY STUFF *********************
-
-void create_key_name(char * keyname)
-{
-}
-
-void checkhome()
-{
-       initprot();                   // initialize module and function tables
-       
-}
-
-void SHOW_LICENSE_KEY(void)
-{
-}
-
-void loadKeyboard(char * name)
-{
-}
diff --git a/source/blender/src/pub/license_key.c b/source/blender/src/pub/license_key.c
deleted file mode 100644 (file)
index 3b825f3..0000000
+++ /dev/null
@@ -1,444 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#include "license_key.h"
-#include "keyed_functions.h"
-#include "BKE_utildefines.h"
-#include "BIF_screen.h"  // splash
-#include "BIF_toolbox.h"
-#include "blenkey.h"
-#include <stdio.h>
-#include <string.h>
-
-#include "BLI_blenlib.h"
-
-#include "BLO_readfile.h"
-#include "BLO_keyStore.h"
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-int LICENSE_KEY_VALID = TRUE;
-int I_AM_PUBLISHER = TRUE;
-
-static UserStruct User;
-
-// Python stuff
-
-#include "Python.h"
-#include "marshal.h" 
-#include "compile.h" /* to give us PyCodeObject */
-#include "eval.h"              /* prototype for PyEval_EvalCode */
-
-#include "BPY_extern.h"
-
-#include "IMB_imbuf.h"
-
-Fptr g_functab[PYKEY_TABLEN];
-Fptr g_ptrtab[PYKEY_TABLEN];
-
-static int g_seed[3] = PYKEY_SEED;
-static PyObject *g_module_self;
-static PyObject *g_main;
-
-
-// end Python stuff
-
-// **************** PYTHON STUFF **************************
-/* ----------------------------------------------------- */
-/* this is the dummy functions to demonstrate */
-
-int sticky_shoes(void *vp)
-{
-       return 0;
-}
-
-/*
-int key_func1(void *vp) {
-       printf("function 1 called\n");
-}
-
-*/
-int key_return_true(void *vp) {
-       return 1;
-}
-
-
-/* ----------------------------------------------------- */
-
-/* Declarations for objects of type Fplist */
-
-
-static char prot_getseed__doc__[] = "";
-
-static PyObject *
-prot_getseed(self, args)
-       PyObject *self; /* Not used */
-       PyObject *args;
-{
-       PyObject *p;
-       p = PyTuple_New(3);
-       PyTuple_SetItem(p, 0, PyInt_FromLong(g_seed[0]));
-       PyTuple_SetItem(p, 1, PyInt_FromLong(g_seed[1]));
-       PyTuple_SetItem(p, 2, PyInt_FromLong(g_seed[2]));
-       return p;
-}
-
-static char prot_getlen__doc__[] = "";
-static PyObject *
-prot_getlen(self, args)
-       PyObject *self; /* Not used */
-       PyObject *args;
-{
-       return Py_BuildValue("i", PYKEY_TABLEN);
-}
-
-static char prot_getptr__doc__[] =
-""
-;
-
-static PyObject *
-prot_getptr(self, args)
-       PyObject *self; /* Not used */
-       PyObject *args;
-{
-       PyObject *p;
-       Fptr f;
-       int index;
-       /* we don't catch errors here, we're in the key code */
-       if (!g_functab)
-               return NULL;
-       if (!PyArg_ParseTuple(args, "i", &index))
-               return NULL;
-       if (index >= PYKEY_TABLEN)
-               return NULL;
-
-       f = g_functab[index];
-       p = PyCObject_FromVoidPtr(f , NULL);
-       return p;
-}
-
-static char prot_setptr__doc__[] =
-""
-;
-static PyObject *
-prot_setptr(self, args)
-       PyObject *self; /* Not used */
-       PyObject *args;
-{
-       PyObject *p;
-
-       int index;
-
-       if (!g_ptrtab) 
-               return NULL;
-       if (!PyArg_ParseTuple(args, "iO", &index, &p))
-               return NULL;
-       if (index >= PYKEY_TABLEN)
-               return NULL;
-       if (!PyCObject_Check(p)) {
-               return NULL;
-       }
-
-       g_ptrtab[index] = PyCObject_AsVoidPtr(p);
-       return Py_BuildValue("i", 1);
-}
-
-static PyObject *callkeycode(
-       unsigned char *keycode,
-       int keycodelen)
-{
-       PyCodeObject *code;
-       PyObject *maindict = PyModule_GetDict(g_main);
-
-       code = (PyCodeObject *) PyMarshal_ReadObjectFromString(keycode, keycodelen);
-       if (!PyEval_EvalCode(code, maindict, maindict))
-               return NULL;
-       return Py_BuildValue("i", 1);
-}
-
-
-
-/* List of methods defined in the module */
-
-static struct PyMethodDef prot_methods[] = {
-       {"getlen",      (PyCFunction)prot_getlen,       METH_VARARGS,   prot_getlen__doc__},
-       {"getseed",     (PyCFunction)prot_getseed,      METH_VARARGS,   prot_getseed__doc__},
-       {"getptr",      (PyCFunction)prot_getptr,       METH_VARARGS,   prot_getptr__doc__},
-       {"setptr",      (PyCFunction)prot_setptr,       METH_VARARGS,   prot_setptr__doc__},
-       {NULL,   (PyCFunction)NULL, 0, NULL}            /* sentinel */
-};
-
-
-/* Initialization function for the module (*must* be called initprot) */
-
-static char prot_module_documentation[] = "No Documentation";
-
-static void init_ftable(void)  // initializes functiontable
-{
-       int i;
-
-       g_functab[0] = &key_func1;
-/*  add more key_funcs here */
-
-       for (i = 1; i < PYKEY_TABLEN; i++)
-       {
-               g_functab[i] = &sticky_shoes;
-       }
-}
-
-
-static void init_ptable(void)  // initializes functiontable
-{
-       int i;
-
-       for (i = 0; i < PYKEY_TABLEN; i++)
-       {
-               g_ptrtab[i] = &sticky_shoes;
-       }
-}
-
-
-static void insertname(PyObject *m,PyObject *p, char *name)
-{
-       PyObject *d = PyModule_GetDict(m);
-
-       EXPP_dict_set_item_str(d, name, p);
-}
-
-/* initialisation */
-static void initprot()
-{
-       PyObject *m, *d;
-       PyObject *capi1;
-       init_ftable(); 
-
-       g_main = PyImport_AddModule("__main__");
-
-       m = Py_InitModule4("prot", prot_methods,
-               prot_module_documentation,
-               (PyObject*)NULL,PYTHON_API_VERSION);
-       g_module_self = m;      
-       d = PyModule_GetDict(m);
-       EXPP_dict_set_item_str(d, "error", PyString_FromString("prot.error");
-
-       /* add global object */
-
-       capi1 = PyCObject_FromVoidPtr((void *)g_functab , NULL);
-       if (capi1) {
-               insertname(m, capi1, "APIfunctab");
-       }       
-       
-       /* Check for errors */
-       if (PyErr_Occurred())
-               Py_FatalError("can't initialize module prot");
-
-       init_ptable(); 
-}
-
-// ******************************* KEY STUFF *********************
-
-static void create_key_name(char * keyname)
-{
-       sprintf(keyname, "%s/.BPkey", BLI_gethome());
-}
-
-void checkhome()
-{
-       int keyresult;
-       char *HexPriv, *HexPub, *HexPython;
-       byte *Byte;
-       char keyname[FILE_MAXDIR + FILE_MAXFILE];
-       int wasInitialized;
-       unsigned char *keycode = NULL;
-       int keycodelen = 0;
-
-       create_key_name(keyname);
-       keyresult = ReadKeyFile(keyname, &User, &HexPriv, &HexPub,
-                               &Byte, &HexPython);
-       if (keyresult != 0) {
-           // printf("\nReadKeyFile error %d\n", keyresult);
-       } else {
-           // printf("\nReadKeyFile OK\n");
-               LICENSE_KEY_VALID = TRUE;
-
-               wasInitialized = Py_IsInitialized();
-               
-               // make it failsafe if python interpreter was already initialized
-               if (wasInitialized) 
-                       Py_Initialize();
-                       
-               initprot();                   // initialize module and function tables
-               // get python byte code
-               keycode = DeHexify(HexPython);
-               keycodelen = strlen(HexPython) / 2;
-
-               callkeycode(keycode, keycodelen);
-
-               Py_Finalize(); 
-
-               if (wasInitialized)     // if we were initialized,
-                       BPY_start_python(); // restart creator python
-
-               //some debugging stuff
-               // print_ptable();
-
-               // Store key stuff for use by stream
-               keyStoreConstructor(
-                       &User,
-                       HexPriv,
-                       HexPub,
-                       Byte,
-                       HexPython);
-
-               // other initialization code
-
-       }
-}
-
-void SHOW_LICENSE_KEY(void)
-{
-       extern int datatoc_tonize;
-       extern char datatoc_ton[];
-       char string[1024];
-       int maxtype, type;
-       char *typestrings[] = {
-               "",
-               "Individual",
-               "Company",
-               "Unlimited",
-               "Educational"};
-
-       maxtype = (sizeof(typestrings) / sizeof(char *)) - 1;
-       type = User.keytype;
-       if (type > maxtype) {
-               type = 0;
-       }
-
-       if (LICENSE_KEY_VALID) {
-               sprintf(string, "%s License registered to: %s (%s)", typestrings[type], User.name, User.email);
-               splash((void *)datatoc_ton, datatoc_tonize, string);
-       }
-}
-
-void loadKeyboard(char * name)
-{
-       char keyname[FILE_MAXDIR + FILE_MAXFILE];
-       FILE *in, *out;
-       char string[1024], *match = 0;
-       int i, c;
-       int found = 0;
-
-       // make sure we don't overwrite a valid key...
-       
-       if (!LICENSE_KEY_VALID) {
-               in = fopen(name, "rb");
-               if (in) {
-                       // scan for blender key magic, read strings
-                       // with anything but a newline
-                       while (fscanf(in, "%1000[^\n\r]", string) != EOF) {
-                               match = strstr(string, BLENKEYMAGIC);
-                               if (match) {
-                                       break;
-                               }
-                               fscanf(in, "\n");
-                       }
-                       
-                       if (match) {
-                               // found blender key magic, open output file
-                               // to copy key information
-                               
-                               create_key_name(keyname);
-                               out = fopen(keyname, "wb");
-                               if (out) {
-                                       // printout first line
-                                       fprintf(out, "%s", match);
-                                       for (i = 0; i < 350; i++) {
-                                               // handle control characters (\n\r)
-                                               while (1) {
-                                                       c = getc(in);
-                                                       if (c == '\n') {
-                                                               // output a \n for each \n in the input
-                                                               fprintf(out, "\n");
-                                                       } else if (c == EOF) {
-                                                               break;
-                                                       } else if (c < ' ') {
-                                                               // skip control characters
-                                                       } else {
-                                                               ungetc(c, in);
-                                                               break;
-                                                       }
-                                               }
-                                               
-                                               if (fscanf(in, "%1000[^\n\r]", string) != EOF) {
-                                                       if (strcmp(string, BLENKEYSEPERATOR) == 0) {
-                                                               found++;
-                                                       }
-                                                       fprintf(out, "%s", string);
-                                               } else {
-                                                       break;
-                                               }
-
-                                               if (found >= 2) {
-                                                       break;
-                                               }
-                                       }
-                                       
-                                       fclose(out);
-                                       
-                                       checkhome();
-                                       if (LICENSE_KEY_VALID) {
-                                               SHOW_LICENSE_KEY();
-                                       } else {
-                                               error("Not a valid license key ! Removing installed key.");
-                                               BLI_delete(keyname, 0, 0);
-                                       }
-
-                               } else {
-                                       error("Can't install key");
-                               }
-                       } else {
-                               error("File doesn't contain a valid key: %s", name);
-                       }
-
-                       fclose(in);
-
-                       if (LICENSE_KEY_VALID) {
-                               if (okee("Remove input file: '%s'?", name)) {
-                                       BLI_delete(name, 0, 0);
-                               }
-                       }
-
-               } else {
-                       error("File doesn't exist: %s", name);
-               }
-       }
-}