Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ on:
# Triggers the workflow on push or pull request events but only for the master branch
push:
branches: [ master ]
pull_request:

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
Expand Down Expand Up @@ -34,5 +35,5 @@ jobs:
run: ./build-all.sh

- name: Run regression tests
run: env SKIP=8bit_encoding ./tests.py
run: env SKIP=8bit_encoding,async ./tests.py -j 100

13 changes: 11 additions & 2 deletions examples/cxx-api.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,15 @@
#include <thread>
#include <chrono>

#ifndef _WIN32
#include <unistd.h>
#else
#include <io.h>
#define STDIN_FILENO _fileno( stdin )
#define STDOUT_FILENO _fileno( stdout )
#define STDERR_FILENO _fileno( stderr )
#endif

#include "replxx.hxx"
#include "util.h"

Expand Down Expand Up @@ -397,7 +406,7 @@ int main( int argc_, char** argv_ ) {
}

// init the repl
Replxx rx;
Replxx rx( std::cin, std::cout, STDIN_FILENO, STDOUT_FILENO, STDERR_FILENO );
Tick tick( rx, keys, tickMessages, promptFan );
rx.install_window_change_handler();

Expand All @@ -419,7 +428,7 @@ int main( int argc_, char** argv_ ) {
// set the callbacks
using namespace std::placeholders;
rx.set_completion_callback( std::bind( &hook_completion, _1, _2, cref( examples ), ignoreCase ) );
rx.set_highlighter_callback( std::bind( &hook_color, _1, _2, cref( regex_color ), cref( word_color ) ) );
rx.set_highlighter_callback( Replxx::highlighter_callback_t( std::bind( &hook_color, _1, _2, cref( regex_color ), cref( word_color ) ) ) );
rx.set_hint_callback( std::bind( &hook_hint, _1, _2, _3, cref( examples ), ignoreCase ) );
if ( promptInCallback ) {
rx.set_modify_callback( std::bind( &hook_modify, _1, _2, &rx ) );
Expand Down
2 changes: 1 addition & 1 deletion include/replxx.h
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ typedef struct ReplxxHistoryEntryTag {
*
* \return Replxx library resource holder.
*/
// REPLXX_IMPEXP Replxx* replxx_init( void );
REPLXX_IMPEXP Replxx* replxx_init( void );

/*! \brief Cleanup resources used by Replxx library.
*
Expand Down
9 changes: 5 additions & 4 deletions src/replxx.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@

#include <algorithm>
#include <cstdarg>
#include <iostream>

#ifdef _WIN32

Expand Down Expand Up @@ -343,10 +344,10 @@ Replxx::Color rgb666( int red_, int green_, int blue_ ) {

}

// ::Replxx* replxx_init() {
// typedef ::Replxx* replxx_data_t;
// return ( reinterpret_cast<replxx_data_t>( new replxx::Replxx::ReplxxImpl( nullptr, nullptr, nullptr ) ) );
// }
::Replxx* replxx_init() {
typedef ::Replxx* replxx_data_t;
return ( reinterpret_cast<replxx_data_t>( new replxx::Replxx::ReplxxImpl( std::cin, std::cout, STDIN_FILENO, STDOUT_FILENO, STDERR_FILENO ) ) );
}

void replxx_end( ::Replxx* replxx_ ) {
delete reinterpret_cast<replxx::Replxx::ReplxxImpl*>( replxx_ );
Expand Down
Loading
Loading