enhancement and fixes for D binding

This commit is contained in:
Marenz 2011-05-16 00:01:13 +02:00
parent ea3b9cbbf9
commit 917ef4cff2
2 changed files with 40 additions and 40 deletions

View File

@ -90,12 +90,16 @@ extern (C) MatchVar varTypes[];
/** /**
* Get the type of variable name. * Get the type of variable name.
*/ */
Bool isRoutingVar(char *name, size_t len); Bool psyc_isRoutingVar(char *name, size_t len);
alias psyc_isRoutingVar isRoutingVar;
/** /**
* Get the type of variable name. * Get the type of variable name.
*/ */
Type getVarType(char *name, size_t len); Type psyc_getVarType(char *name, size_t len);
alias psyc_getVarType getVarType;
/** /**
* Checks if long keyword string inherits from short keyword string. * Checks if long keyword string inherits from short keyword string.

View File

@ -19,66 +19,62 @@ enum ParseFlag
*/ */
enum ParseRC enum ParseRC
{ {
/// Error, packet is not ending with a valid delimiter. /// Error, packet is not ending with a valid delimiter.
ERROR_END = -8, ERROR_END = -8,
/// Error, expected NL after the method. /// Error, expected NL after the method.
ERROR_METHOD = -7, ERROR_METHOD = -7,
/// Error, expected NL after a modifier. /// Error, expected NL after a modifier.
ERROR_MOD_NL = -6, ERROR_MOD_NL = -6,
/// Error, modifier length is not numeric. /// Error, modifier length is not numeric.
ERROR_MOD_LEN = -5, ERROR_MOD_LEN = -5,
/// Error, expected TAB before modifier value. /// Error, expected TAB before modifier value.
ERROR_MOD_TAB = -4, ERROR_MOD_TAB = -4,
/// Error, modifier name is missing. /// Error, modifier name is missing.
ERROR_MOD_NAME = -3, ERROR_MOD_NAME = -3,
/// Error, expected NL after the content length. /// Error, expected NL after the content length.
ERROR_LENGTH = -2, ERROR_LENGTH = -2,
/// Error in packet. /// Error in packet.
ERROR = -1, ERROR = -1,
// Success, used internally. /// Buffer contains insufficient amount of data.
SUCCESS = 0, /// Fill another buffer and concatenate it with the end of the current buffer,
/// Buffer contains insufficient amount of data. /// from the cursor position to the end.
/// Fill another buffer and concatenate it with the end of the current buffer,
/// from the cursor position to the end.
INSUFFICIENT = 1, INSUFFICIENT = 1,
/// Routing modifier parsing done. /// Routing modifier parsing done.
/// Operator, name & value contains the respective parts. /// Operator, name & value contains the respective parts.
ROUTING = 2, ROUTING = 2,
/// Start of an incomplete entity modifier. /// Start of an incomplete entity modifier.
/// Operator & name are complete, value is incomplete. /// Operator & name are complete, value is incomplete.
ENTITY_START = 3, ENTITY_START = 3,
/// Continuation of an incomplete entity modifier. /// Continuation of an incomplete entity modifier.
ENTITY_CONT = 4, ENTITY_CONT = 4,
/// End of an incomplete entity modifier. /// End of an incomplete entity modifier.
ENTITY_END = 5, ENTITY_END = 5,
/// Entity modifier parsing done in one go. /// Entity modifier parsing done in one go.
/// Operator, name & value contains the respective parts. /// Operator, name & value contains the respective parts.
ENTITY = 6, ENTITY = 6,
/// Start of an incomplete body. /// Start of an incomplete body.
/// Name contains method, value contains part of the body. /// Name contains method, value contains part of the body.
BODY_START = 7, BODY_START = 7,
/// Continuation of an incomplete body. /// Continuation of an incomplete body.
BODY_CONT = 8, BODY_CONT = 8,
/// End of an incomplete body. /// End of an incomplete body.
BODY_END = 9, BODY_END = 9,
/// Body parsing done in one go, name contains method, value contains body. /// Body parsing done in one go, name contains method, value contains body.
BODY = 10, BODY = 10,
/// Start of an incomplete content, value contains part of content. /// Start of an incomplete content, value contains part of content.
/// Used when ROUTING_ONLY is set. /// Used when ROUTING_ONLY is set.
CONTENT_START = 7, CONTENT_START = 7,
/// Continuation of an incomplete body. /// Continuation of an incomplete body.
/// Used when ROUTING_ONLY is set. /// Used when ROUTING_ONLY is set.
CONTENT_CONT = 8, CONTENT_CONT = 8,
/// End of an incomplete body. /// End of an incomplete body.
/// Used when ROUTING_ONLY is set. /// Used when ROUTING_ONLY is set.
CONTENT_END = 9, CONTENT_END = 9,
/// Content parsing done in one go, value contains the whole content. /// Content parsing done in one go, value contains the whole content.
/// Used when ROUTING_ONLY is set. /// Used when ROUTING_ONLY is set.
CONTENT = 10, CONTENT = 10,
// Binary value parsing complete, used internally. /// Finished parsing packet.
COMPLETE = 11, COMPLETE = 11
// Binary value parsing incomplete, used internally.
INCOMPLETE = 12,
} }
/** /**