-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added support for .hrl files and tidied up naming conventions etc
- Loading branch information
1 parent
df94bf6
commit 6bbf392
Showing
9 changed files
with
120 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,5 +5,5 @@ deps | |
*.plt | ||
*~ | ||
ebin/ | ||
md/.erl/* | ||
md/.erl | ||
src/ | ||
include/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
%%% Another testing record | ||
-record(banjo, { | ||
rupert = dict:new() :: dict(), | ||
bennie | ||
}). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
This is the .hrl file for testing | ||
|
||
```erlang | ||
-record(test, { | ||
bish = [] :: list(), | ||
bosh = [] :: list() | ||
}). | ||
``` | ||
Which is nice |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
%%% ----------------------------------------------------------------------------- | ||
%%% File util2.erl | ||
%%% @author Gordon Guthrie <gordonguthrie@vixo.com> | ||
%%% @doc | ||
%%% @copyright Hypernumbers Ltd | ||
%%% @private | ||
%%% | ||
%%% Created 22 Nov 2006 by Gordon Guthrie <gordonguthrie@vixo.com> | ||
%%% ----------------------------------------------------------------------------- | ||
%%%```erlang | ||
-module(util2). | ||
|
||
-export([ | ||
timestamp_to_date/1, | ||
get_timestamp/0 | ||
]). | ||
|
||
-define(MEGA, 1000000000000). | ||
-define(SEC, 1000000). | ||
|
||
|
||
%%% ----------------------------------------------------------------------------- | ||
%%% | ||
%%% Worker functions for the util2 | ||
%%% There are two util files cos you can't load one with try/catch into the | ||
%%% debugger (ie that one) | ||
%%% | ||
%%% ----------------------------------------------------------------------------- | ||
%%% | ||
%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | ||
%%% %%% | ||
%%% These functions are all utility functions %%% | ||
%%% %%% | ||
%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | ||
%%% | ||
%%%```erlang | ||
-spec get_timestamp() -> pos_integer(). | ||
get_timestamp()-> | ||
{Mega, Sec, Micro} = now(), | ||
?MEGA * Mega + ?SEC * Sec + Micro. | ||
|
||
timestamp_to_date(Stamp) when is_list(Stamp) -> | ||
timestamp_to_date(list_to_integer(Stamp)); | ||
timestamp_to_date(Stamp) when is_integer(Stamp) -> | ||
Mega = trunc(Stamp/?MEGA), | ||
Sec = trunc((Stamp - Mega * ?MEGA)/?SEC), | ||
Micro = Stamp - Mega * ?MEGA - Sec * ?SEC, | ||
{Mega, Sec, Micro}. | ||
|
File renamed without changes.