ThingPlug GMMP library for mbed
Dependents: ThingPlug_WiFi_Example
Network/TCPclient/Utility.cpp@0:32c20cfb2b30, 2015-07-23 (annotated)
- Committer:
- lesmin
- Date:
- Thu Jul 23 00:55:15 2015 +0000
- Revision:
- 0:32c20cfb2b30
initial commit
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
lesmin | 0:32c20cfb2b30 | 1 | #include "Utility.h" |
lesmin | 0:32c20cfb2b30 | 2 | |
lesmin | 0:32c20cfb2b30 | 3 | void delay(int ms) { |
lesmin | 0:32c20cfb2b30 | 4 | wait_ms(ms); |
lesmin | 0:32c20cfb2b30 | 5 | } |
lesmin | 0:32c20cfb2b30 | 6 | |
lesmin | 0:32c20cfb2b30 | 7 | char* strdup(const char* s) { |
lesmin | 0:32c20cfb2b30 | 8 | char* ret = (char*) malloc(strlen(s) + 1); |
lesmin | 0:32c20cfb2b30 | 9 | if (ret == NULL) { return ret;} |
lesmin | 0:32c20cfb2b30 | 10 | return strcpy(ret, s); |
lesmin | 0:32c20cfb2b30 | 11 | } |