python/py_winreg.c

説明を見る。
00001 /* 
00002    Python wrappers for DCERPC/SMB client routines.
00003 
00004    Copyright (C) Tim Potter, 2002
00005    
00006    This program is free software; you can redistribute it and/or modify
00007    it under the terms of the GNU General Public License as published by
00008    the Free Software Foundation; either version 2 of the License, or
00009    (at your option) any later version.
00010    
00011    This program is distributed in the hope that it will be useful,
00012    but WITHOUT ANY WARRANTY; without even the implied warranty of
00013    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014    GNU General Public License for more details.
00015    
00016    You should have received a copy of the GNU General Public License
00017    along with this program; if not, write to the Free Software
00018    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
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         /* Registry value types */
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  * Module initialisation 
00060  */
00061 
00062 static PyMethodDef winreg_methods[] = {
00063         { NULL }
00064 };
00065 
00066 void initwinreg(void)
00067 {
00068         PyObject *module, *dict;
00069 
00070         /* Initialise module */
00071 
00072         module = Py_InitModule("winreg", winreg_methods);
00073         dict = PyModule_GetDict(module);
00074 
00075         /* Initialise constants */
00076 
00077         const_init(dict);
00078 
00079         /* Do samba initialisation */
00080 
00081         py_samba_init();
00082 }

Sambaに対してSat Aug 29 21:23:14 2009に生成されました。  doxygen 1.4.7