src/bin/psql/command.c
static PQExpBuffer
gather_boolean_expression(PsqlScanState scan_state)
{
	PQExpBuffer exp_buf = createPQExpBuffer();
	int			num_options = 0;
	char	   *value;

	/* collect all arguments for the conditional command into exp_buf */
	while ((value = psql_scan_slash_option(scan_state,
										   OT_NORMAL, NULL, false)) != NULL)
	{
		/* add spaces between tokens */
		if (num_options > 0)
			appendPQExpBufferChar(exp_buf, ' ');
		appendPQExpBufferStr(exp_buf, value);
		num_options++;
		free(value);
	}

	return exp_buf;
}
/*
 * Read a boolean expression, return it as a PQExpBuffer string.
 *
 * Note: anything more or less than one token will certainly fail to be
 * parsed by ParseVariableBool, so we don't worry about complaining here.
 * This routine's return data structure will need to be rethought anyway
 * to support likely future extensions such as "\if defined VARNAME".
 */
Read a boolean expression, return it as a PQExpBuffer string.
Note: anything more or less than one token will certainly fail to be
parsed by ParseVariableBool, so we don't worry about complaining here.
This routine's return data structure will need to be rethought anyway
to support likely future extensions such as "\if defined VARNAME".
Read a boolean expression return it as a PQExpBuffer string . Note : anything more or less than one token will certainly fail to be parsed by ParseVariableBool so we don ' t worry about complaining here . This routine ' s return data structure will need to be rethought anyway to support likely future extensions such as " \ if defined VARNAME " .
static PQExpBuffer
gather_boolean_expression(PsqlScanState scan_state)
{
	PQExpBuffer exp_buf = createPQExpBuffer();
	int			num_options = 0;
	char	   *value;
	while ((value = psql_scan_slash_option(scan_state,
										   OT_NORMAL, NULL, false)) != NULL)
	{
		if (num_options > 0)
			appendPQExpBufferChar(exp_buf, ' ');
		appendPQExpBufferStr(exp_buf, value);
		num_options++;
		free(value);
	}
	return exp_buf;
}
static PQExpBuffer gather_boolean_expression ( PsqlScanState scan_state ) { PQExpBuffer exp_buf = createPQExpBuffer ( ) ; int num_options = 0 ; char * value ; while ( ( value = psql_scan_slash_option ( scan_state , OT_NORMAL , NULL , false ) ) != NULL ) { if ( num_options > 0 ) appendPQExpBufferChar ( exp_buf , ' ' ) ; appendPQExpBufferStr ( exp_buf , value ) ; num_options ++ ; free ( value ) ; } return exp_buf ; }
Read a boolean expression, return it as a PQExpBuffer string.
Read a boolean expression return it as a PQExpBuffer string .
/* collect all arguments for the conditional command into exp_buf */ /* add spaces between tokens */