Skip to content

Instantly share code, notes, and snippets.

@mheffner
Created August 19, 2009 19:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mheffner/170594 to your computer and use it in GitHub Desktop.
Save mheffner/170594 to your computer and use it in GitHub Desktop.
/* filea.c */
#include <stdio.h>
/* Include public API definitions. */
#include "ab.h"
/* Function provided by fileb.c */
int b_getval_super_secret(void);
/* Simple function internal to this file only. */
static int
a_internal_getval(void)
{
return 3;
}
/* Exported API function. */
const char *ab_get_string(void) __attribute__ ((visibility ("default") ));
const char *
ab_get_string(void)
{
static char buf[64];
snprintf(buf, sizeof(buf), "A val: %d, B val: %d",
a_internal_getval(),
b_getval_super_secret());
return buf;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment