Browse Source

kcontext: wrapper kcontext_candidate_arg()

Serj Kalichev 2 years ago
parent
commit
37aa4964e7
2 changed files with 12 additions and 0 deletions
  1. 2 0
      klish/kcontext.h
  2. 10 0
      klish/ksession/kcontext.c

+ 2 - 0
klish/kcontext.h

@@ -51,6 +51,8 @@ FAUX_HIDDEN bool_t kcontext_set_pid(kcontext_t *context, pid_t pid);
 // Done
 bool_t kcontext_done(const kcontext_t *context);
 FAUX_HIDDEN bool_t kcontext_set_done(kcontext_t *context, bool_t done);
+// Wrappers
+kparg_t *kcontext_candidate_parg(const kcontext_t *context);
 
 C_DECL_END
 

+ 10 - 0
klish/ksession/kcontext.c

@@ -124,3 +124,13 @@ void kcontext_free(kcontext_t *context)
 
 	faux_free(context);
 }
+
+
+kparg_t *kcontext_candidate_parg(const kcontext_t *context)
+{
+	assert(context);
+	if (!context)
+		return NULL;
+
+	return kpargv_candidate_parg(kcontext_parent_pargv(context));
+}