fprintf(stdout,
"%s: id: %d, content: \"%s\", start: \"%s\", current: \"%s\"\n",
- args->direction == ONIG_CALLOUT_DIRECTION_NORMAL ? "NORMAL" : "RETRACTION",
+ args->in == ONIG_CALLOUT_IN_PROGRESS ? "PROGRESS" : "RETRACTION",
args->id, content, args->start, args->current);
free(content);
#endif
}
-#define CALLOUT_CODE_BODY(func, dir, sid, cstart, cend, user, args, result) do { \
- args.direction = dir;\
+#define CALLOUT_CODE_BODY(func, ain, sid, cstart, cend, user, args, result) do { \
+ args.in = ain;\
args.of = ONIG_CALLOUT_OF_CODE;\
args.id = sid;\
args.content = cstart;\
#define RETRACTION_CALLOUT_CODE(func, sid, cstart, cend, user) do {\
int result;\
CalloutArgs args;\
- CALLOUT_CODE_BODY(func, ONIG_CALLOUT_DIRECTION_RETRACTION, sid, cstart, cend, user, args, result);\
+ CALLOUT_CODE_BODY(func, ONIG_CALLOUT_IN_RETRACTION, sid, cstart, cend, user, args, result);\
switch (result) {\
case ONIG_CALLOUT_FAIL:\
goto fail;\
/* Synchronize visible part of the type with OnigCalloutArgs */
typedef struct {
- int direction;
+ int in;
int of;
int id;
const OnigUChar* content;
GET_POINTER_INC(content_end, p);
if (IS_NOT_NULL(msa->mp->callout_of_code) &&
- (dirs & CALLOUT_DIRECTION_NORMAL) != 0) {
- CALLOUT_CODE_BODY(msa->mp->callout_of_code, ONIG_CALLOUT_DIRECTION_NORMAL,
+ (dirs & CALLOUT_IN_PROGRESS) != 0) {
+ CALLOUT_CODE_BODY(msa->mp->callout_of_code, ONIG_CALLOUT_IN_PROGRESS,
id, content_start, content_end,
msa->mp->callout_user_data, args, call_result);
switch (call_result) {
}
else {
retraction_callout:
- if ((dirs & CALLOUT_DIRECTION_RETRACTION) != 0 &&
+ if ((dirs & CALLOUT_IN_RETRACTION) != 0 &&
IS_NOT_NULL(msa->mp->retraction_callout_of_code)) {
STACK_PUSH_CALLOUT_CODE(id, content_start, content_end);
}
if (PEND) return ONIGERR_INVALID_CALLOUT_PATTERN;
}
- dirs = CALLOUT_DIRECTION_NORMAL;
+ dirs = CALLOUT_IN_PROGRESS;
code_start = p;
while (1) {
if (PEND) return ONIGERR_INVALID_CALLOUT_PATTERN;
if (PEND) return ONIGERR_END_PATTERN_IN_GROUP;
PFETCH_S(c);
if (c == '+') {
- dirs |= CALLOUT_DIRECTION_RETRACTION;
+ dirs |= CALLOUT_IN_RETRACTION;
if (PEND) return ONIGERR_END_PATTERN_IN_GROUP;
PFETCH_S(c);
}
else if (c == '-') {
- dirs = CALLOUT_DIRECTION_RETRACTION;
+ dirs = CALLOUT_IN_RETRACTION;
if (PEND) return ONIGERR_END_PATTERN_IN_GROUP;
PFETCH_S(c);
}