missing PL_unify_chars (just copied from SWI).
This commit is contained in:
		@@ -557,3 +557,34 @@ PL_set_prolog_flag(const char *name, int flags, ...)
 | 
				
			|||||||
{
 | 
					{
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					int
 | 
				
			||||||
 | 
					PL_unify_chars(term_t t, int flags, size_t len, const char *s)
 | 
				
			||||||
 | 
					{ PL_chars_t text;
 | 
				
			||||||
 | 
					  term_t tail;
 | 
				
			||||||
 | 
					  int rc;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  if ( len == (size_t)-1 )
 | 
				
			||||||
 | 
					    len = strlen(s);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  text.text.t    = (char *)s;
 | 
				
			||||||
 | 
					  text.encoding  = ((flags&REP_UTF8) ? ENC_UTF8 : \
 | 
				
			||||||
 | 
							    (flags&REP_MB)   ? ENC_ANSI : ENC_ISO_LATIN_1);
 | 
				
			||||||
 | 
					  text.storage   = PL_CHARS_HEAP;
 | 
				
			||||||
 | 
					  text.length    = len;
 | 
				
			||||||
 | 
					  text.canonical = FALSE;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  flags &= ~(REP_UTF8|REP_MB|REP_ISO_LATIN_1);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  if ( (flags & PL_DIFF_LIST) )
 | 
				
			||||||
 | 
					  { tail = t+1;
 | 
				
			||||||
 | 
					    flags &= (~PL_DIFF_LIST);
 | 
				
			||||||
 | 
					  } else
 | 
				
			||||||
 | 
					  { tail = 0;
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  rc = PL_unify_text(t, tail, &text, flags);
 | 
				
			||||||
 | 
					  PL_free_text(&text);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  return rc;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user