1 #include "asn1fix_internal.h"
3 struct _cstring_pattern {
7 static int _asn1f_cstring_find_line_pattern(char *s, struct _cstring_pattern *);
10 asn1f_fix_cstring(arg_t *arg) {
11 asn1p_expr_t *expr = arg->expr;
14 if(expr->value && expr->value->type == ATV_STRING) {
15 struct _cstring_pattern cp;
16 char *buf = (char *)expr->value->value.string.buf;
17 int buflen = expr->value->value.string.size;
20 DEBUG("(%s) for line %d", expr->Identifier, expr->_lineno);
22 while(_asn1f_cstring_find_line_pattern(buf + start, &cp)) {
24 memmove(cp.start, cp.start + cp.length,
25 buflen - ((cp.start + cp.length) - buf));
27 start = cp.start - buf;
36 * If a string has a newline, the tabulation and spaces before and
37 * after it must be eliminated.
40 _asn1f_cstring_find_line_pattern(char *s, struct _cstring_pattern *cp) {
41 int newline_found = 0;
57 cp->length = (size_t)(s - cp->start);