[Strings] add string constant for the internal XML attributes used in dumps

Add string constants for signature method, signature type, private key
(file path or content), private key password and certificate (file path
or content).

Add cast for xmlChar constant strings definition in python bindings, it
assumed all constant strings were char*.
This commit is contained in:
Benjamin Dauvergne 2010-09-01 12:41:28 +02:00
parent 8ebeeb9a36
commit 35ff3d6950
5 changed files with 39 additions and 4 deletions

View File

@ -364,7 +364,7 @@ protected static native void destroy(long cptr);
elif c[0] == 's':
print >>fd, wrapper_decl(s,'jstring')
print >>fd, ') {'
print >>fd, ' return (*env)->NewStringUTF(env, %s);' % c[1]
print >>fd, ' return (*env)->NewStringUTF(env, (char*) %s);' % c[1]
print >>fd, '}'
elif c[0] == 'b':
print >>fd, wrapper_decl(s,'jboolean')

View File

@ -223,7 +223,7 @@ INCLUDE: LassoNode.xs
if type == 'i':
self.xs.pn('ct = newSViv(%s);' % name)
elif type == 's':
self.xs.pn('ct = newSVpv(%s, 0);' % name)
self.xs.pn('ct = newSVpv((char*)%s, 0);' % name)
elif type == 'b': # only one case LASSO_WSF_ENABLED
self.xs.unindent()
self.xs.pn('''#ifdef %s

View File

@ -76,7 +76,7 @@ PHP_MINIT_FUNCTION(lasso)
if c[0] == 'i':
print >> self.fd, ' REGISTER_LONG_CONSTANT("%s", %s, CONST_CS|CONST_PERSISTENT);' % (c[1], c[1])
elif c[0] == 's':
print >> self.fd, ' REGISTER_STRING_CONSTANT("%s", %s, CONST_CS|CONST_PERSISTENT);' % (c[1], c[1])
print >> self.fd, ' REGISTER_STRING_CONSTANT("%s", (char*) %s, CONST_CS|CONST_PERSISTENT);' % (c[1], c[1])
elif c[0] == 'b':
print >> self.fd, '''\
#ifdef %s

View File

@ -692,7 +692,7 @@ register_constants(PyObject *d)
if c[0] == 'i':
print >> fd, ' obj = PyInt_FromLong(%s);' % c[1]
elif c[0] == 's':
print >> fd, ' obj = PyString_FromString(%s);' % c[1]
print >> fd, ' obj = PyString_FromString((char*)%s);' % c[1]
elif c[0] == 'b':
print >> fd, '''\
#ifdef %s

View File

@ -131,6 +131,41 @@
*/
#define LASSO_PYTHON_HREF "http://www.entrouvert.org/namespaces/python/0.0"
/**
* LASSO_SIGNATURE_TYPE_ATTRIBUTE:
*
* Attribute name for the Lasso signature type attribute.
*/
#define LASSO_SIGNATURE_TYPE_ATTRIBUTE BAD_CAST "SignatureType"
/**
* LASSO_SIGNATURE_METHOD_ATTRIBUTE:
*
* Attribute name for the Lasso signature type attribute.
*/
#define LASSO_SIGNATURE_METHOD_ATTRIBUTE BAD_CAST "SignatureMethod"
/**
* LASSO_PRIVATE_KEY_ATTRIBUTE:
*
* Attribute name for the Lasso private key attribute.
*/
#define LASSO_PRIVATE_KEY_ATTRIBUTE BAD_CAST "PrivateKey"
/**
* LASSO_PRIVATE_KEY_PASSWORD_ATTRIBUTE:
*
* Attribute name for the Lasso private key attribute.
*/
#define LASSO_PRIVATE_KEY_PASSWORD_ATTRIBUTE BAD_CAST "PrivateKeyPassword"
/**
* LASSO_CERTIFICATE_ATTRIBUTE:
*
* Attribute name for the Lasso private key attribute.
*/
#define LASSO_CERTIFICATE_ATTRIBUTE BAD_CAST "Certificate"
/*****************************************************************************/
/* Liberty Alliance ID-FF */
/*****************************************************************************/