chibipub

experimental activitypub node in C
git clone git://jb55.com/chibipub
Log | Files | Refs | README | LICENSE

env.h (333B)


      1 
      2 #pragma once
      3 
      4 #include <stdlib.h>
      5 
      6 static inline const char *get_hostname()
      7 {
      8 	return getenv("CHIBIPUB_HOST");
      9 }
     10 
     11 static inline const char *get_pubkey()
     12 {
     13 	return getenv("CHIBIPUB_PUBKEY");
     14 }
     15 
     16 static inline const char *get_id()
     17 {
     18 	const char *ret;
     19 	ret = getenv("CHIBIPUB_ID");
     20 
     21 	if (!ret)
     22 		return get_hostname();
     23 
     24 	return ret;
     25 }
     26