aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/grpc/support
diff options
context:
space:
mode:
authorGravatar Vijay Pai <vpai@google.com>2018-01-25 15:38:20 -0800
committerGravatar Vijay Pai <vpai@google.com>2018-01-25 20:11:38 -0800
commit8a99fdb57e564f2166f5f83e50baa4c47e9a3f8d (patch)
tree2b64f9540e493ead5e08bf9680e46c2c1f5d8828 /include/grpc/support
parent5e82dddc056bd488e0ba1ba0057247ab23e442d4 (diff)
Move cmdline and subprocess from public gpr to test/core/util
Diffstat (limited to 'include/grpc/support')
-rw-r--r--include/grpc/support/cmdline.h88
-rw-r--r--include/grpc/support/subprocess.h44
2 files changed, 0 insertions, 132 deletions
diff --git a/include/grpc/support/cmdline.h b/include/grpc/support/cmdline.h
deleted file mode 100644
index c34a109fbd..0000000000
--- a/include/grpc/support/cmdline.h
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#ifndef GRPC_SUPPORT_CMDLINE_H
-#define GRPC_SUPPORT_CMDLINE_H
-
-#include <grpc/support/port_platform.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/** Simple command line parser.
-
- Supports flags that can be specified as -foo, --foo, --no-foo, -no-foo, etc
- And integers, strings that can be specified as -foo=4, -foo blah, etc
-
- No support for short command line options (but we may get that in the
- future.)
-
- Usage (for a program with a single flag argument 'foo'):
-
- int main(int argc, char **argv) {
- gpr_cmdline *cl;
- int verbose = 0;
-
- cl = gpr_cmdline_create("My cool tool");
- gpr_cmdline_add_int(cl, "verbose", "Produce verbose output?", &verbose);
- gpr_cmdline_parse(cl, argc, argv);
- gpr_cmdline_destroy(cl);
-
- if (verbose) {
- gpr_log(GPR_INFO, "Goodbye cruel world!");
- }
-
- return 0;
- } */
-
-typedef struct gpr_cmdline gpr_cmdline;
-
-/** Construct a command line parser: takes a short description of the tool
- doing the parsing */
-GPRAPI gpr_cmdline* gpr_cmdline_create(const char* description);
-/** Add an integer parameter, with a name (used on the command line) and some
- helpful text (used in the command usage) */
-GPRAPI void gpr_cmdline_add_int(gpr_cmdline* cl, const char* name,
- const char* help, int* value);
-/** The same, for a boolean flag */
-GPRAPI void gpr_cmdline_add_flag(gpr_cmdline* cl, const char* name,
- const char* help, int* value);
-/** And for a string */
-GPRAPI void gpr_cmdline_add_string(gpr_cmdline* cl, const char* name,
- const char* help, const char** value);
-/** Set a callback for non-named arguments */
-GPRAPI void gpr_cmdline_on_extra_arg(
- gpr_cmdline* cl, const char* name, const char* help,
- void (*on_extra_arg)(void* user_data, const char* arg), void* user_data);
-/** Enable surviving failure: default behavior is to exit the process */
-GPRAPI void gpr_cmdline_set_survive_failure(gpr_cmdline* cl);
-/** Parse the command line; returns 1 on success, on failure either dies
- (by default) or returns 0 if gpr_cmdline_set_survive_failure() has been
- called */
-GPRAPI int gpr_cmdline_parse(gpr_cmdline* cl, int argc, char** argv);
-/** Destroy the parser */
-GPRAPI void gpr_cmdline_destroy(gpr_cmdline* cl);
-/** Get a string describing usage */
-GPRAPI char* gpr_cmdline_usage_string(gpr_cmdline* cl, const char* argv0);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* GRPC_SUPPORT_CMDLINE_H */
diff --git a/include/grpc/support/subprocess.h b/include/grpc/support/subprocess.h
deleted file mode 100644
index 175f7b50eb..0000000000
--- a/include/grpc/support/subprocess.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#ifndef GRPC_SUPPORT_SUBPROCESS_H
-#define GRPC_SUPPORT_SUBPROCESS_H
-
-#include <grpc/support/port_platform.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-typedef struct gpr_subprocess gpr_subprocess;
-
-/** .exe on windows, empty on unices */
-GPRAPI const char* gpr_subprocess_binary_extension();
-
-GPRAPI gpr_subprocess* gpr_subprocess_create(int argc, const char** argv);
-/** if subprocess has not been joined, kill it */
-GPRAPI void gpr_subprocess_destroy(gpr_subprocess* p);
-/** returns exit status; can be called at most once */
-GPRAPI int gpr_subprocess_join(gpr_subprocess* p);
-GPRAPI void gpr_subprocess_interrupt(gpr_subprocess* p);
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
-
-#endif /* GRPC_SUPPORT_SUBPROCESS_H */