Project

General

Profile

Revision 13

Imported lab4/

View differences:

lab4/.vscode/c_cpp_properties.json
1
{
2
  "env": {
3
    "minix.include": "${workspaceFolder}/../.minix-src/include"
4
  },
5
  "configurations": [{
6
    "name": "Minix",
7
    "compilerPath": "",
8
    "cStandard": "c11",
9
    "defines": ["__minix", "_MINIX ", "_NETBSD_SOURCE", "__i386__"],
10
    "includePath": ["${workspaceFolder}", "${env:minix.include}"],
11
    "browse": {
12
      "path": ["${workspaceFolder}", "${env:minix.include}"],
13
      "limitSymbolsToIncludedHeaders": false,
14
      "databaseFilename": ""
15
    }
16
  }],
17
  "version": 4
18
}
0 19

  
lab4/.vscode/extensions.json
1
{
2
	// See http://go.microsoft.com/fwlink/?LinkId=827846 to learn about workspace recommendations.
3
	// Extension identifier format: ${publisher}.${name}. Example: vscode.csharp
4
	// List of extensions which should be recommended for users of this workspace.
5
	"recommendations": [
6
		"austin.code-gnu-global",
7
		"ms-vscode.cpptools",
8
		"xaver.clang-format"
9
	],
10
	// List of extensions recommended by VS Code that should not be recommended for users of this workspace.
11
	"unwantedRecommendations": []
12
}
0 13

  
lab4/.vscode/settings.json
1
{
2
  "git.ignoreLimitWarning": true,
3
  "C_Cpp.clang_format_fallbackStyle": "LLVM",
4
  "diffEditor.ignoreTrimWhitespace": true,
5
  "editor.formatOnSave": false,
6
  "editor.tabSize": 2,
7
  "editor.wordWrap": "bounded",
8
  "editor.wordWrapColumn": 100,
9
  "files.associations": { },
10
}
0 11

  
lab4/.clang-format
1
BasedOnStyle: LLVM
2
AccessModifierOffset: -2
3
AlignAfterOpenBracket: true
4
AlignEscapedNewlinesLeft: false
5
AlignOperands: true
6
AlignTrailingComments: true
7
AllowAllParametersOfDeclarationOnNextLine: true
8
AllowShortBlocksOnASingleLine: true
9
AllowShortCaseLabelsOnASingleLine: true
10
AllowShortFunctionsOnASingleLine: All
11
AllowShortIfStatementsOnASingleLine: false
12
AllowShortLoopsOnASingleLine: true
13
AlwaysBreakAfterDefinitionReturnType: false
14
AlwaysBreakBeforeMultilineStrings: false
15
AlwaysBreakTemplateDeclarations: false
16
BinPackArguments: true
17
BinPackParameters: true
18
BraceWrapping:
19
  AfterClass:      false
20
  AfterControlStatement: false
21
  AfterEnum:       false
22
  AfterFunction:   false
23
  AfterNamespace:  false
24
  AfterObjCDeclaration: true
25
  AfterStruct:     false
26
  AfterUnion:      false
27
  BeforeCatch:     true
28
  BeforeElse:      true
29
  IndentBraces:    false
30
BreakBeforeBinaryOperators: None
31
BreakBeforeBraces: Custom
32
BreakBeforeTernaryOperators: true
33
BreakConstructorInitializersBeforeComma: false
34
ColumnLimit: 0
35
CommentPragmas: '^ IWYU pragma:'
36
ConstructorInitializerAllOnOneLineOrOnePerLine: false
37
ConstructorInitializerIndentWidth: 2
38
ContinuationIndentWidth: 2
39
Cpp11BracedListStyle: true
40
DerivePointerAlignment: false
41
DisableFormat: false
42
ExperimentalAutoDetectBinPacking: false
43
IndentCaseLabels: true
44
IndentPPDirectives: AfterHash
45
IndentWidth: 2
46
IndentWrappedFunctionNames: false
47
KeepEmptyLinesAtTheStartOfBlocks: true
48
Language: Cpp
49
MaxEmptyLinesToKeep: 1
50
NamespaceIndentation: None
51
ObjCBlockIndentWidth: 2
52
ObjCSpaceAfterProperty: false
53
ObjCSpaceBeforeProtocolList: true
54
PenaltyBreakBeforeFirstCallParameter: 19
55
PenaltyBreakComment: 300
56
PenaltyBreakFirstLessLess: 120
57
PenaltyBreakString: 1000
58
PenaltyExcessCharacter: 1000000
59
PenaltyReturnTypeOnItsOwnLine: 60
60
PointerAlignment: Right
61
SpaceAfterCStyleCast: true
62
SpaceBeforeAssignmentOperators: true
63
SpaceBeforeParens: ControlStatements
64
SpaceInEmptyParentheses: false
65
SpacesBeforeTrailingComments: 1
66
SpacesInAngles: false
67
SpacesInCStyleCastParentheses: false
68
SpacesInContainerLiterals: true
69
SpacesInParentheses: false
70
SpacesInSquareBrackets: false
71
Standard: Cpp11
72
TabWidth: 2
73
UseTab: Never
0 74

  
lab4/lab4.c
1
// IMPORTANT: you must include the following line in all your C files
2
#include <lcom/lcf.h>
3

  
4
#include <stdint.h>
5
#include <stdio.h>
6

  
7
// Any header files included below this line should have been created by you
8

  
9
int main(int argc, char *argv[]) {
10
  // sets the language of LCF messages (can be either EN-US or PT-PT)
11
  lcf_set_language("EN-US");
12

  
13
  // enables to log function invocations that are being "wrapped" by LCF
14
  // [comment this out if you don't want/need/ it]
15
  lcf_trace_calls("/home/lcom/labs/lab4/trace.txt");
16

  
17
  // enables to save the output of printf function calls on a file
18
  // [comment this out if you don't want/need it]
19
  lcf_log_output("/home/lcom/labs/lab4/output.txt");
20

  
21
  // handles control over to LCF
22
  // [LCF handles command line arguments and invokes the right function]
23
  if (lcf_start(argc, argv))
24
    return 1;
25

  
26
  // LCF clean up tasks
27
  // [must be the last statement before return]
28
  lcf_cleanup();
29

  
30
  return 0;
31
}
32

  
33

  
34
int (mouse_test_packet)(uint32_t cnt) {
35
    /* To be completed */
36
    printf("%s(%u): under construction\n", __func__, cnt);
37
    return 1;
38
}
39

  
40
int (mouse_test_remote)(uint16_t period, uint8_t cnt) {
41
    /* To be completed */
42
    printf("%s(%u, %u): under construction\n", __func__, period, cnt);
43
    return 1;
44
}
45

  
46
int (mouse_test_async)(uint8_t idle_time) {
47
    /* To be completed */
48
    printf("%s(%u): under construction\n", __func__, idle_time);
49
    return 1;
50
}
51

  
52
int (mouse_test_gesture)() {
53
    /* To be completed */
54
    printf("%s: under construction\n", __func__);
55
    return 1;
56
}

Also available in: Unified diff