Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TRCompletion.cxx
Go to the documentation of this file.
1// Author: Omar Zapata Omar.Zapata@cern.ch 2014
2
3/*************************************************************************
4 * Copyright (C) 1995-2021, Rene Brun and Fons Rademakers. *
5 * All rights reserved. *
6 * *
7 * For the licensing terms see $ROOTSYS/LICENSE. *
8 * For the list of contributors see $ROOTSYS/README/CREDITS. *
9 *************************************************************************/
10#include"TRCompletion.h"
11namespace ROOT {
12 namespace R {
13
21
23 }
24}
25
26char *ROOT::R::R_completion_generator(const char *text, int state)
27{
28 // If this is a new word to complete, initialize now. This
29 // involves saving 'text' to somewhere R can get it, calling
30 // completeToken(), and retrieving the completions.
31 //NOTE: R based code and ajusted to Rcpp
32 static int list_index, ncomp;
33 static char **compstrings;
34
35
36 if (!state) {
37 int i;
42 const void *vmax = vmaxget();
43
47 list_index = 0;
49 if (ncomp > 0) {
50 compstrings = (char **) malloc(ncomp * sizeof(char *));
51 if (!compstrings) return (char *)NULL;
52 for (i = 0; i < ncomp; i++)
54 }
55 UNPROTECT(4);
57 }
58
59 if (list_index < ncomp)
60 return compstrings[list_index++];
61 else {
62 /* nothing matched or remaining, returns NULL. */
63 if (ncomp > 0) free(compstrings);
64 }
65 return (char *)NULL;
66}
67
68
69char **ROOT::R::R_custom_completion(const char *text, int start, int end)
70{
71 //NOTE: R based code and ajusted to Rcpp
72 char **matches = (char **)NULL;
79
80 // We don't want spaces appended at the end. It's nedded everytime
81 // since readline>=6 resets it to ' '
83
87 UNPROTECT(3);
92 UNPROTECT(2);
93 return matches;
94}
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
Option_t Option_t TPoint TPoint const char text
int rl_attempted_completion_over
int rl_completion_append_character
char * rl_line_buffer
char ** rl_completion_matches()
#define free
Definition civetweb.c:1539
#define malloc
Definition civetweb.c:1536
SEXP RComp_assignBufferSym
char * R_completion_generator(const char *text, int state)
SEXP RComp_completeTokenSym
SEXP RComp_retrieveCompsSym
SEXP rcompgen_rho
SEXP RComp_assignStartSym
SEXP RComp_assignTokenSym
SEXP RComp_getFileCompSym
char ** R_custom_completion(const char *text, int start, int end)
SEXP RComp_assignEndSym
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...