erl-interface - ing type question

Vance Shipley vances@REDACTED
Mon Mar 3 18:36:41 CET 2003


Daniel,

I would also highly recommend using ei for any new project.
However if you're already using erl_interface, as I am for one
driver, you can indeed handle strings.  Here's a snippet from
one of my drivers:

	ETERM *Msg, *pattern, *A;
	char *filename;

	pattern = erl_format("{filename, A}");
	if (erl_match(pattern, Msg)) {
		A = erl_var_content(pattern, "A");                      
			if (ERL_IS_LIST(A)) {
				filename = erl_iolist_to_string(A);
				...
				erl_free(filename);
			}
		erl_free_term(A);
	}
	erl_free_term(pattern);



   -Vance



More information about the erlang-questions mailing list