00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #include "python/py_winreg.h"
00022
00023 static struct const_vals {
00024 char *name;
00025 uint32 value;
00026 } module_const_vals[] = {
00027
00028
00029
00030 { "REG_NONE", REG_NONE },
00031 { "REG_SZ", REG_SZ },
00032 { "REG_EXPAND_SZ", REG_EXPAND_SZ },
00033 { "REG_BINARY", REG_BINARY },
00034 { "REG_DWORD", REG_DWORD },
00035 { "REG_DWORD_LE", REG_DWORD_LE },
00036 { "REG_DWORD_BE", REG_DWORD_BE },
00037 { "REG_LINK", REG_LINK },
00038 { "REG_MULTI_SZ", REG_MULTI_SZ },
00039 { "REG_RESOURCE_LIST", REG_RESOURCE_LIST },
00040 { "REG_FULL_RESOURCE_DESCRIPTOR", REG_FULL_RESOURCE_DESCRIPTOR },
00041 { "REG_RESOURCE_REQUIREMENTS_LIST", REG_RESOURCE_REQUIREMENTS_LIST },
00042
00043 { NULL },
00044 };
00045
00046 static void const_init(PyObject *dict)
00047 {
00048 struct const_vals *tmp;
00049 PyObject *obj;
00050
00051 for (tmp = module_const_vals; tmp->name; tmp++) {
00052 obj = PyInt_FromLong(tmp->value);
00053 PyDict_SetItemString(dict, tmp->name, obj);
00054 Py_DECREF(obj);
00055 }
00056 }
00057
00058
00059
00060
00061
00062 static PyMethodDef winreg_methods[] = {
00063 { NULL }
00064 };
00065
00066 void initwinreg(void)
00067 {
00068 PyObject *module, *dict;
00069
00070
00071
00072 module = Py_InitModule("winreg", winreg_methods);
00073 dict = PyModule_GetDict(module);
00074
00075
00076
00077 const_init(dict);
00078
00079
00080
00081 py_samba_init();
00082 }