Skip to content

Commit

Permalink
Specify the "g" in gRPC
Browse files Browse the repository at this point in the history
  • Loading branch information
ctiller committed Aug 29, 2016
1 parent 6e34f81 commit 8dfdb7e
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 5 deletions.
1 change: 1 addition & 0 deletions build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ settings:
'#3': Use "-preN" suffixes to identify pre-release versions
'#4': Per-language overrides are possible with (eg) ruby_version tag here
'#5': See the expand_version.py for all the quirks here
g_stands_for: good
version: 1.1.0-dev
filegroups:
- name: census
Expand Down
3 changes: 3 additions & 0 deletions include/grpc/grpc.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,9 @@ GRPCAPI void grpc_shutdown(void);
/** Return a string representing the current version of grpc */
GRPCAPI const char *grpc_version_string(void);

/** Return a string specifying what the 'g' in gRPC stands for */
GRPCAPI const char *grpc_g_stands_for(void);

/** Create a completion queue */
GRPCAPI grpc_completion_queue *grpc_completion_queue_create(void *reserved);

Expand Down
5 changes: 3 additions & 2 deletions src/core/lib/channel/http_client_filter.c
Original file line number Diff line number Diff line change
Expand Up @@ -233,8 +233,9 @@ static grpc_mdstr *user_agent_from_args(const grpc_channel_args *args,
}
}

gpr_asprintf(&tmp, "%sgrpc-c/%s (%s; %s)", is_first ? "" : " ",
grpc_version_string(), GPR_PLATFORM_STRING, transport_name);
gpr_asprintf(&tmp, "%sgrpc-c/%s (%s; %s; %s)", is_first ? "" : " ",
grpc_version_string(), GPR_PLATFORM_STRING, transport_name,
grpc_g_stands_for());
is_first = 0;
gpr_strvec_add(&v, tmp);

Expand Down
2 changes: 2 additions & 0 deletions src/core/lib/surface/version.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,5 @@
#include <grpc/grpc.h>

const char *grpc_version_string(void) { return "1.1.0-dev"; }

const char *grpc_g_stands_for(void) { return "good"; }
8 changes: 5 additions & 3 deletions templates/src/core/lib/surface/version.c.template
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,12 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/

/* This file is autogenerated from:
templates/src/core/surface/version.c.template */

#include <grpc/grpc.h>

const char *grpc_version_string(void) { return "${settings.core_version}"; }

const char *grpc_g_stands_for(void) { return "${settings.g_stands_for}"; }

0 comments on commit 8dfdb7e

Please sign in to comment.