C語言extern的進階用法及說明
請參考下列網址
C 語言的宣告、定義、儲存類型 (storage class) 與連結性 (linkage)
C extern keyword
External and tentative definitions
config NETFILTER_XT_MATCH_STRING tristate '"string" match support' depends on NETFILTER_ADVANCED select TEXTSEARCH select TEXTSEARCH_KMP select TEXTSEARCH_BM select TEXTSEARCH_FSM help This option adds a `string' match, which allows you to look for pattern matchings in packets. To compile it as a module, choose M here. If unsure, say N.
int main() { json_object *retObj_1 = NULL, *retObj_2 = NULL, *json_obj = NULL; int val_1, val_2; json_obj = json_object_new_object(); /*Add object*/ json_object_object_add(json_obj, "item1", json_object_new_int(123)); json_object_object_add(json_obj, "item2", json_object_new_int(456)); /*讀出json_obj內的所有key and value*/ printf("%s\n", json_object_to_json_string(json_obj)); //-> { "item1": 123, "item2": 456 } /*Get object, 下列兩種取到的object是一樣的*/ retObj_1 = json_object_object_get(json_obj, "item1"); json_object_object_get_ex(json_obj, "item1", &retObj_2); //if retObj_1 = 0, item1 isn't existing val_1 = json_object_get_int (retObj_1); val_2 = json_object_get_int (retObj_2); printf(%d\n", json_object_get_int(val_1)); //-> 123 printf("%d\n", json_object_get_int(val_2)); //-> 123 }
substring()
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/substring
struct timeval { time_t tv_sec;/* seconds */ suseconds_t tv_usec;/* microseconds */ }